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

Side by Side Diff: src/scopeinfo.cc

Issue 1129723003: Revert of Resolve references to "this" the same way as normal variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/scopes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/scopeinfo.h" 9 #include "src/scopeinfo.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 312
313 bool ScopeInfo::LocalIsSynthetic(int var) { 313 bool ScopeInfo::LocalIsSynthetic(int var) {
314 DCHECK(0 <= var && var < LocalCount()); 314 DCHECK(0 <= var && var < LocalCount());
315 // There's currently no flag stored on the ScopeInfo to indicate that a 315 // There's currently no flag stored on the ScopeInfo to indicate that a
316 // variable is a compiler-introduced temporary. However, to avoid conflict 316 // variable is a compiler-introduced temporary. However, to avoid conflict
317 // with user declarations, the current temporaries like .generator_object and 317 // with user declarations, the current temporaries like .generator_object and
318 // .result start with a dot, so we can use that as a flag. It's a hack! 318 // .result start with a dot, so we can use that as a flag. It's a hack!
319 Handle<String> name(LocalName(var)); 319 Handle<String> name(LocalName(var));
320 return (name->length() > 0 && name->Get(0) == '.') || 320 return name->length() > 0 && name->Get(0) == '.';
321 name->Equals(*GetIsolate()->factory()->this_string());
322 } 321 }
323 322
324 323
325 String* ScopeInfo::StrongModeFreeVariableName(int var) { 324 String* ScopeInfo::StrongModeFreeVariableName(int var) {
326 DCHECK(0 <= var && var < StrongModeFreeVariableCount()); 325 DCHECK(0 <= var && var < StrongModeFreeVariableCount());
327 int info_index = StrongModeFreeVariableNameEntriesIndex() + var; 326 int info_index = StrongModeFreeVariableNameEntriesIndex() + var;
328 return String::cast(get(info_index)); 327 return String::cast(get(info_index));
329 } 328 }
330 329
331 330
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 info->set_name(i, *(it.export_name()->string())); 659 info->set_name(i, *(it.export_name()->string()));
661 info->set_mode(i, var->mode()); 660 info->set_mode(i, var->mode());
662 DCHECK(var->index() >= 0); 661 DCHECK(var->index() >= 0);
663 info->set_index(i, var->index()); 662 info->set_index(i, var->index());
664 } 663 }
665 DCHECK(i == info->length()); 664 DCHECK(i == info->length());
666 return info; 665 return info;
667 } 666 }
668 667
669 } } // namespace v8::internal 668 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698