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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1150723005: [turbofan] Optimized lowering of DYNAMIC_GLOBAL lookup slot loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index b648495fdfd5d13cabefadec159ff16e442e07d2..bafda0d0354e09dd06ade5660854d4d94a763d6f 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -2749,10 +2749,15 @@ VectorSlotPair AstGraphBuilder::CreateVectorSlotPair(
uint32_t AstGraphBuilder::ComputeBitsetForDynamicGlobal(Variable* variable) {
DCHECK_EQ(DYNAMIC_GLOBAL, variable->mode());
+ bool found_eval_scope = false;
EnumSet<int, uint32_t> check_depths;
for (Scope* s = current_scope(); s != nullptr; s = s->outer_scope()) {
if (s->num_heap_slots() <= 0) continue;
- // TODO(mstarzinger): Be smarter about which checks to require!
+ // TODO(mstarzinger): If we have reached an eval scope, we check all
+ // extensions from this point. Replicated from full-codegen, figure out
+ // whether this is still needed. If not, drop {found_eval_scope} below.
+ if (s->is_eval_scope()) found_eval_scope = true;
+ if (!s->calls_sloppy_eval() && !found_eval_scope) continue;
int depth = current_scope()->ContextChainLength(s);
if (depth > DynamicGlobalAccess::kMaxCheckDepth) {
return DynamicGlobalAccess::kFullCheckRequired;
@@ -3022,9 +3027,10 @@ Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
Handle<String> name = variable->name();
if (mode == DYNAMIC_GLOBAL) {
uint32_t check_bitset = ComputeBitsetForDynamicGlobal(variable);
- const Operator* op = javascript()->LoadDynamicGlobal(name, check_bitset,
- contextual_mode);
+ const Operator* op = javascript()->LoadDynamicGlobal(
+ name, check_bitset, feedback, contextual_mode);
value = NewNode(op, current_context());
+ states.AddToNode(value, bailout_id, combine);
} else if (mode == DYNAMIC_LOCAL) {
Variable* local = variable->local_if_not_shadowed();
DCHECK(local->location() == Variable::CONTEXT); // Must be context.
@@ -3033,14 +3039,15 @@ Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
const Operator* op = javascript()->LoadDynamicContext(
name, check_bitset, depth, local->index());
value = NewNode(op, current_context());
+ PrepareFrameState(value, bailout_id, combine);
// TODO(mstarzinger): Hole checks are missing here when optimized.
} else if (mode == DYNAMIC) {
uint32_t check_bitset = DynamicGlobalAccess::kFullCheckRequired;
- const Operator* op = javascript()->LoadDynamicGlobal(name, check_bitset,
- contextual_mode);
+ const Operator* op = javascript()->LoadDynamicGlobal(
+ name, check_bitset, feedback, contextual_mode);
value = NewNode(op, current_context());
+ states.AddToNode(value, bailout_id, combine);
}
- PrepareFrameState(value, bailout_id, combine);
return value;
}
}
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698