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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 __ bind(&return_label_); | 342 __ bind(&return_label_); |
| 343 if (FLAG_trace) { | 343 if (FLAG_trace) { |
| 344 __ push(eax); | 344 __ push(eax); |
| 345 __ CallRuntime(Runtime::kTraceExit, 1); | 345 __ CallRuntime(Runtime::kTraceExit, 1); |
| 346 } | 346 } |
| 347 #ifdef DEBUG | 347 #ifdef DEBUG |
| 348 // Add a label for checking the size of the code used for returning. | 348 // Add a label for checking the size of the code used for returning. |
| 349 Label check_exit_codesize; | 349 Label check_exit_codesize; |
| 350 masm_->bind(&check_exit_codesize); | 350 masm_->bind(&check_exit_codesize); |
| 351 #endif | 351 #endif |
| 352 SetSourcePosition(function()->end_position() - 1); | 352 if (scope()->is_global_scope() || scope()->is_eval_scope()) { |
| 353 // Set the source and statement position to one character past the source | |
| 354 // code, so that they definitely are not in the source code range of an | |
| 355 // immediate inner scope. For example in | |
| 356 // eval('with ({x:1}) x = 1'); | |
| 357 // the end position of the function generated for executing the eval code | |
| 358 // coincides with the end of the with scope which is the position of | |
| 359 // '1'. However for the ScopeIterator we want to have positions for the | |
| 360 // return sequence outside of the with scope. | |
| 361 SetStatementPosition(function()->end_position()); | |
| 362 SetSourcePosition(function()->end_position()); | |
| 363 } else { | |
| 364 // Set the statement position of the return sequence to the last character | |
| 365 // of the current scope. | |
| 366 SetStatementPosition(scope()->end_position() - 1); | |
| 367 SetSourcePosition(function()->end_position() - 1); | |
|
Lasse Reichstein
2011/11/21 10:16:40
Can't the final character coincide with another sc
Steven
2011/11/24 13:23:31
This is not important anymore. I added special han
| |
| 368 } | |
| 353 __ RecordJSReturn(); | 369 __ RecordJSReturn(); |
| 354 // Do not use the leave instruction here because it is too short to | 370 // Do not use the leave instruction here because it is too short to |
| 355 // patch with the code required by the debugger. | 371 // patch with the code required by the debugger. |
| 356 __ mov(esp, ebp); | 372 __ mov(esp, ebp); |
| 357 __ pop(ebp); | 373 __ pop(ebp); |
| 358 | 374 |
| 359 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; | 375 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; |
| 360 __ Ret(arguments_bytes, ecx); | 376 __ Ret(arguments_bytes, ecx); |
| 361 #ifdef ENABLE_DEBUGGER_SUPPORT | 377 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 362 // Check that the size of the code used for returning is large enough | 378 // Check that the size of the code used for returning is large enough |
| (...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4343 *context_length = 0; | 4359 *context_length = 0; |
| 4344 return previous_; | 4360 return previous_; |
| 4345 } | 4361 } |
| 4346 | 4362 |
| 4347 | 4363 |
| 4348 #undef __ | 4364 #undef __ |
| 4349 | 4365 |
| 4350 } } // namespace v8::internal | 4366 } } // namespace v8::internal |
| 4351 | 4367 |
| 4352 #endif // V8_TARGET_ARCH_IA32 | 4368 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |