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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if ((code->kind() == Code::BINARY_OP_IC) || | 359 if ((code->kind() == Code::BINARY_OP_IC) || |
360 (code->kind() == Code::COMPARE_IC)) { | 360 (code->kind() == Code::COMPARE_IC)) { |
361 // Signal that we don't inline smi code before these stubs in the | 361 // Signal that we don't inline smi code before these stubs in the |
362 // optimizing code generator. | 362 // optimizing code generator. |
363 InlineSmiCheckInfo::EmitNotInlined(masm()); | 363 InlineSmiCheckInfo::EmitNotInlined(masm()); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 368 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 369 HCallFunction* hinstr = instr->hydrogen(); |
369 DCHECK(ToRegister(instr->context()).is(cp)); | 370 DCHECK(ToRegister(instr->context()).is(cp)); |
370 DCHECK(ToRegister(instr->function()).Is(x1)); | 371 DCHECK(ToRegister(instr->function()).Is(x1)); |
371 DCHECK(ToRegister(instr->result()).Is(x0)); | 372 DCHECK(ToRegister(instr->result()).Is(x0)); |
372 | 373 |
373 int arity = instr->arity(); | 374 int arity = instr->arity(); |
374 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); | 375 ConvertReceiverMode mode = hinstr->convert_mode(); |
375 if (instr->hydrogen()->HasVectorAndSlot()) { | 376 TailCallMode tail_call_mode = hinstr->tail_call_mode(); |
| 377 if (hinstr->HasVectorAndSlot()) { |
376 Register slot_register = ToRegister(instr->temp_slot()); | 378 Register slot_register = ToRegister(instr->temp_slot()); |
377 Register vector_register = ToRegister(instr->temp_vector()); | 379 Register vector_register = ToRegister(instr->temp_vector()); |
378 DCHECK(slot_register.is(x3)); | 380 DCHECK(slot_register.is(x3)); |
379 DCHECK(vector_register.is(x2)); | 381 DCHECK(vector_register.is(x2)); |
380 | 382 |
381 AllowDeferredHandleDereference vector_structure_check; | 383 AllowDeferredHandleDereference vector_structure_check; |
382 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 384 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |
383 int index = vector->GetIndex(instr->hydrogen()->slot()); | 385 int index = vector->GetIndex(hinstr->slot()); |
384 | 386 |
385 __ Mov(vector_register, vector); | 387 __ Mov(vector_register, vector); |
386 __ Mov(slot_register, Operand(Smi::FromInt(index))); | 388 __ Mov(slot_register, Operand(Smi::FromInt(index))); |
387 | 389 |
388 Handle<Code> ic = | 390 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode, |
389 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 391 tail_call_mode) |
| 392 .code(); |
390 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 393 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
391 } else { | 394 } else { |
392 __ Mov(x0, arity); | 395 __ Mov(x0, arity); |
393 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 396 CallCode(isolate()->builtins()->Call(mode, tail_call_mode), |
| 397 RelocInfo::CODE_TARGET, instr); |
394 } | 398 } |
395 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 399 RecordPushedArgumentsDelta(hinstr->argument_delta()); |
396 } | 400 } |
397 | 401 |
398 | 402 |
399 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 403 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
400 DCHECK(instr->IsMarkedAsCall()); | 404 DCHECK(instr->IsMarkedAsCall()); |
401 DCHECK(ToRegister(instr->context()).is(cp)); | 405 DCHECK(ToRegister(instr->context()).is(cp)); |
402 DCHECK(ToRegister(instr->constructor()).is(x1)); | 406 DCHECK(ToRegister(instr->constructor()).is(x1)); |
403 | 407 |
404 __ Mov(x0, Operand(instr->arity())); | 408 __ Mov(x0, Operand(instr->arity())); |
405 if (instr->arity() == 1) { | 409 if (instr->arity() == 1) { |
(...skipping 5354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5760 Handle<ScopeInfo> scope_info = instr->scope_info(); | 5764 Handle<ScopeInfo> scope_info = instr->scope_info(); |
5761 __ Push(scope_info); | 5765 __ Push(scope_info); |
5762 __ Push(ToRegister(instr->function())); | 5766 __ Push(ToRegister(instr->function())); |
5763 CallRuntime(Runtime::kPushBlockContext, instr); | 5767 CallRuntime(Runtime::kPushBlockContext, instr); |
5764 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5768 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5765 } | 5769 } |
5766 | 5770 |
5767 | 5771 |
5768 } // namespace internal | 5772 } // namespace internal |
5769 } // namespace v8 | 5773 } // namespace v8 |
OLD | NEW |