OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "arm/lithium-codegen-arm.h" | 30 #include "arm/lithium-codegen-arm.h" |
31 #include "arm/lithium-gap-resolver-arm.h" | 31 #include "arm/lithium-gap-resolver-arm.h" |
32 #include "code-stubs.h" | 32 #include "code-stubs.h" |
33 #include "stub-cache.h" | 33 #include "stub-cache.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 | 38 |
39 static SaveFPRegsMode GetSaveFPRegsMode() { | |
40 // We don't need to save floating point regs when generating the snapshot | |
41 return CpuFeatures::IsSafeForSnapshot(VFP32DREGS) | |
42 ? kSaveFPRegs | |
43 : kDontSaveFPRegs; | |
44 } | |
45 | |
46 | |
47 class SafepointGenerator : public CallWrapper { | 39 class SafepointGenerator : public CallWrapper { |
48 public: | 40 public: |
49 SafepointGenerator(LCodeGen* codegen, | 41 SafepointGenerator(LCodeGen* codegen, |
50 LPointerMap* pointers, | 42 LPointerMap* pointers, |
51 Safepoint::DeoptMode mode) | 43 Safepoint::DeoptMode mode) |
52 : codegen_(codegen), | 44 : codegen_(codegen), |
53 pointers_(pointers), | 45 pointers_(pointers), |
54 deopt_mode_(mode) { } | 46 deopt_mode_(mode) { } |
55 virtual ~SafepointGenerator() { } | 47 virtual ~SafepointGenerator() { } |
56 | 48 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 // Store it in the context. | 236 // Store it in the context. |
245 MemOperand target = ContextOperand(cp, var->index()); | 237 MemOperand target = ContextOperand(cp, var->index()); |
246 __ str(r0, target); | 238 __ str(r0, target); |
247 // Update the write barrier. This clobbers r3 and r0. | 239 // Update the write barrier. This clobbers r3 and r0. |
248 __ RecordWriteContextSlot( | 240 __ RecordWriteContextSlot( |
249 cp, | 241 cp, |
250 target.offset(), | 242 target.offset(), |
251 r0, | 243 r0, |
252 r3, | 244 r3, |
253 GetLinkRegisterState(), | 245 GetLinkRegisterState(), |
254 GetSaveFPRegsMode()); | 246 kSaveFPRegs); |
255 } | 247 } |
256 } | 248 } |
257 Comment(";;; End allocate local context"); | 249 Comment(";;; End allocate local context"); |
258 } | 250 } |
259 | 251 |
260 // Trace the call. | 252 // Trace the call. |
261 if (FLAG_trace && info()->IsOptimizing()) { | 253 if (FLAG_trace && info()->IsOptimizing()) { |
262 __ CallRuntime(Runtime::kTraceEnter, 0); | 254 __ CallRuntime(Runtime::kTraceEnter, 0); |
263 } | 255 } |
264 return !is_aborted(); | 256 return !is_aborted(); |
(...skipping 2808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 __ str(value, target); | 3065 __ str(value, target); |
3074 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3066 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3075 HType type = instr->hydrogen()->value()->type(); | 3067 HType type = instr->hydrogen()->value()->type(); |
3076 SmiCheck check_needed = | 3068 SmiCheck check_needed = |
3077 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3069 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3078 __ RecordWriteContextSlot(context, | 3070 __ RecordWriteContextSlot(context, |
3079 target.offset(), | 3071 target.offset(), |
3080 value, | 3072 value, |
3081 scratch, | 3073 scratch, |
3082 GetLinkRegisterState(), | 3074 GetLinkRegisterState(), |
3083 GetSaveFPRegsMode(), | 3075 kSaveFPRegs, |
3084 EMIT_REMEMBERED_SET, | 3076 EMIT_REMEMBERED_SET, |
3085 check_needed); | 3077 check_needed); |
3086 } | 3078 } |
3087 | 3079 |
3088 __ bind(&skip_assignment); | 3080 __ bind(&skip_assignment); |
3089 } | 3081 } |
3090 | 3082 |
3091 | 3083 |
3092 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 3084 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
3093 Register object = ToRegister(instr->object()); | 3085 Register object = ToRegister(instr->object()); |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4262 __ mov(scratch, Operand(instr->transition())); | 4254 __ mov(scratch, Operand(instr->transition())); |
4263 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4255 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4264 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4256 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
4265 Register temp = ToRegister(instr->temp()); | 4257 Register temp = ToRegister(instr->temp()); |
4266 // Update the write barrier for the map field. | 4258 // Update the write barrier for the map field. |
4267 __ RecordWriteField(object, | 4259 __ RecordWriteField(object, |
4268 HeapObject::kMapOffset, | 4260 HeapObject::kMapOffset, |
4269 scratch, | 4261 scratch, |
4270 temp, | 4262 temp, |
4271 GetLinkRegisterState(), | 4263 GetLinkRegisterState(), |
4272 GetSaveFPRegsMode(), | 4264 kSaveFPRegs, |
4273 OMIT_REMEMBERED_SET, | 4265 OMIT_REMEMBERED_SET, |
4274 OMIT_SMI_CHECK); | 4266 OMIT_SMI_CHECK); |
4275 } | 4267 } |
4276 } | 4268 } |
4277 | 4269 |
4278 // Do the store. | 4270 // Do the store. |
4279 HType type = instr->hydrogen()->value()->type(); | 4271 HType type = instr->hydrogen()->value()->type(); |
4280 SmiCheck check_needed = | 4272 SmiCheck check_needed = |
4281 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4273 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4282 if (instr->is_in_object()) { | 4274 if (instr->is_in_object()) { |
4283 __ str(value, FieldMemOperand(object, offset)); | 4275 __ str(value, FieldMemOperand(object, offset)); |
4284 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4276 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4285 // Update the write barrier for the object for in-object properties. | 4277 // Update the write barrier for the object for in-object properties. |
4286 __ RecordWriteField(object, | 4278 __ RecordWriteField(object, |
4287 offset, | 4279 offset, |
4288 value, | 4280 value, |
4289 scratch, | 4281 scratch, |
4290 GetLinkRegisterState(), | 4282 GetLinkRegisterState(), |
4291 GetSaveFPRegsMode(), | 4283 kSaveFPRegs, |
4292 EMIT_REMEMBERED_SET, | 4284 EMIT_REMEMBERED_SET, |
4293 check_needed); | 4285 check_needed); |
4294 } | 4286 } |
4295 } else { | 4287 } else { |
4296 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4288 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4297 __ str(value, FieldMemOperand(scratch, offset)); | 4289 __ str(value, FieldMemOperand(scratch, offset)); |
4298 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4290 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4299 // Update the write barrier for the properties array. | 4291 // Update the write barrier for the properties array. |
4300 // object is used as a scratch register. | 4292 // object is used as a scratch register. |
4301 __ RecordWriteField(scratch, | 4293 __ RecordWriteField(scratch, |
4302 offset, | 4294 offset, |
4303 value, | 4295 value, |
4304 object, | 4296 object, |
4305 GetLinkRegisterState(), | 4297 GetLinkRegisterState(), |
4306 GetSaveFPRegsMode(), | 4298 kSaveFPRegs, |
4307 EMIT_REMEMBERED_SET, | 4299 EMIT_REMEMBERED_SET, |
4308 check_needed); | 4300 check_needed); |
4309 } | 4301 } |
4310 } | 4302 } |
4311 } | 4303 } |
4312 | 4304 |
4313 | 4305 |
4314 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4306 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4315 ASSERT(ToRegister(instr->object()).is(r1)); | 4307 ASSERT(ToRegister(instr->object()).is(r1)); |
4316 ASSERT(ToRegister(instr->value()).is(r0)); | 4308 ASSERT(ToRegister(instr->value()).is(r0)); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4490 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4482 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4491 HType type = instr->hydrogen()->value()->type(); | 4483 HType type = instr->hydrogen()->value()->type(); |
4492 SmiCheck check_needed = | 4484 SmiCheck check_needed = |
4493 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4485 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4494 // Compute address of modified element and store it into key register. | 4486 // Compute address of modified element and store it into key register. |
4495 __ add(key, store_base, Operand(offset - kHeapObjectTag)); | 4487 __ add(key, store_base, Operand(offset - kHeapObjectTag)); |
4496 __ RecordWrite(elements, | 4488 __ RecordWrite(elements, |
4497 key, | 4489 key, |
4498 value, | 4490 value, |
4499 GetLinkRegisterState(), | 4491 GetLinkRegisterState(), |
4500 GetSaveFPRegsMode(), | 4492 kSaveFPRegs, |
4501 EMIT_REMEMBERED_SET, | 4493 EMIT_REMEMBERED_SET, |
4502 check_needed); | 4494 check_needed); |
4503 } | 4495 } |
4504 } | 4496 } |
4505 | 4497 |
4506 | 4498 |
4507 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { | 4499 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { |
4508 // By cases: external, fast double | 4500 // By cases: external, fast double |
4509 if (instr->is_external()) { | 4501 if (instr->is_external()) { |
4510 DoStoreKeyedExternalArray(instr); | 4502 DoStoreKeyedExternalArray(instr); |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6008 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6000 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6009 __ ldr(result, FieldMemOperand(scratch, | 6001 __ ldr(result, FieldMemOperand(scratch, |
6010 FixedArray::kHeaderSize - kPointerSize)); | 6002 FixedArray::kHeaderSize - kPointerSize)); |
6011 __ bind(&done); | 6003 __ bind(&done); |
6012 } | 6004 } |
6013 | 6005 |
6014 | 6006 |
6015 #undef __ | 6007 #undef __ |
6016 | 6008 |
6017 } } // namespace v8::internal | 6009 } } // namespace v8::internal |
OLD | NEW |