Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: src/arm/full-codegen-arm.cc

Issue 8585001: Adapt source position recording and fix ScopeIterator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Statement positions for return sequences. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast.h » ('j') | src/ia32/full-codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index fcc0bd581363acc1be90a746c0af3492b7114f13..4857637f4da38933193f071d05dd04e819332317 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -355,8 +355,22 @@ void FullCodeGenerator::EmitReturnSequence() {
{ Assembler::BlockConstPoolScope block_const_pool(masm_);
// Here we use masm_-> instead of the __ macro to avoid the code coverage
// tool from instrumenting as we rely on the code size here.
- int32_t sp_delta = (info_->scope()->num_parameters() + 1) * kPointerSize;
- CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
+ Scope* scope = function()->scope();
+ int32_t sp_delta = (scope->num_parameters() + 1) * kPointerSize;
+ if (scope->is_function_scope()) {
+ // Set the source position of the return sequence to the position
+ // of the closing brace '}'.
+ 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
+ } else {
+ ASSERT(scope->is_global_scope() || scope->is_eval_scope());
+ // Set the source position to one character past the source code, such
+ // that it definitely is not in the source code range of an immediate
+ // inner scope. For example in
+ // eval('with ({x:1}) x = 1');
+ // the end position of the function generated for executing the eval code
+ // coincides with the end of the with scope which is the position of '1'.
+ CodeGenerator::RecordPositions(masm_, function()->end_position());
+ }
__ RecordJSReturn();
masm_->mov(sp, fp);
masm_->ldm(ia_w, sp, fp.bit() | lr.bit());
« no previous file with comments | « no previous file | src/ast.h » ('j') | src/ia32/full-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698