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

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

Issue 656103002: Add JSGraph::GetCachedNodes and NodeCache::GetCachedNodes. These routines are necessary in the dead… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
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-graph.h" 5 #include "src/compiler/js-graph.h"
6 #include "src/compiler/node-properties-inl.h" 6 #include "src/compiler/node-properties-inl.h"
7 #include "src/compiler/typer.h" 7 #include "src/compiler/typer.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 192
193 Node* JSGraph::ExternalConstant(ExternalReference reference) { 193 Node* JSGraph::ExternalConstant(ExternalReference reference) {
194 Node** loc = cache_.FindExternalConstant(reference); 194 Node** loc = cache_.FindExternalConstant(reference);
195 if (*loc == NULL) { 195 if (*loc == NULL) {
196 *loc = NewNode(common()->ExternalConstant(reference)); 196 *loc = NewNode(common()->ExternalConstant(reference));
197 } 197 }
198 return *loc; 198 return *loc;
199 } 199 }
200 200
201
202 void JSGraph::GetCachedNodes(NodeVector* nodes) {
203 cache_.GetCachedNodes(nodes);
204 SetOncePointer<Node>* ptrs[] = {
205 &c_entry_stub_constant_, &undefined_constant_, &the_hole_constant_,
206 &true_constant_, &false_constant_, &null_constant_,
207 &zero_constant_, &one_constant_, &nan_constant_};
208 for (size_t i = 0; i < arraysize(ptrs); i++) {
209 if (ptrs[i]->is_set()) nodes->push_back(ptrs[i]->get());
210 }
211 }
212
201 } // namespace compiler 213 } // namespace compiler
202 } // namespace internal 214 } // namespace internal
203 } // namespace v8 215 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-graph.h ('k') | src/compiler/node-cache.h » ('j') | src/compiler/node-cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698