| 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 __ movp(kInterpreterBytecodeArrayRegister, | 665 __ movp(kInterpreterBytecodeArrayRegister, |
| 666 FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset)); | 666 FieldOperand(rax, SharedFunctionInfo::kFunctionDataOffset)); |
| 667 __ bind(&bytecode_array_loaded); | 667 __ bind(&bytecode_array_loaded); |
| 668 | 668 |
| 669 // Check whether we should continue to use the interpreter. | 669 // Check whether we should continue to use the interpreter. |
| 670 Label switch_to_different_code_kind; | 670 Label switch_to_different_code_kind; |
| 671 __ Move(rcx, masm->CodeObject()); // Self-reference to this code. | 671 __ Move(rcx, masm->CodeObject()); // Self-reference to this code. |
| 672 __ cmpp(rcx, FieldOperand(rax, SharedFunctionInfo::kCodeOffset)); | 672 __ cmpp(rcx, FieldOperand(rax, SharedFunctionInfo::kCodeOffset)); |
| 673 __ j(not_equal, &switch_to_different_code_kind); | 673 __ j(not_equal, &switch_to_different_code_kind); |
| 674 | 674 |
| 675 // Increment invocation count for the function. |
| 676 __ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
| 677 __ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset)); |
| 678 __ SmiAddConstant( |
| 679 FieldOperand(rcx, |
| 680 TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 681 TypeFeedbackVector::kHeaderSize), |
| 682 Smi::FromInt(1)); |
| 683 |
| 675 // Check function data field is actually a BytecodeArray object. | 684 // Check function data field is actually a BytecodeArray object. |
| 676 if (FLAG_debug_code) { | 685 if (FLAG_debug_code) { |
| 677 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 686 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
| 678 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 687 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
| 679 rax); | 688 rax); |
| 680 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 689 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 681 } | 690 } |
| 682 | 691 |
| 683 // Load initial bytecode offset. | 692 // Load initial bytecode offset. |
| 684 __ movp(kInterpreterBytecodeOffsetRegister, | 693 __ movp(kInterpreterBytecodeOffsetRegister, |
| (...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3124 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
| 3116 Generate_OnStackReplacementHelper(masm, true); | 3125 Generate_OnStackReplacementHelper(masm, true); |
| 3117 } | 3126 } |
| 3118 | 3127 |
| 3119 #undef __ | 3128 #undef __ |
| 3120 | 3129 |
| 3121 } // namespace internal | 3130 } // namespace internal |
| 3122 } // namespace v8 | 3131 } // namespace v8 |
| 3123 | 3132 |
| 3124 #endif // V8_TARGET_ARCH_X64 | 3133 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |