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

Side by Side Diff: src/compiler/js-graph.cc

Issue 2039023002: [turbofan] Robust node caching for relocatable int{32|64} (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/common-node-cache.h ('k') | src/compiler/node-cache.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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/typer.h" 8 #include "src/compiler/typer.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 Node* JSGraph::Int64Constant(int64_t value) { 155 Node* JSGraph::Int64Constant(int64_t value) {
156 Node** loc = cache_.FindInt64Constant(value); 156 Node** loc = cache_.FindInt64Constant(value);
157 if (*loc == nullptr) { 157 if (*loc == nullptr) {
158 *loc = graph()->NewNode(common()->Int64Constant(value)); 158 *loc = graph()->NewNode(common()->Int64Constant(value));
159 } 159 }
160 return *loc; 160 return *loc;
161 } 161 }
162 162
163 Node* JSGraph::RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) { 163 Node* JSGraph::RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) {
164 Node** loc = cache_.FindRelocatableInt32Constant(value); 164 Node** loc = cache_.FindRelocatableInt32Constant(
165 value, static_cast<RelocInfoMode>(rmode));
165 if (*loc == nullptr) { 166 if (*loc == nullptr) {
166 *loc = graph()->NewNode(common()->RelocatableInt32Constant(value, rmode)); 167 *loc = graph()->NewNode(common()->RelocatableInt32Constant(value, rmode));
167 } 168 }
168 return *loc; 169 return *loc;
169 } 170 }
170 171
171 Node* JSGraph::RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) { 172 Node* JSGraph::RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) {
172 Node** loc = cache_.FindRelocatableInt64Constant(value); 173 Node** loc = cache_.FindRelocatableInt64Constant(
174 value, static_cast<RelocInfoMode>(rmode));
173 if (*loc == nullptr) { 175 if (*loc == nullptr) {
174 *loc = graph()->NewNode(common()->RelocatableInt64Constant(value, rmode)); 176 *loc = graph()->NewNode(common()->RelocatableInt64Constant(value, rmode));
175 } 177 }
176 return *loc; 178 return *loc;
177 } 179 }
178 180
179 Node* JSGraph::RelocatableIntPtrConstant(intptr_t value, 181 Node* JSGraph::RelocatableIntPtrConstant(intptr_t value,
180 RelocInfo::Mode rmode) { 182 RelocInfo::Mode rmode) {
181 return kPointerSize == 8 183 return kPointerSize == 8
182 ? RelocatableInt64Constant(value, rmode) 184 ? RelocatableInt64Constant(value, rmode)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { 239 for (size_t i = 0; i < arraysize(cached_nodes_); i++) {
238 if (Node* node = cached_nodes_[i]) { 240 if (Node* node = cached_nodes_[i]) {
239 if (!node->IsDead()) nodes->push_back(node); 241 if (!node->IsDead()) nodes->push_back(node);
240 } 242 }
241 } 243 }
242 } 244 }
243 245
244 } // namespace compiler 246 } // namespace compiler
245 } // namespace internal 247 } // namespace internal
246 } // namespace v8 248 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-node-cache.h ('k') | src/compiler/node-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698