| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 // The live registers are: | 401 // The live registers are: |
| 402 // o edi: the JS function object being called | 402 // o edi: the JS function object being called |
| 403 // o edx: the new target | 403 // o edx: the new target |
| 404 // o esi: our context | 404 // o esi: our context |
| 405 // o ebp: the caller's frame pointer | 405 // o ebp: the caller's frame pointer |
| 406 // o esp: stack pointer (pointing to return address) | 406 // o esp: stack pointer (pointing to return address) |
| 407 // | 407 // |
| 408 // The function builds an interpreter frame. See InterpreterFrameConstants in | 408 // The function builds an interpreter frame. See InterpreterFrameConstants in |
| 409 // frames.h for its layout. | 409 // frames.h for its layout. |
| 410 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 410 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 411 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
| 412 |
| 411 // Open a frame scope to indicate that there is a frame on the stack. The | 413 // Open a frame scope to indicate that there is a frame on the stack. The |
| 412 // MANUAL indicates that the scope shouldn't actually generate code to set up | 414 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 413 // the frame (that is done below). | 415 // the frame (that is done below). |
| 414 FrameScope frame_scope(masm, StackFrame::MANUAL); | 416 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 415 __ push(ebp); // Caller's frame pointer. | 417 __ push(ebp); // Caller's frame pointer. |
| 416 __ mov(ebp, esp); | 418 __ mov(ebp, esp); |
| 417 __ push(esi); // Callee's context. | 419 __ push(esi); // Callee's context. |
| 418 __ push(edi); // Callee's JS function. | 420 __ push(edi); // Callee's JS function. |
| 419 __ push(edx); // Callee's new target. | 421 __ push(edx); // Callee's new target. |
| 420 | 422 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 __ jmp(&loop_check); | 469 __ jmp(&loop_check); |
| 468 __ bind(&loop_header); | 470 __ bind(&loop_header); |
| 469 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 471 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
| 470 __ push(eax); | 472 __ push(eax); |
| 471 // Continue loop if not done. | 473 // Continue loop if not done. |
| 472 __ bind(&loop_check); | 474 __ bind(&loop_check); |
| 473 __ sub(ebx, Immediate(kPointerSize)); | 475 __ sub(ebx, Immediate(kPointerSize)); |
| 474 __ j(greater_equal, &loop_header); | 476 __ j(greater_equal, &loop_header); |
| 475 } | 477 } |
| 476 | 478 |
| 477 // TODO(rmcilroy): List of things not currently dealt with here but done in | |
| 478 // fullcodegen's prologue: | |
| 479 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | |
| 480 // - Code aging of the BytecodeArray object. | |
| 481 | |
| 482 // Load accumulator, register file, bytecode offset, dispatch table into | 479 // Load accumulator, register file, bytecode offset, dispatch table into |
| 483 // registers. | 480 // registers. |
| 484 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 481 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 485 __ mov(kInterpreterRegisterFileRegister, ebp); | 482 __ mov(kInterpreterRegisterFileRegister, ebp); |
| 486 __ add(kInterpreterRegisterFileRegister, | 483 __ add(kInterpreterRegisterFileRegister, |
| 487 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 484 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 488 __ mov(kInterpreterBytecodeOffsetRegister, | 485 __ mov(kInterpreterBytecodeOffsetRegister, |
| 489 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 486 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 490 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address( | 487 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address( |
| 491 masm->isolate()))); | 488 masm->isolate()))); |
| (...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2638 // And "return" to the OSR entry point of the function. | 2635 // And "return" to the OSR entry point of the function. |
| 2639 __ ret(0); | 2636 __ ret(0); |
| 2640 } | 2637 } |
| 2641 | 2638 |
| 2642 | 2639 |
| 2643 #undef __ | 2640 #undef __ |
| 2644 } // namespace internal | 2641 } // namespace internal |
| 2645 } // namespace v8 | 2642 } // namespace v8 |
| 2646 | 2643 |
| 2647 #endif // V8_TARGET_ARCH_X87 | 2644 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |