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

Side by Side Diff: src/compiler/js-context-specialization.cc

Issue 1390073004: Revert of [turbofan] Add initial support for global specialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AstGraphBuilder
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/js-global-specialization.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-context-specialization.h" 5 #include "src/compiler/js-context-specialization.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // before the function to which it belongs has initialized the slot. 88 // before the function to which it belongs has initialized the slot.
89 // We must be conservative and check if the value in the slot is currently the 89 // We must be conservative and check if the value in the slot is currently the
90 // hole or undefined. If it is neither of these, then it must be initialized. 90 // hole or undefined. If it is neither of these, then it must be initialized.
91 if (value->IsUndefined() || value->IsTheHole()) { 91 if (value->IsUndefined() || value->IsTheHole()) {
92 return NoChange(); 92 return NoChange();
93 } 93 }
94 94
95 // Success. The context load can be replaced with the constant. 95 // Success. The context load can be replaced with the constant.
96 // TODO(titzer): record the specialization for sharing code across multiple 96 // TODO(titzer): record the specialization for sharing code across multiple
97 // contexts that have the same value in the corresponding context slot. 97 // contexts that have the same value in the corresponding context slot.
98 if (value->IsConsString()) {
99 value = String::Flatten(Handle<String>::cast(value), TENURED);
100 }
101 Node* constant = jsgraph_->Constant(value); 98 Node* constant = jsgraph_->Constant(value);
102 ReplaceWithValue(node, constant); 99 ReplaceWithValue(node, constant);
103 return Replace(constant); 100 return Replace(constant);
104 } 101 }
105 102
106 103
107 Reduction JSContextSpecialization::ReduceJSStoreContext(Node* node) { 104 Reduction JSContextSpecialization::ReduceJSStoreContext(Node* node) {
108 DCHECK_EQ(IrOpcode::kJSStoreContext, node->opcode()); 105 DCHECK_EQ(IrOpcode::kJSStoreContext, node->opcode());
109 106
110 // Get the specialization context from the node. 107 // Get the specialization context from the node.
(...skipping 22 matching lines...) Expand all
133 } 130 }
134 131
135 132
136 JSOperatorBuilder* JSContextSpecialization::javascript() const { 133 JSOperatorBuilder* JSContextSpecialization::javascript() const {
137 return jsgraph()->javascript(); 134 return jsgraph()->javascript();
138 } 135 }
139 136
140 } // namespace compiler 137 } // namespace compiler
141 } // namespace internal 138 } // namespace internal
142 } // namespace v8 139 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/js-global-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698