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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 __ pushq(rbp); // Caller's frame pointer. | 603 __ pushq(rbp); // Caller's frame pointer. |
604 __ movp(rbp, rsp); | 604 __ movp(rbp, rsp); |
605 __ Push(rsi); // Callee's context. | 605 __ Push(rsi); // Callee's context. |
606 __ Push(rdi); // Callee's JS function. | 606 __ Push(rdi); // Callee's JS function. |
607 __ Push(rdx); // Callee's new target. | 607 __ Push(rdx); // Callee's new target. |
608 | 608 |
609 // Get the bytecode array from the function object (or from the DebugInfo if | 609 // Get the bytecode array from the function object (or from the DebugInfo if |
610 // it is present) and load it into kInterpreterBytecodeArrayRegister. | 610 // it is present) and load it into kInterpreterBytecodeArrayRegister. |
611 __ movp(rax, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 611 __ movp(rax, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
612 Label load_debug_bytecode_array, bytecode_array_loaded; | 612 Label load_debug_bytecode_array, bytecode_array_loaded; |
613 DCHECK_EQ(Smi::kZero, DebugInfo::uninitialized()); | 613 __ JumpIfNotSmi(FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset), |
614 __ cmpp(FieldOperand(rax, SharedFunctionInfo::kDebugInfoOffset), | 614 &load_debug_bytecode_array); |
615 Immediate(0)); | |
616 __ j(not_equal, &load_debug_bytecode_array); | |
617 __ movp(kInterpreterBytecodeArrayRegister, | 615 __ movp(kInterpreterBytecodeArrayRegister, |
618 FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset)); | 616 FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset)); |
619 __ bind(&bytecode_array_loaded); | 617 __ bind(&bytecode_array_loaded); |
620 | 618 |
621 // Check whether we should continue to use the interpreter. | 619 // Check whether we should continue to use the interpreter. |
622 Label switch_to_different_code_kind; | 620 Label switch_to_different_code_kind; |
623 __ Move(rcx, masm->CodeObject()); // Self-reference to this code. | 621 __ Move(rcx, masm->CodeObject()); // Self-reference to this code. |
624 __ cmpp(rcx, FieldOperand(rax, SharedFunctionInfo::kCodeOffset)); | 622 __ cmpp(rcx, FieldOperand(rax, SharedFunctionInfo::kCodeOffset)); |
625 __ j(not_equal, &switch_to_different_code_kind); | 623 __ j(not_equal, &switch_to_different_code_kind); |
626 | 624 |
(...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3180 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3178 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3181 Generate_OnStackReplacementHelper(masm, true); | 3179 Generate_OnStackReplacementHelper(masm, true); |
3182 } | 3180 } |
3183 | 3181 |
3184 #undef __ | 3182 #undef __ |
3185 | 3183 |
3186 } // namespace internal | 3184 } // namespace internal |
3187 } // namespace v8 | 3185 } // namespace v8 |
3188 | 3186 |
3189 #endif // V8_TARGET_ARCH_X64 | 3187 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |