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

Unified Diff: src/scopes.h

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ensure safe-scopes are used for temp allocation Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 9f913450abd9f7f8622ef1b85082bd4c3e43a15b..3f791378482a31c38462f6562a308b89d7511efd 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -489,6 +489,17 @@ class Scope: public ZoneObject {
// where var declarations will be hoisted to in the implementation.
Scope* DeclarationScope();
+ // Find the first non-block declaration scope. This should be either a global,
+ // eval or function top scope. Used for declaring temporaries
+ Scope* TempScope() {
+ Scope* s = DeclarationScope();
+ if (s->is_block_scope()) {
+ s = s->outer_scope();
rossberg 2015/07/17 08:38:05 We may potentially want to use declaration blocks
caitp (gmail) 2015/07/17 15:43:23 done in refactor
+ DCHECK(s->is_function_scope());
+ }
+ return s;
+ }
+
Handle<ScopeInfo> GetScopeInfo(Isolate* isolate);
// Get the chain of nested scopes within this scope for the source statement
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698