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

Side by Side Diff: src/ast/scopes.h

Issue 2242193002: [Interpreter] Avoid accessing Isolate from during bytecode generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_sourceposition
Patch Set: Rebase Created 4 years, 4 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 | « no previous file | src/interpreter/bytecode-array-builder.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_AST_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // function, or eval scope. Same as DeclarationScope(), but skips declaration 404 // function, or eval scope. Same as DeclarationScope(), but skips declaration
405 // "block" scopes. Used for differentiating associated function objects (i.e., 405 // "block" scopes. Used for differentiating associated function objects (i.e.,
406 // the scope for which a function prologue allocates a context) or declaring 406 // the scope for which a function prologue allocates a context) or declaring
407 // temporaries. 407 // temporaries.
408 DeclarationScope* GetClosureScope(); 408 DeclarationScope* GetClosureScope();
409 409
410 // Find the first (non-arrow) function or script scope. This is where 410 // Find the first (non-arrow) function or script scope. This is where
411 // 'this' is bound, and what determines the function kind. 411 // 'this' is bound, and what determines the function kind.
412 DeclarationScope* GetReceiverScope(); 412 DeclarationScope* GetReceiverScope();
413 413
414 // Creates a scope info if it doesn't already exist.
414 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); 415 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate);
415 416
417 // GetScopeInfo() must have been called once to create the ScopeInfo.
418 Handle<ScopeInfo> scope_info() {
419 DCHECK(!scope_info_.is_null());
420 return scope_info_;
421 }
422
416 // --------------------------------------------------------------------------- 423 // ---------------------------------------------------------------------------
417 // Strict mode support. 424 // Strict mode support.
418 bool IsDeclared(const AstRawString* name) { 425 bool IsDeclared(const AstRawString* name) {
419 // During formal parameter list parsing the scope only contains 426 // During formal parameter list parsing the scope only contains
420 // two variables inserted at initialization: "this" and "arguments". 427 // two variables inserted at initialization: "this" and "arguments".
421 // "this" is an invalid parameter name and "arguments" is invalid parameter 428 // "this" is an invalid parameter name and "arguments" is invalid parameter
422 // name in strict mode. Therefore looking up with the map which includes 429 // name in strict mode. Therefore looking up with the map which includes
423 // "this" and "arguments" in addition to all formal parameters is safe. 430 // "this" and "arguments" in addition to all formal parameters is safe.
424 return variables_.Lookup(name) != NULL; 431 return variables_.Lookup(name) != NULL;
425 } 432 }
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 void AllocateModuleVariables(); 898 void AllocateModuleVariables();
892 899
893 private: 900 private:
894 ModuleDescriptor* module_descriptor_; 901 ModuleDescriptor* module_descriptor_;
895 }; 902 };
896 903
897 } // namespace internal 904 } // namespace internal
898 } // namespace v8 905 } // namespace v8
899 906
900 #endif // V8_AST_SCOPES_H_ 907 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698