| 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/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 | 367 |
| 368 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 368 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 369 DCHECK(ToRegister(instr->context()).is(cp)); | 369 DCHECK(ToRegister(instr->context()).is(cp)); |
| 370 DCHECK(ToRegister(instr->function()).Is(x1)); | 370 DCHECK(ToRegister(instr->function()).Is(x1)); |
| 371 DCHECK(ToRegister(instr->result()).Is(x0)); | 371 DCHECK(ToRegister(instr->result()).Is(x0)); |
| 372 | 372 |
| 373 int arity = instr->arity(); | 373 int arity = instr->arity(); |
| 374 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | |
| 375 if (instr->hydrogen()->HasVectorAndSlot()) { | 374 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 376 Register slot_register = ToRegister(instr->temp_slot()); | 375 Register slot_register = ToRegister(instr->temp_slot()); |
| 377 Register vector_register = ToRegister(instr->temp_vector()); | 376 Register vector_register = ToRegister(instr->temp_vector()); |
| 378 DCHECK(slot_register.is(x3)); | 377 DCHECK(slot_register.is(x3)); |
| 379 DCHECK(vector_register.is(x2)); | 378 DCHECK(vector_register.is(x2)); |
| 380 | 379 |
| 381 AllowDeferredHandleDereference vector_structure_check; | 380 AllowDeferredHandleDereference vector_structure_check; |
| 382 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 381 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 383 int index = vector->GetIndex(instr->hydrogen()->slot()); | 382 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 384 | 383 |
| 385 __ Mov(vector_register, vector); | 384 __ Mov(vector_register, vector); |
| 386 __ Mov(slot_register, Operand(Smi::FromInt(index))); | 385 __ Mov(slot_register, Operand(Smi::FromInt(index))); |
| 387 | 386 |
| 388 CallICState::CallType call_type = | |
| 389 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
| 390 | |
| 391 Handle<Code> ic = | 387 Handle<Code> ic = |
| 392 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | 388 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); |
| 393 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 389 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 394 } else { | 390 } else { |
| 395 CallFunctionStub stub(isolate(), arity, flags); | 391 __ Mov(x0, arity); |
| 396 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 392 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); |
| 397 } | 393 } |
| 398 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 394 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
| 399 } | 395 } |
| 400 | 396 |
| 401 | 397 |
| 402 void LCodeGen::DoCallNew(LCallNew* instr) { | 398 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 403 DCHECK(ToRegister(instr->context()).is(cp)); | 399 DCHECK(ToRegister(instr->context()).is(cp)); |
| 404 DCHECK(instr->IsMarkedAsCall()); | 400 DCHECK(instr->IsMarkedAsCall()); |
| 405 DCHECK(ToRegister(instr->constructor()).is(x1)); | 401 DCHECK(ToRegister(instr->constructor()).is(x1)); |
| 406 | 402 |
| (...skipping 5561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5968 Handle<ScopeInfo> scope_info = instr->scope_info(); | 5964 Handle<ScopeInfo> scope_info = instr->scope_info(); |
| 5969 __ Push(scope_info); | 5965 __ Push(scope_info); |
| 5970 __ Push(ToRegister(instr->function())); | 5966 __ Push(ToRegister(instr->function())); |
| 5971 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5967 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5972 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5968 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5973 } | 5969 } |
| 5974 | 5970 |
| 5975 | 5971 |
| 5976 } // namespace internal | 5972 } // namespace internal |
| 5977 } // namespace v8 | 5973 } // namespace v8 |
| OLD | NEW |