| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 // rcx - allocation site (loaded from vector[slot]). | 1471 // rcx - allocation site (loaded from vector[slot]). |
| 1472 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8); | 1472 __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8); |
| 1473 __ cmpp(rdi, r8); | 1473 __ cmpp(rdi, r8); |
| 1474 __ j(not_equal, miss); | 1474 __ j(not_equal, miss); |
| 1475 | 1475 |
| 1476 __ movp(rax, Immediate(arg_count())); | 1476 __ movp(rax, Immediate(arg_count())); |
| 1477 | 1477 |
| 1478 // Increment the call count for monomorphic function calls. | 1478 // Increment the call count for monomorphic function calls. |
| 1479 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, | 1479 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
| 1480 FixedArray::kHeaderSize + kPointerSize), | 1480 FixedArray::kHeaderSize + kPointerSize), |
| 1481 Smi::FromInt(CallICNexus::kCallCountIncrement)); | 1481 Smi::FromInt(1)); |
| 1482 | 1482 |
| 1483 __ movp(rbx, rcx); | 1483 __ movp(rbx, rcx); |
| 1484 __ movp(rdx, rdi); | 1484 __ movp(rdx, rdi); |
| 1485 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 1485 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
| 1486 __ TailCallStub(&stub); | 1486 __ TailCallStub(&stub); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 | 1489 |
| 1490 void CallICStub::Generate(MacroAssembler* masm) { | 1490 void CallICStub::Generate(MacroAssembler* masm) { |
| 1491 // ----------- S t a t e ------------- | 1491 // ----------- S t a t e ------------- |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1521 __ cmpp(rdi, FieldOperand(rcx, WeakCell::kValueOffset)); | 1521 __ cmpp(rdi, FieldOperand(rcx, WeakCell::kValueOffset)); |
| 1522 __ j(not_equal, &extra_checks_or_miss); | 1522 __ j(not_equal, &extra_checks_or_miss); |
| 1523 | 1523 |
| 1524 // The compare above could have been a SMI/SMI comparison. Guard against this | 1524 // The compare above could have been a SMI/SMI comparison. Guard against this |
| 1525 // convincing us that we have a monomorphic JSFunction. | 1525 // convincing us that we have a monomorphic JSFunction. |
| 1526 __ JumpIfSmi(rdi, &extra_checks_or_miss); | 1526 __ JumpIfSmi(rdi, &extra_checks_or_miss); |
| 1527 | 1527 |
| 1528 // Increment the call count for monomorphic function calls. | 1528 // Increment the call count for monomorphic function calls. |
| 1529 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, | 1529 __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
| 1530 FixedArray::kHeaderSize + kPointerSize), | 1530 FixedArray::kHeaderSize + kPointerSize), |
| 1531 Smi::FromInt(CallICNexus::kCallCountIncrement)); | 1531 Smi::FromInt(1)); |
| 1532 | 1532 |
| 1533 __ bind(&call_function); | 1533 __ bind(&call_function); |
| 1534 __ Set(rax, argc); | 1534 __ Set(rax, argc); |
| 1535 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), | 1535 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
| 1536 tail_call_mode()), | 1536 tail_call_mode()), |
| 1537 RelocInfo::CODE_TARGET); | 1537 RelocInfo::CODE_TARGET); |
| 1538 | 1538 |
| 1539 __ bind(&extra_checks_or_miss); | 1539 __ bind(&extra_checks_or_miss); |
| 1540 Label uninitialized, miss, not_allocation_site; | 1540 Label uninitialized, miss, not_allocation_site; |
| 1541 | 1541 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 | 1591 |
| 1592 // Make sure the function belongs to the same native context. | 1592 // Make sure the function belongs to the same native context. |
| 1593 __ movp(rcx, FieldOperand(rdi, JSFunction::kContextOffset)); | 1593 __ movp(rcx, FieldOperand(rdi, JSFunction::kContextOffset)); |
| 1594 __ movp(rcx, ContextOperand(rcx, Context::NATIVE_CONTEXT_INDEX)); | 1594 __ movp(rcx, ContextOperand(rcx, Context::NATIVE_CONTEXT_INDEX)); |
| 1595 __ cmpp(rcx, NativeContextOperand()); | 1595 __ cmpp(rcx, NativeContextOperand()); |
| 1596 __ j(not_equal, &miss); | 1596 __ j(not_equal, &miss); |
| 1597 | 1597 |
| 1598 // Initialize the call counter. | 1598 // Initialize the call counter. |
| 1599 __ Move(FieldOperand(rbx, rdx, times_pointer_size, | 1599 __ Move(FieldOperand(rbx, rdx, times_pointer_size, |
| 1600 FixedArray::kHeaderSize + kPointerSize), | 1600 FixedArray::kHeaderSize + kPointerSize), |
| 1601 Smi::FromInt(CallICNexus::kCallCountIncrement)); | 1601 Smi::FromInt(1)); |
| 1602 | 1602 |
| 1603 // Store the function. Use a stub since we need a frame for allocation. | 1603 // Store the function. Use a stub since we need a frame for allocation. |
| 1604 // rbx - vector | 1604 // rbx - vector |
| 1605 // rdx - slot (needs to be in smi form) | 1605 // rdx - slot (needs to be in smi form) |
| 1606 // rdi - function | 1606 // rdi - function |
| 1607 { | 1607 { |
| 1608 FrameScope scope(masm, StackFrame::INTERNAL); | 1608 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1609 CreateWeakCellStub create_stub(isolate); | 1609 CreateWeakCellStub create_stub(isolate); |
| 1610 | 1610 |
| 1611 __ Integer32ToSmi(rdx, rdx); | 1611 __ Integer32ToSmi(rdx, rdx); |
| (...skipping 3831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5443 kStackUnwindSpace, nullptr, return_value_operand, | 5443 kStackUnwindSpace, nullptr, return_value_operand, |
| 5444 NULL); | 5444 NULL); |
| 5445 } | 5445 } |
| 5446 | 5446 |
| 5447 #undef __ | 5447 #undef __ |
| 5448 | 5448 |
| 5449 } // namespace internal | 5449 } // namespace internal |
| 5450 } // namespace v8 | 5450 } // namespace v8 |
| 5451 | 5451 |
| 5452 #endif // V8_TARGET_ARCH_X64 | 5452 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |