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 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 4120 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 4121 |
| 4122 __ Move(vector_register, vector); |
| 4123 __ mov(slot_register, Operand(Smi::FromInt(index))); |
| 4124 |
| 4125 CallICState::CallType call_type = |
| 4126 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; |
| 4127 |
| 4128 Handle<Code> ic = |
| 4129 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); |
| 4130 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4131 } else { |
| 4132 CallFunctionStub stub(isolate(), arity, flags); |
| 4133 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4134 } |
4114 } | 4135 } |
4115 | 4136 |
4116 | 4137 |
4117 void LCodeGen::DoCallNew(LCallNew* instr) { | 4138 void LCodeGen::DoCallNew(LCallNew* instr) { |
4118 DCHECK(ToRegister(instr->context()).is(cp)); | 4139 DCHECK(ToRegister(instr->context()).is(cp)); |
4119 DCHECK(ToRegister(instr->constructor()).is(r1)); | 4140 DCHECK(ToRegister(instr->constructor()).is(r1)); |
4120 DCHECK(ToRegister(instr->result()).is(r0)); | 4141 DCHECK(ToRegister(instr->result()).is(r0)); |
4121 | 4142 |
4122 __ mov(r0, Operand(instr->arity())); | 4143 __ mov(r0, Operand(instr->arity())); |
4123 // No cell in r2 for construct type feedback in optimized code | 4144 // 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); | 5977 __ Push(scope_info); |
5957 __ push(ToRegister(instr->function())); | 5978 __ push(ToRegister(instr->function())); |
5958 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5979 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5959 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5980 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5960 } | 5981 } |
5961 | 5982 |
5962 | 5983 |
5963 #undef __ | 5984 #undef __ |
5964 | 5985 |
5965 } } // namespace v8::internal | 5986 } } // namespace v8::internal |
OLD | NEW |