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

Unified Diff: src/ast/scopes.h

Issue 2275773002: Inline fast-path of Scope::LookupLocal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 9135c65422b29da459c0b64a55d0cb8e9dc45171..b3c61ada24681fe1119be47272c62b5111244e7e 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -120,7 +120,13 @@ class Scope: public ZoneObject {
// Declarations
// Lookup a variable in this scope. Returns the variable or NULL if not found.
- Variable* LookupLocal(const AstRawString* name);
+ Variable* LookupLocal(const AstRawString* name) {
+ Variable* result = variables_.Lookup(name);
+ if (result != nullptr || scope_info_.is_null()) return result;
+ return LookupInScopeInfo(name);
+ }
+
+ Variable* LookupInScopeInfo(const AstRawString* name);
// Lookup a variable in this scope or outer scopes.
// Returns the variable or NULL if not found.
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698