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

Unified Diff: src/compiler/js-builtin-reducer.cc

Issue 2479563003: [compiler] Delete extra map check in StringIterator. (Closed)
Patch Set: Use native_context() in unittest. Created 4 years, 1 month 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 | « src/compiler/js-builtin-reducer.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index edf63ba262d55b2afb7dbd2b42886ba83b5b38d2..2bee5b282c88b2fef00ac6244a20d508b0c3a51b 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/src/compiler/js-builtin-reducer.cc
@@ -96,11 +96,13 @@ class JSCallReduction {
JSBuiltinReducer::JSBuiltinReducer(Editor* editor, JSGraph* jsgraph,
Flags flags,
- CompilationDependencies* dependencies)
+ CompilationDependencies* dependencies,
+ Handle<Context> native_context)
: AdvancedReducer(editor),
dependencies_(dependencies),
flags_(flags),
jsgraph_(jsgraph),
+ native_context_(native_context),
type_cache_(TypeCache::Get()) {}
namespace {
@@ -1033,14 +1035,9 @@ Reduction JSBuiltinReducer::ReduceStringIterator(Node* node) {
if (Node* receiver = GetStringWitness(node)) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
- Node* context = NodeProperties::GetContextInput(node);
-
- Node* native_context = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true),
- context, context, effect);
- Node* map = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::STRING_ITERATOR_MAP_INDEX, true),
- native_context, native_context, effect);
+
+ Node* map = jsgraph()->HeapConstant(
+ handle(native_context()->string_iterator_map(), isolate()));
// allocate new iterator
effect = graph()->NewNode(
« no previous file with comments | « src/compiler/js-builtin-reducer.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698