Commit 8547b072 authored by verwaest's avatar verwaest Committed by Commit bot

Inline fast-path of Scope::LookupLocal

BUG=v8:5209

Review-Url: https://codereview.chromium.org/2275773002
Cr-Commit-Position: refs/heads/master@{#38865}
parent 6646d73b
......@@ -589,12 +589,7 @@ void Scope::PropagateUsageFlagsToScope(Scope* other) {
if (calls_eval()) other->RecordEvalCall();
}
Variable* Scope::LookupLocal(const AstRawString* name) {
Variable* result = variables_.Lookup(name);
if (result != NULL || scope_info_.is_null()) {
return result;
}
Variable* Scope::LookupInScopeInfo(const AstRawString* name) {
Handle<String> name_handle = name->string();
// The Scope is backed up by ScopeInfo. This means it cannot operate in a
// heap-independent mode, and all strings must be internalized immediately. So
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment