| 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 227 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. | 238 // Add a label for checking the size of the code used for returning. |
| 239 Label check_exit_codesize; | 239 Label check_exit_codesize; |
| 240 masm_->bind(&check_exit_codesize); | 240 masm_->bind(&check_exit_codesize); |
| 241 #endif | 241 #endif |
| 242 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 242 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); |
| 243 __ RecordJSReturn(); | 243 __ RecordJSReturn(); |
| 244 // Do not use the leave instruction here because it is too short to | 244 // Do not use the leave instruction here because it is too short to |
| 245 // patch with the code required by the debugger. | 245 // patch with the code required by the debugger. |
| 246 __ movq(rsp, rbp); | 246 __ movq(rsp, rbp); |
| 247 __ pop(rbp); | 247 __ pop(rbp); |
| 248 __ ret((scope()->num_parameters() + 1) * kPointerSize); | 248 |
| 249 int arguments_bytes = (scope()->num_parameters() + 1) * kPointerSize; |
| 250 __ Ret(arguments_bytes, rcx); |
| 251 |
| 249 #ifdef ENABLE_DEBUGGER_SUPPORT | 252 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 250 // Add padding that will be overwritten by a debugger breakpoint. We | 253 // 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 | 254 // have just generated at least 7 bytes: "movq rsp, rbp; pop rbp; ret k" |
| 252 // (3 + 1 + 3). | 255 // (3 + 1 + 3). |
| 253 const int kPadding = Assembler::kJSReturnSequenceLength - 7; | 256 const int kPadding = Assembler::kJSReturnSequenceLength - 7; |
| 254 for (int i = 0; i < kPadding; ++i) { | 257 for (int i = 0; i < kPadding; ++i) { |
| 255 masm_->int3(); | 258 masm_->int3(); |
| 256 } | 259 } |
| 257 // Check that the size of the code used for returning matches what is | 260 // Check that the size of the code used for returning is large enough |
| 258 // expected by the debugger. | 261 // for the debugger's requirements. |
| 259 ASSERT_EQ(Assembler::kJSReturnSequenceLength, | 262 ASSERT(Assembler::kJSReturnSequenceLength <= |
| 260 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | 263 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); |
| 261 #endif | 264 #endif |
| 262 } | 265 } |
| 263 } | 266 } |
| 264 | 267 |
| 265 | 268 |
| 266 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( | 269 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( |
| 267 Token::Value op, Expression* left, Expression* right) { | 270 Token::Value op, Expression* left, Expression* right) { |
| 268 ASSERT(ShouldInlineSmiCase(op)); | 271 ASSERT(ShouldInlineSmiCase(op)); |
| 269 return kNoConstants; | 272 return kNoConstants; |
| 270 } | 273 } |
| (...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3644 __ ret(0); | 3647 __ ret(0); |
| 3645 } | 3648 } |
| 3646 | 3649 |
| 3647 | 3650 |
| 3648 #undef __ | 3651 #undef __ |
| 3649 | 3652 |
| 3650 | 3653 |
| 3651 } } // namespace v8::internal | 3654 } } // namespace v8::internal |
| 3652 | 3655 |
| 3653 #endif // V8_TARGET_ARCH_X64 | 3656 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |