OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 403 } |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 407 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
408 DCHECK(ToRegister(instr->context()).is(cp)); | 408 DCHECK(ToRegister(instr->context()).is(cp)); |
409 DCHECK(ToRegister(instr->function()).Is(x1)); | 409 DCHECK(ToRegister(instr->function()).Is(x1)); |
410 DCHECK(ToRegister(instr->result()).Is(x0)); | 410 DCHECK(ToRegister(instr->result()).Is(x0)); |
411 | 411 |
412 int arity = instr->arity(); | 412 int arity = instr->arity(); |
413 CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); | 413 CallFunctionFlags flags = instr->hydrogen()->function_flags(); |
414 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 414 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 415 Register slot_register = ToRegister(instr->temp_slot()); |
| 416 Register vector_register = ToRegister(instr->temp_vector()); |
| 417 DCHECK(slot_register.is(x3)); |
| 418 DCHECK(vector_register.is(x2)); |
| 419 |
| 420 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 421 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 422 |
| 423 __ Mov(vector_register, vector); |
| 424 __ Mov(slot_register, Operand(Smi::FromInt(index))); |
| 425 |
| 426 CallICState::CallType call_type = |
| 427 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; |
| 428 |
| 429 Handle<Code> ic = |
| 430 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); |
| 431 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 432 } else { |
| 433 CallFunctionStub stub(isolate(), arity, flags); |
| 434 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 435 } |
415 after_push_argument_ = false; | 436 after_push_argument_ = false; |
416 } | 437 } |
417 | 438 |
418 | 439 |
419 void LCodeGen::DoCallNew(LCallNew* instr) { | 440 void LCodeGen::DoCallNew(LCallNew* instr) { |
420 DCHECK(ToRegister(instr->context()).is(cp)); | 441 DCHECK(ToRegister(instr->context()).is(cp)); |
421 DCHECK(instr->IsMarkedAsCall()); | 442 DCHECK(instr->IsMarkedAsCall()); |
422 DCHECK(ToRegister(instr->constructor()).is(x1)); | 443 DCHECK(ToRegister(instr->constructor()).is(x1)); |
423 | 444 |
424 __ Mov(x0, instr->arity()); | 445 __ Mov(x0, instr->arity()); |
(...skipping 5638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6063 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6084 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6064 __ Push(scope_info); | 6085 __ Push(scope_info); |
6065 __ Push(ToRegister(instr->function())); | 6086 __ Push(ToRegister(instr->function())); |
6066 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6087 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6067 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6088 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6068 } | 6089 } |
6069 | 6090 |
6070 | 6091 |
6071 | 6092 |
6072 } } // namespace v8::internal | 6093 } } // namespace v8::internal |
OLD | NEW |