Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #if defined(V8_TARGET_ARCH_X64) | 30 #if defined(V8_TARGET_ARCH_X64) |
| 31 | 31 |
| 32 #include "codegen-inl.h" | 32 #include "codegen-inl.h" |
| 33 #include "gdb-jit.h" | |
| 33 #include "register-allocator-inl.h" | 34 #include "register-allocator-inl.h" |
| 34 #include "scopes.h" | 35 #include "scopes.h" |
| 35 #include "stub-cache.h" | 36 #include "stub-cache.h" |
| 36 #include "virtual-frame-inl.h" | 37 #include "virtual-frame-inl.h" |
| 37 | 38 |
| 38 namespace v8 { | 39 namespace v8 { |
| 39 namespace internal { | 40 namespace internal { |
| 40 | 41 |
| 41 #define __ ACCESS_MASM(masm()) | 42 #define __ ACCESS_MASM(masm()) |
| 42 | 43 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 56 Condition not_smi = NegateCondition(masm()->CheckSmi(rdi)); | 57 Condition not_smi = NegateCondition(masm()->CheckSmi(rdi)); |
| 57 __ Check(not_smi, | 58 __ Check(not_smi, |
| 58 "VirtualFrame::Enter - rdi is not a function (smi check)."); | 59 "VirtualFrame::Enter - rdi is not a function (smi check)."); |
| 59 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); | 60 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); |
| 60 __ Check(equal, | 61 __ Check(equal, |
| 61 "VirtualFrame::Enter - rdi is not a function (map check)."); | 62 "VirtualFrame::Enter - rdi is not a function (map check)."); |
| 62 } | 63 } |
| 63 #endif | 64 #endif |
| 64 | 65 |
| 65 EmitPush(rbp); | 66 EmitPush(rbp); |
| 67 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_PUSH, masm()->pc_offset()); | |
|
Vyacheslav Egorov (Chromium)
2011/01/25 12:50:11
The classic codegen is going to be replaced with C
| |
| 66 | 68 |
| 67 __ movq(rbp, rsp); | 69 __ movq(rbp, rsp); |
| 70 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_SET, masm()->pc_offset()); | |
| 68 | 71 |
| 69 // Store the context in the frame. The context is kept in rsi and a | 72 // Store the context in the frame. The context is kept in rsi and a |
| 70 // copy is stored in the frame. The external reference to rsi | 73 // copy is stored in the frame. The external reference to rsi |
| 71 // remains. | 74 // remains. |
| 72 EmitPush(rsi); | 75 EmitPush(rsi); |
| 73 | 76 |
| 74 // Store the function in the frame. The frame owns the register | 77 // Store the function in the frame. The frame owns the register |
| 75 // reference now (ie, it can keep it in rdi or spill it later). | 78 // reference now (ie, it can keep it in rdi or spill it later). |
| 76 Push(rdi); | 79 Push(rdi); |
| 77 SyncElementAt(element_count() - 1); | 80 SyncElementAt(element_count() - 1); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 94 __ movq(rsp, rbp); | 97 __ movq(rsp, rbp); |
| 95 stack_pointer_ = frame_pointer(); | 98 stack_pointer_ = frame_pointer(); |
| 96 for (int i = element_count() - 1; i > stack_pointer_; i--) { | 99 for (int i = element_count() - 1; i > stack_pointer_; i--) { |
| 97 FrameElement last = elements_.RemoveLast(); | 100 FrameElement last = elements_.RemoveLast(); |
| 98 if (last.is_register()) { | 101 if (last.is_register()) { |
| 99 Unuse(last.reg()); | 102 Unuse(last.reg()); |
| 100 } | 103 } |
| 101 } | 104 } |
| 102 | 105 |
| 103 EmitPop(rbp); | 106 EmitPop(rbp); |
| 107 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_POP, masm()->pc_offset()); | |
| 104 } | 108 } |
| 105 | 109 |
| 106 | 110 |
| 107 void VirtualFrame::AllocateStackSlots() { | 111 void VirtualFrame::AllocateStackSlots() { |
| 108 int count = local_count(); | 112 int count = local_count(); |
| 109 if (count > 0) { | 113 if (count > 0) { |
| 110 Comment cmnt(masm(), "[ Allocate space for locals"); | 114 Comment cmnt(masm(), "[ Allocate space for locals"); |
| 111 // The locals are initialized to a constant (the undefined value), but | 115 // The locals are initialized to a constant (the undefined value), but |
| 112 // we sync them with the actual frame to allocate space for spilling | 116 // we sync them with the actual frame to allocate space for spilling |
| 113 // them later. First sync everything above the stack pointer so we can | 117 // them later. First sync everything above the stack pointer so we can |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1256 Adjust(kHandlerSize - 1); | 1260 Adjust(kHandlerSize - 1); |
| 1257 __ PushTryHandler(IN_JAVASCRIPT, type); | 1261 __ PushTryHandler(IN_JAVASCRIPT, type); |
| 1258 } | 1262 } |
| 1259 | 1263 |
| 1260 | 1264 |
| 1261 #undef __ | 1265 #undef __ |
| 1262 | 1266 |
| 1263 } } // namespace v8::internal | 1267 } } // namespace v8::internal |
| 1264 | 1268 |
| 1265 #endif // V8_TARGET_ARCH_X64 | 1269 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |