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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 4091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4102 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 4102 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
4103 } | 4103 } |
4104 | 4104 |
4105 | 4105 |
4106 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 4106 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
4107 DCHECK(ToRegister(instr->context()).is(cp)); | 4107 DCHECK(ToRegister(instr->context()).is(cp)); |
4108 DCHECK(ToRegister(instr->function()).is(r1)); | 4108 DCHECK(ToRegister(instr->function()).is(r1)); |
4109 DCHECK(ToRegister(instr->result()).is(r0)); | 4109 DCHECK(ToRegister(instr->result()).is(r0)); |
4110 | 4110 |
4111 int arity = instr->arity(); | 4111 int arity = instr->arity(); |
4112 CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); | 4112 CallFunctionFlags flags = instr->hydrogen()->function_flags(); |
4113 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4113 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 4114 Register slot_register = ToRegister(instr->temp_slot()); |
| 4115 Register vector_register = ToRegister(instr->temp_vector()); |
| 4116 DCHECK(slot_register.is(r3)); |
| 4117 DCHECK(vector_register.is(r2)); |
| 4118 |
| 4119 AllowDeferredHandleDereference vector_structure_check; |
| 4120 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 4121 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 4122 |
| 4123 __ Move(vector_register, vector); |
| 4124 __ mov(slot_register, Operand(Smi::FromInt(index))); |
| 4125 |
| 4126 CallICState::CallType call_type = |
| 4127 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; |
| 4128 |
| 4129 Handle<Code> ic = |
| 4130 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); |
| 4131 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4132 } else { |
| 4133 CallFunctionStub stub(isolate(), arity, flags); |
| 4134 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4135 } |
4114 } | 4136 } |
4115 | 4137 |
4116 | 4138 |
4117 void LCodeGen::DoCallNew(LCallNew* instr) { | 4139 void LCodeGen::DoCallNew(LCallNew* instr) { |
4118 DCHECK(ToRegister(instr->context()).is(cp)); | 4140 DCHECK(ToRegister(instr->context()).is(cp)); |
4119 DCHECK(ToRegister(instr->constructor()).is(r1)); | 4141 DCHECK(ToRegister(instr->constructor()).is(r1)); |
4120 DCHECK(ToRegister(instr->result()).is(r0)); | 4142 DCHECK(ToRegister(instr->result()).is(r0)); |
4121 | 4143 |
4122 __ mov(r0, Operand(instr->arity())); | 4144 __ mov(r0, Operand(instr->arity())); |
4123 // No cell in r2 for construct type feedback in optimized code | 4145 // No cell in r2 for construct type feedback in optimized code |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5956 __ Push(scope_info); | 5978 __ Push(scope_info); |
5957 __ push(ToRegister(instr->function())); | 5979 __ push(ToRegister(instr->function())); |
5958 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5980 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5959 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5981 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5960 } | 5982 } |
5961 | 5983 |
5962 | 5984 |
5963 #undef __ | 5985 #undef __ |
5964 | 5986 |
5965 } } // namespace v8::internal | 5987 } } // namespace v8::internal |
OLD | NEW |