| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 __ mov(kInterpreterBytecodeArrayRegister, | 583 __ mov(kInterpreterBytecodeArrayRegister, |
| 584 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); | 584 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); |
| 585 __ bind(&bytecode_array_loaded); | 585 __ bind(&bytecode_array_loaded); |
| 586 | 586 |
| 587 // Check whether we should continue to use the interpreter. | 587 // Check whether we should continue to use the interpreter. |
| 588 Label switch_to_different_code_kind; | 588 Label switch_to_different_code_kind; |
| 589 __ Move(ecx, masm->CodeObject()); // Self-reference to this code. | 589 __ Move(ecx, masm->CodeObject()); // Self-reference to this code. |
| 590 __ cmp(ecx, FieldOperand(eax, SharedFunctionInfo::kCodeOffset)); | 590 __ cmp(ecx, FieldOperand(eax, SharedFunctionInfo::kCodeOffset)); |
| 591 __ j(not_equal, &switch_to_different_code_kind); | 591 __ j(not_equal, &switch_to_different_code_kind); |
| 592 | 592 |
| 593 // Increment invocation count for the function. |
| 594 __ EmitLoadTypeFeedbackVector(ecx); |
| 595 __ add(FieldOperand(ecx, |
| 596 TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 597 TypeFeedbackVector::kHeaderSize), |
| 598 Immediate(Smi::FromInt(1))); |
| 599 |
| 593 // Check function data field is actually a BytecodeArray object. | 600 // Check function data field is actually a BytecodeArray object. |
| 594 if (FLAG_debug_code) { | 601 if (FLAG_debug_code) { |
| 595 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 602 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
| 596 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 603 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
| 597 eax); | 604 eax); |
| 598 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 605 __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 599 } | 606 } |
| 600 | 607 |
| 601 // Push bytecode array. | 608 // Push bytecode array. |
| 602 __ push(kInterpreterBytecodeArrayRegister); | 609 __ push(kInterpreterBytecodeArrayRegister); |
| (...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3153 | 3160 |
| 3154 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3161 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
| 3155 Generate_OnStackReplacementHelper(masm, true); | 3162 Generate_OnStackReplacementHelper(masm, true); |
| 3156 } | 3163 } |
| 3157 | 3164 |
| 3158 #undef __ | 3165 #undef __ |
| 3159 } // namespace internal | 3166 } // namespace internal |
| 3160 } // namespace v8 | 3167 } // namespace v8 |
| 3161 | 3168 |
| 3162 #endif // V8_TARGET_ARCH_IA32 | 3169 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |