Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add constant for index of first barrier-free slot. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 1210
1211 // If the object is not a value type, return the object. 1211 // If the object is not a value type, return the object.
1212 __ CmpObjectType(input, JS_VALUE_TYPE, kScratchRegister); 1212 __ CmpObjectType(input, JS_VALUE_TYPE, kScratchRegister);
1213 __ j(not_equal, &done, Label::kNear); 1213 __ j(not_equal, &done, Label::kNear);
1214 __ movq(result, FieldOperand(input, JSValue::kValueOffset)); 1214 __ movq(result, FieldOperand(input, JSValue::kValueOffset));
1215 1215
1216 __ bind(&done); 1216 __ bind(&done);
1217 } 1217 }
1218 1218
1219 1219
1220 void LCodeGen::DoDateField(LDateField* instr) {
1221 Register input = ToRegister(instr->InputAt(0));
1222 Register result = ToRegister(instr->result());
1223 ASSERT(input.is(result));
1224
1225 #ifdef DEBUG
1226 __ AbortIfSmi(input);
1227 __ CmpObjectType(input, JS_DATE_TYPE, kScratchRegister);
1228 __ Assert(equal, "Trying to get date field from non-date.");
1229 #endif
1230
1231 __ movq(result, FieldOperand(input,
1232 JSDate::kValueOffset + kPointerSize * instr->index()));
1233 }
1234
1235
1236 void LCodeGen::DoSetDateField(LSetDateField* instr) {
1237 Register date = ToRegister(instr->InputAt(0));
1238 Register value = ToRegister(instr->InputAt(1));
1239 Register result = ToRegister(instr->result());
1240 int index = instr->index();
1241
1242 #ifdef DEBUG
1243 __ AbortIfSmi(date);
1244 __ CmpObjectType(date, JS_DATE_TYPE, kScratchRegister);
1245 __ Assert(equal, "Trying to get date field from non-date.");
1246 #endif
1247
1248 __ movq(FieldOperand(date, JSDate::kValueOffset + kPointerSize * index),
1249 value);
1250 // Caches can only be smi or NaN, so we can skip the write barrier for them.
1251 if (index < JSDate::kFirstBarrierFree) {
1252 // Update the write barrier. Save the value as it will be
1253 // overwritten by the write barrier code and is needed afterward.
1254 __ movq(result, value);
1255 __ RecordWriteField(date, JSDate::kValueOffset + kPointerSize * index,
1256 value, kScratchRegister, kDontSaveFPRegs);
1257 }
1258 }
1259
1260
1220 void LCodeGen::DoBitNotI(LBitNotI* instr) { 1261 void LCodeGen::DoBitNotI(LBitNotI* instr) {
1221 LOperand* input = instr->InputAt(0); 1262 LOperand* input = instr->InputAt(0);
1222 ASSERT(input->Equals(instr->result())); 1263 ASSERT(input->Equals(instr->result()));
1223 __ not_(ToRegister(input)); 1264 __ not_(ToRegister(input));
1224 } 1265 }
1225 1266
1226 1267
1227 void LCodeGen::DoThrow(LThrow* instr) { 1268 void LCodeGen::DoThrow(LThrow* instr) {
1228 __ push(ToRegister(instr->InputAt(0))); 1269 __ push(ToRegister(instr->InputAt(0)));
1229 CallRuntime(Runtime::kThrow, 1, instr); 1270 CallRuntime(Runtime::kThrow, 1, instr);
(...skipping 3175 matching lines...) Expand 10 before | Expand all | Expand 10 after
4405 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4446 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4406 ASSERT(osr_pc_offset_ == -1); 4447 ASSERT(osr_pc_offset_ == -1);
4407 osr_pc_offset_ = masm()->pc_offset(); 4448 osr_pc_offset_ = masm()->pc_offset();
4408 } 4449 }
4409 4450
4410 #undef __ 4451 #undef __
4411 4452
4412 } } // namespace v8::internal 4453 } } // namespace v8::internal
4413 4454
4414 #endif // V8_TARGET_ARCH_X64 4455 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698