| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 // Open a frame scope to indicate that there is a frame on the stack. The | 515 // Open a frame scope to indicate that there is a frame on the stack. The |
| 516 // MANUAL indicates that the scope shouldn't actually generate code to set up | 516 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 517 // the frame (that is done below). | 517 // the frame (that is done below). |
| 518 FrameScope frame_scope(masm, StackFrame::MANUAL); | 518 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 519 __ push(ebp); // Caller's frame pointer. | 519 __ push(ebp); // Caller's frame pointer. |
| 520 __ mov(ebp, esp); | 520 __ mov(ebp, esp); |
| 521 __ push(esi); // Callee's context. | 521 __ push(esi); // Callee's context. |
| 522 __ push(edi); // Callee's JS function. | 522 __ push(edi); // Callee's JS function. |
| 523 __ push(edx); // Callee's new target. | 523 __ push(edx); // Callee's new target. |
| 524 | 524 |
| 525 // Push zero for bytecode array offset. |
| 526 __ push(Immediate(0)); |
| 527 |
| 525 // Get the bytecode array from the function object and load the pointer to the | 528 // Get the bytecode array from the function object and load the pointer to the |
| 526 // first entry into edi (InterpreterBytecodeRegister). | 529 // first entry into edi (InterpreterBytecodeRegister). |
| 527 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 530 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 528 __ mov(kInterpreterBytecodeArrayRegister, | 531 __ mov(kInterpreterBytecodeArrayRegister, |
| 529 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); | 532 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); |
| 530 | 533 |
| 531 if (FLAG_debug_code) { | 534 if (FLAG_debug_code) { |
| 532 // Check function data field is actually a BytecodeArray object. | 535 // Check function data field is actually a BytecodeArray object. |
| 533 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); | 536 __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
| 534 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, | 537 __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 __ push(kInterpreterBytecodeArrayRegister); | 587 __ push(kInterpreterBytecodeArrayRegister); |
| 585 __ CallRuntime(Runtime::kStackGuard, 0); | 588 __ CallRuntime(Runtime::kStackGuard, 0); |
| 586 __ pop(kInterpreterBytecodeArrayRegister); | 589 __ pop(kInterpreterBytecodeArrayRegister); |
| 587 __ bind(&ok); | 590 __ bind(&ok); |
| 588 } | 591 } |
| 589 | 592 |
| 590 // Load accumulator, register file, bytecode offset, dispatch table into | 593 // Load accumulator, register file, bytecode offset, dispatch table into |
| 591 // registers. | 594 // registers. |
| 592 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 595 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 593 __ mov(kInterpreterRegisterFileRegister, ebp); | 596 __ mov(kInterpreterRegisterFileRegister, ebp); |
| 594 __ sub(kInterpreterRegisterFileRegister, | 597 __ add(kInterpreterRegisterFileRegister, |
| 595 Immediate(2 * kPointerSize + | 598 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 596 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
| 597 __ mov(kInterpreterBytecodeOffsetRegister, | 599 __ mov(kInterpreterBytecodeOffsetRegister, |
| 598 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 600 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 599 // Since the dispatch table root might be set after builtins are generated, | 601 // Since the dispatch table root might be set after builtins are generated, |
| 600 // load directly from the roots table. | 602 // load directly from the roots table. |
| 601 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); | 603 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); |
| 602 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); | 604 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 603 | 605 |
| 604 // Push context as a stack located parameter to the bytecode handler. | 606 // Push context as a stack located parameter to the bytecode handler. |
| 605 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); | 607 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); |
| 606 __ push(ebx); | 608 __ push(ebx); |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 | 1978 |
| 1977 __ bind(&ok); | 1979 __ bind(&ok); |
| 1978 __ ret(0); | 1980 __ ret(0); |
| 1979 } | 1981 } |
| 1980 | 1982 |
| 1981 #undef __ | 1983 #undef __ |
| 1982 } // namespace internal | 1984 } // namespace internal |
| 1983 } // namespace v8 | 1985 } // namespace v8 |
| 1984 | 1986 |
| 1985 #endif // V8_TARGET_ARCH_IA32 | 1987 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |