OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "arm/lithium-codegen-arm.h" | 7 #include "arm/lithium-codegen-arm.h" |
8 #include "arm/lithium-gap-resolver-arm.h" | 8 #include "arm/lithium-gap-resolver-arm.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void LCodeGen::FinishCode(Handle<Code> code) { | 60 void LCodeGen::FinishCode(Handle<Code> code) { |
61 ASSERT(is_done()); | 61 ASSERT(is_done()); |
62 code->set_stack_slots(GetStackSlotCount()); | 62 code->set_stack_slots(GetStackSlotCount()); |
63 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 63 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
64 if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); | 64 if (code->is_optimized_code()) RegisterWeakObjectsInOptimizedCode(code); |
65 PopulateDeoptimizationData(code); | 65 PopulateDeoptimizationData(code); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 void LCodeGen::Abort(BailoutReason reason) { | |
70 info()->set_bailout_reason(reason); | |
71 status_ = ABORTED; | |
72 } | |
73 | |
74 | |
75 void LCodeGen::SaveCallerDoubles() { | 69 void LCodeGen::SaveCallerDoubles() { |
76 ASSERT(info()->saves_caller_doubles()); | 70 ASSERT(info()->saves_caller_doubles()); |
77 ASSERT(NeedsEagerFrame()); | 71 ASSERT(NeedsEagerFrame()); |
78 Comment(";;; Save clobbered callee double registers"); | 72 Comment(";;; Save clobbered callee double registers"); |
79 int count = 0; | 73 int count = 0; |
80 BitVector* doubles = chunk()->allocated_double_registers(); | 74 BitVector* doubles = chunk()->allocated_double_registers(); |
81 BitVector::Iterator save_iterator(doubles); | 75 BitVector::Iterator save_iterator(doubles); |
82 while (!save_iterator.Done()) { | 76 while (!save_iterator.Done()) { |
83 __ vstr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()), | 77 __ vstr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()), |
84 MemOperand(sp, count * kDoubleSize)); | 78 MemOperand(sp, count * kDoubleSize)); |
(...skipping 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4068 HObjectAccess access = instr->hydrogen()->access(); | 4062 HObjectAccess access = instr->hydrogen()->access(); |
4069 int offset = access.offset(); | 4063 int offset = access.offset(); |
4070 | 4064 |
4071 if (access.IsExternalMemory()) { | 4065 if (access.IsExternalMemory()) { |
4072 Register value = ToRegister(instr->value()); | 4066 Register value = ToRegister(instr->value()); |
4073 MemOperand operand = MemOperand(object, offset); | 4067 MemOperand operand = MemOperand(object, offset); |
4074 __ Store(value, operand, representation); | 4068 __ Store(value, operand, representation); |
4075 return; | 4069 return; |
4076 } | 4070 } |
4077 | 4071 |
4078 Handle<Map> transition = instr->transition(); | |
4079 SmiCheck check_needed = | 4072 SmiCheck check_needed = |
4080 instr->hydrogen()->value()->IsHeapObject() | 4073 instr->hydrogen()->value()->IsHeapObject() |
4081 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4074 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4082 | 4075 |
4083 ASSERT(!(representation.IsSmi() && | 4076 ASSERT(!(representation.IsSmi() && |
4084 instr->value()->IsConstantOperand() && | 4077 instr->value()->IsConstantOperand() && |
4085 !IsSmi(LConstantOperand::cast(instr->value())))); | 4078 !IsSmi(LConstantOperand::cast(instr->value())))); |
4086 if (representation.IsHeapObject()) { | 4079 if (representation.IsHeapObject()) { |
4087 Register value = ToRegister(instr->value()); | 4080 Register value = ToRegister(instr->value()); |
4088 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4081 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
4089 __ SmiTst(value); | 4082 __ SmiTst(value); |
4090 DeoptimizeIf(eq, instr->environment()); | 4083 DeoptimizeIf(eq, instr->environment()); |
4091 | 4084 |
4092 // We know now that value is not a smi, so we can omit the check below. | 4085 // We know now that value is not a smi, so we can omit the check below. |
4093 check_needed = OMIT_SMI_CHECK; | 4086 check_needed = OMIT_SMI_CHECK; |
4094 } | 4087 } |
4095 } else if (representation.IsDouble()) { | 4088 } else if (representation.IsDouble()) { |
4096 ASSERT(transition.is_null()); | |
4097 ASSERT(access.IsInobject()); | 4089 ASSERT(access.IsInobject()); |
| 4090 ASSERT(!instr->hydrogen()->has_transition()); |
4098 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4091 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4099 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4092 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4100 __ vstr(value, FieldMemOperand(object, offset)); | 4093 __ vstr(value, FieldMemOperand(object, offset)); |
4101 return; | 4094 return; |
4102 } | 4095 } |
4103 | 4096 |
4104 if (!transition.is_null()) { | 4097 if (instr->hydrogen()->has_transition()) { |
| 4098 Handle<Map> transition = instr->hydrogen()->transition_map(); |
| 4099 AddDeprecationDependency(transition); |
4105 __ mov(scratch, Operand(transition)); | 4100 __ mov(scratch, Operand(transition)); |
4106 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4101 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4107 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4102 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
4108 Register temp = ToRegister(instr->temp()); | 4103 Register temp = ToRegister(instr->temp()); |
4109 // Update the write barrier for the map field. | 4104 // Update the write barrier for the map field. |
4110 __ RecordWriteField(object, | 4105 __ RecordWriteField(object, |
4111 HeapObject::kMapOffset, | 4106 HeapObject::kMapOffset, |
4112 scratch, | 4107 scratch, |
4113 temp, | 4108 temp, |
4114 GetLinkRegisterState(), | 4109 GetLinkRegisterState(), |
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5835 __ ldr(result, FieldMemOperand(scratch, | 5830 __ ldr(result, FieldMemOperand(scratch, |
5836 FixedArray::kHeaderSize - kPointerSize)); | 5831 FixedArray::kHeaderSize - kPointerSize)); |
5837 __ bind(deferred->exit()); | 5832 __ bind(deferred->exit()); |
5838 __ bind(&done); | 5833 __ bind(&done); |
5839 } | 5834 } |
5840 | 5835 |
5841 | 5836 |
5842 #undef __ | 5837 #undef __ |
5843 | 5838 |
5844 } } // namespace v8::internal | 5839 } } // namespace v8::internal |
OLD | NEW |