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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // Add a label for checking the size of the code used for returning. | 303 // Add a label for checking the size of the code used for returning. |
304 Label check_exit_codesize; | 304 Label check_exit_codesize; |
305 masm_->bind(&check_exit_codesize); | 305 masm_->bind(&check_exit_codesize); |
306 #endif | 306 #endif |
307 SetSourcePosition(function()->end_position() - 1); | 307 SetSourcePosition(function()->end_position() - 1); |
308 __ RecordJSReturn(); | 308 __ RecordJSReturn(); |
309 // Do not use the leave instruction here because it is too short to | 309 // Do not use the leave instruction here because it is too short to |
310 // patch with the code required by the debugger. | 310 // patch with the code required by the debugger. |
311 __ mov(esp, ebp); | 311 __ mov(esp, ebp); |
312 __ pop(ebp); | 312 __ pop(ebp); |
313 __ ret((scope()->num_parameters() + 1) * kPointerSize); | 313 |
| 314 int arguments_bytes = (scope()->num_parameters() + 1) * kPointerSize; |
| 315 __ Ret(arguments_bytes, ecx); |
314 #ifdef ENABLE_DEBUGGER_SUPPORT | 316 #ifdef ENABLE_DEBUGGER_SUPPORT |
315 // Check that the size of the code used for returning matches what is | 317 // Check that the size of the code used for returning is large enough |
316 // expected by the debugger. | 318 // for the debugger's requirements. |
317 ASSERT_EQ(Assembler::kJSReturnSequenceLength, | 319 ASSERT(Assembler::kJSReturnSequenceLength <= |
318 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | 320 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); |
319 #endif | 321 #endif |
320 } | 322 } |
321 } | 323 } |
322 | 324 |
323 | 325 |
324 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( | 326 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( |
325 Token::Value op, Expression* left, Expression* right) { | 327 Token::Value op, Expression* left, Expression* right) { |
326 ASSERT(ShouldInlineSmiCase(op)); | 328 ASSERT(ShouldInlineSmiCase(op)); |
327 if (op == Token::DIV || op == Token::MOD || op == Token::MUL) { | 329 if (op == Token::DIV || op == Token::MOD || op == Token::MUL) { |
328 // We never generate inlined constant smi operations for these. | 330 // We never generate inlined constant smi operations for these. |
(...skipping 4070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4399 // And return. | 4401 // And return. |
4400 __ ret(0); | 4402 __ ret(0); |
4401 } | 4403 } |
4402 | 4404 |
4403 | 4405 |
4404 #undef __ | 4406 #undef __ |
4405 | 4407 |
4406 } } // namespace v8::internal | 4408 } } // namespace v8::internal |
4407 | 4409 |
4408 #endif // V8_TARGET_ARCH_IA32 | 4410 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |