| 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 if (is_uint16(arguments_bytes)) { |
| 316 __ ret(arguments_bytes); |
| 317 } else { |
| 318 __ pop(ecx); |
| 319 __ add(Operand(esp), Immediate(arguments_bytes)); |
| 320 __ push(ecx); |
| 321 __ ret(0); |
| 322 } |
| 314 #ifdef ENABLE_DEBUGGER_SUPPORT | 323 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 315 // Check that the size of the code used for returning matches what is | 324 // Check that the size of the code used for returning matches what is |
| 316 // expected by the debugger. | 325 // expected by the debugger. |
| 317 ASSERT_EQ(Assembler::kJSReturnSequenceLength, | 326 ASSERT(Assembler::kJSReturnSequenceLength <= |
| 318 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | 327 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); |
| 319 #endif | 328 #endif |
| 320 } | 329 } |
| 321 } | 330 } |
| 322 | 331 |
| 323 | 332 |
| 324 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( | 333 FullCodeGenerator::ConstantOperand FullCodeGenerator::GetConstantOperand( |
| 325 Token::Value op, Expression* left, Expression* right) { | 334 Token::Value op, Expression* left, Expression* right) { |
| 326 ASSERT(ShouldInlineSmiCase(op)); | 335 ASSERT(ShouldInlineSmiCase(op)); |
| 327 if (op == Token::DIV || op == Token::MOD || op == Token::MUL) { | 336 if (op == Token::DIV || op == Token::MOD || op == Token::MUL) { |
| 328 // We never generate inlined constant smi operations for these. | 337 // 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. | 4408 // And return. |
| 4400 __ ret(0); | 4409 __ ret(0); |
| 4401 } | 4410 } |
| 4402 | 4411 |
| 4403 | 4412 |
| 4404 #undef __ | 4413 #undef __ |
| 4405 | 4414 |
| 4406 } } // namespace v8::internal | 4415 } } // namespace v8::internal |
| 4407 | 4416 |
| 4408 #endif // V8_TARGET_ARCH_IA32 | 4417 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |