Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 SetFunctionPosition(function()); | 62 SetFunctionPosition(function()); |
| 63 Comment cmnt(masm_, "[ function compiled by full code generator"); | 63 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 64 | 64 |
| 65 #ifdef DEBUG | 65 #ifdef DEBUG |
| 66 if (strlen(FLAG_stop_at) > 0 && | 66 if (strlen(FLAG_stop_at) > 0 && |
| 67 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { | 67 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { |
| 68 __ int3(); | 68 __ int3(); |
| 69 } | 69 } |
| 70 #endif | 70 #endif |
| 71 __ push(rbp); // Caller's frame pointer. | 71 __ push(rbp); // Caller's frame pointer. |
| 72 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_PUSH, masm_->pc_offset()); | |
|
Vyacheslav Egorov (Chromium)
2011/01/25 12:50:11
The idea is to keep GDBJIT as isolated as possible
| |
| 72 __ movq(rbp, rsp); | 73 __ movq(rbp, rsp); |
| 74 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_SET, masm_->pc_offset()); | |
| 73 __ push(rsi); // Callee's context. | 75 __ push(rsi); // Callee's context. |
| 74 __ push(rdi); // Callee's JS Function. | 76 __ push(rdi); // Callee's JS Function. |
| 75 | 77 |
| 76 { Comment cmnt(masm_, "[ Allocate locals"); | 78 { Comment cmnt(masm_, "[ Allocate locals"); |
| 77 int locals_count = scope()->num_stack_slots(); | 79 int locals_count = scope()->num_stack_slots(); |
| 78 if (locals_count == 1) { | 80 if (locals_count == 1) { |
| 79 __ PushRoot(Heap::kUndefinedValueRootIndex); | 81 __ PushRoot(Heap::kUndefinedValueRootIndex); |
| 80 } else if (locals_count > 1) { | 82 } else if (locals_count > 1) { |
| 81 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 83 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
| 82 for (int i = 0; i < locals_count; i++) { | 84 for (int i = 0; i < locals_count; i++) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 // Add a label for checking the size of the code used for returning. | 240 // Add a label for checking the size of the code used for returning. |
| 239 Label check_exit_codesize; | 241 Label check_exit_codesize; |
| 240 masm_->bind(&check_exit_codesize); | 242 masm_->bind(&check_exit_codesize); |
| 241 #endif | 243 #endif |
| 242 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 244 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
| 243 __ RecordJSReturn(); | 245 __ RecordJSReturn(); |
| 244 // Do not use the leave instruction here because it is too short to | 246 // Do not use the leave instruction here because it is too short to |
| 245 // patch with the code required by the debugger. | 247 // patch with the code required by the debugger. |
| 246 __ movq(rsp, rbp); | 248 __ movq(rsp, rbp); |
| 247 __ pop(rbp); | 249 __ pop(rbp); |
| 250 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RBP_POP, masm_->pc_offset()); | |
| 248 __ ret((scope()->num_parameters() + 1) * kPointerSize); | 251 __ ret((scope()->num_parameters() + 1) * kPointerSize); |
| 252 SET_UNWIND_INFO(UNWIND_STATE_AFTER_RETURN, masm_->pc_offset()); | |
| 249 #ifdef ENABLE_DEBUGGER_SUPPORT | 253 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 250 // Add padding that will be overwritten by a debugger breakpoint. We | 254 // Add padding that will be overwritten by a debugger breakpoint. We |
| 251 // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7 | 255 // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7 |
| 252 // (3 + 1 + 3). | 256 // (3 + 1 + 3). |
| 253 const int kPadding = Assembler::kJSReturnSequenceLength - 7; | 257 const int kPadding = Assembler::kJSReturnSequenceLength - 7; |
| 254 for (int i = 0; i < kPadding; ++i) { | 258 for (int i = 0; i < kPadding; ++i) { |
| 255 masm_->int3(); | 259 masm_->int3(); |
| 256 } | 260 } |
| 257 // Check that the size of the code used for returning matches what is | 261 // Check that the size of the code used for returning matches what is |
| 258 // expected by the debugger. | 262 // expected by the debugger. |
| (...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3642 __ ret(0); | 3646 __ ret(0); |
| 3643 } | 3647 } |
| 3644 | 3648 |
| 3645 | 3649 |
| 3646 #undef __ | 3650 #undef __ |
| 3647 | 3651 |
| 3648 | 3652 |
| 3649 } } // namespace v8::internal | 3653 } } // namespace v8::internal |
| 3650 | 3654 |
| 3651 #endif // V8_TARGET_ARCH_X64 | 3655 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |