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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 #ifdef DEBUG | 348 #ifdef DEBUG |
| 349 // Add a label for checking the size of the code used for returning. | 349 // Add a label for checking the size of the code used for returning. |
| 350 Label check_exit_codesize; | 350 Label check_exit_codesize; |
| 351 masm_->bind(&check_exit_codesize); | 351 masm_->bind(&check_exit_codesize); |
| 352 #endif | 352 #endif |
| 353 // Make sure that the constant pool is not emitted inside of the return | 353 // Make sure that the constant pool is not emitted inside of the return |
| 354 // sequence. | 354 // sequence. |
| 355 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 355 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
| 356 // Here we use masm_-> instead of the __ macro to avoid the code coverage | 356 // Here we use masm_-> instead of the __ macro to avoid the code coverage |
| 357 // tool from instrumenting as we rely on the code size here. | 357 // tool from instrumenting as we rely on the code size here. |
| 358 int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize; | 358 Scope* scope = function()->scope(); |
| 359 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | 359 int32_t sp_delta = (scope->num_parameters() + 1) * kPointerSize; |
| 360 if (scope->is_function_scope()) { | |
| 361 // Set the source position of the return sequence to the position | |
| 362 // of the closing brace '}'. | |
| 363 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); | |
|
Lasse Reichstein
2011/11/21 10:16:40
What if the function source doesn't have a closing
Steven
2011/11/24 13:23:31
Søren and I came up with a different scheme when d
| |
| 364 } else { | |
| 365 ASSERT(scope->is_global_scope() || scope->is_eval_scope()); | |
| 366 // Set the source position to one character past the source code, such | |
| 367 // that it definitely is not in the source code range of an immediate | |
| 368 // inner scope. For example in | |
| 369 // eval('with ({x:1}) x = 1'); | |
| 370 // the end position of the function generated for executing the eval cod e | |
| 371 // coincides with the end of the with scope which is the position of '1' . | |
| 372 CodeGenerator::RecordPositions(masm_, function()->end_position()); | |
| 373 } | |
| 360 __ RecordJSReturn(); | 374 __ RecordJSReturn(); |
| 361 masm_->mov(sp, fp); | 375 masm_->mov(sp, fp); |
| 362 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); | 376 masm_->ldm(ia_w, sp, fp.bit() | lr.bit()); |
| 363 masm_->add(sp, sp, Operand(sp_delta)); | 377 masm_->add(sp, sp, Operand(sp_delta)); |
| 364 masm_->Jump(lr); | 378 masm_->Jump(lr); |
| 365 } | 379 } |
| 366 | 380 |
| 367 #ifdef DEBUG | 381 #ifdef DEBUG |
| 368 // Check that the size of the code used for returning is large enough | 382 // Check that the size of the code used for returning is large enough |
| 369 // for the debugger's requirements. | 383 // for the debugger's requirements. |
| (...skipping 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4357 *context_length = 0; | 4371 *context_length = 0; |
| 4358 return previous_; | 4372 return previous_; |
| 4359 } | 4373 } |
| 4360 | 4374 |
| 4361 | 4375 |
| 4362 #undef __ | 4376 #undef __ |
| 4363 | 4377 |
| 4364 } } // namespace v8::internal | 4378 } } // namespace v8::internal |
| 4365 | 4379 |
| 4366 #endif // V8_TARGET_ARCH_ARM | 4380 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |