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

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 1415733003: [turbofan] Fix invalid lowering of let variable in TDZ. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_inlining-heuristic-6
Patch Set: Rebased. Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index f7312b31534dc41462e408a463889feed57bece7..3fb7c3d5df85c334f634f04ad718f0f8dd35165f 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -62,6 +62,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadGlobal(Node* node) {
// Try to lookup the name on the script context table first (lexical scoping).
ScriptContextTableLookupResult result;
if (LookupInScriptContextTable(name, &result)) {
+ if (result.context->is_the_hole(result.index)) return NoChange();
Node* context = jsgraph()->Constant(result.context);
Node* value = effect = graph()->NewNode(
javascript()->LoadContext(0, result.index, result.immutable), context,
@@ -143,6 +144,7 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) {
// Try to lookup the name on the script context table first (lexical scoping).
ScriptContextTableLookupResult result;
if (LookupInScriptContextTable(name, &result)) {
+ if (result.context->is_the_hole(result.index)) return NoChange();
if (result.immutable) return NoChange();
Node* context = jsgraph()->Constant(result.context);
effect = graph()->NewNode(javascript()->StoreContext(0, result.index),
@@ -670,7 +672,6 @@ bool JSNativeContextSpecialization::LookupInScriptContextTable(
}
Handle<Context> script_context = ScriptContextTable::GetContext(
script_context_table, lookup_result.context_index);
- if (script_context->is_the_hole(lookup_result.slot_index)) return false;
result->context = script_context;
result->immutable = IsImmutableVariableMode(lookup_result.mode);
result->index = lookup_result.slot_index;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698