| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 #ifdef DEBUG | 398 #ifdef DEBUG |
| 399 // Add a label for checking the size of the code used for returning. | 399 // Add a label for checking the size of the code used for returning. |
| 400 Label check_exit_codesize; | 400 Label check_exit_codesize; |
| 401 masm_->bind(&check_exit_codesize); | 401 masm_->bind(&check_exit_codesize); |
| 402 #endif | 402 #endif |
| 403 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 403 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
| 404 __ RecordJSReturn(); | 404 __ RecordJSReturn(); |
| 405 // Do not use the leave instruction here because it is too short to | 405 // Do not use the leave instruction here because it is too short to |
| 406 // patch with the code required by the debugger. | 406 // patch with the code required by the debugger. |
| 407 __ movq(rsp, rbp); | 407 __ movq(rsp, rbp); |
| 408 info_->set_frame_destroy_offset(masm_->pc_offset()); |
| 408 __ pop(rbp); | 409 __ pop(rbp); |
| 409 | 410 |
| 410 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; | 411 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; |
| 411 __ Ret(arguments_bytes, rcx); | 412 __ Ret(arguments_bytes, rcx); |
| 412 | 413 |
| 413 #ifdef ENABLE_DEBUGGER_SUPPORT | 414 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 414 // Add padding that will be overwritten by a debugger breakpoint. We | 415 // Add padding that will be overwritten by a debugger breakpoint. We |
| 415 // have just generated at least 7 bytes: "movq rsp, rbp; pop rbp; ret k" | 416 // have just generated at least 7 bytes: "movq rsp, rbp; pop rbp; ret k" |
| 416 // (3 + 1 + 3). | 417 // (3 + 1 + 3). |
| 417 const int kPadding = Assembler::kJSReturnSequenceLength - 7; | 418 const int kPadding = Assembler::kJSReturnSequenceLength - 7; |
| (...skipping 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4683 *context_length = 0; | 4684 *context_length = 0; |
| 4684 return previous_; | 4685 return previous_; |
| 4685 } | 4686 } |
| 4686 | 4687 |
| 4687 | 4688 |
| 4688 #undef __ | 4689 #undef __ |
| 4689 | 4690 |
| 4690 } } // namespace v8::internal | 4691 } } // namespace v8::internal |
| 4691 | 4692 |
| 4692 #endif // V8_TARGET_ARCH_X64 | 4693 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |