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

Side by Side Diff: src/compiler/change-lowering.cc

Issue 466673004: Use CommonNodeCache for heap constants in ChangeLowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix Created 6 years, 4 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
« no previous file with comments | « no previous file | src/compiler/common-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/compiler/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 6
7 #include "src/compiler/common-node-cache.h" 7 #include "src/compiler/common-node-cache.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 16 matching lines...) Expand all
27 Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) { 27 Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) {
28 Node** loc = cache()->FindExternalConstant(reference); 28 Node** loc = cache()->FindExternalConstant(reference);
29 if (*loc == NULL) { 29 if (*loc == NULL) {
30 *loc = graph()->NewNode(common()->ExternalConstant(reference)); 30 *loc = graph()->NewNode(common()->ExternalConstant(reference));
31 } 31 }
32 return *loc; 32 return *loc;
33 } 33 }
34 34
35 35
36 Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) { 36 Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) {
37 // TODO(bmeurer): Use common node cache. 37 Node** loc = cache()->FindHeapConstant(value);
38 return graph()->NewNode(common()->HeapConstant(value)); 38 if (*loc == NULL) {
39 *loc = graph()->NewNode(common()->HeapConstant(value));
40 }
41 return *loc;
39 } 42 }
40 43
41 44
42 Node* ChangeLoweringBase::ImmovableHeapConstant(Handle<HeapObject> value) { 45 Node* ChangeLoweringBase::ImmovableHeapConstant(Handle<HeapObject> value) {
43 return HeapConstant( 46 return HeapConstant(
44 PrintableUnique<HeapObject>::CreateImmovable(graph()->zone(), value)); 47 PrintableUnique<HeapObject>::CreateImmovable(graph()->zone(), value));
45 } 48 }
46 49
47 50
48 Node* ChangeLoweringBase::Int32Constant(int32_t value) { 51 Node* ChangeLoweringBase::Int32Constant(int32_t value) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return Replace(phi); 254 return Replace(phi);
252 } 255 }
253 256
254 257
255 template class ChangeLowering<4>; 258 template class ChangeLowering<4>;
256 template class ChangeLowering<8>; 259 template class ChangeLowering<8>;
257 260
258 } // namespace compiler 261 } // namespace compiler
259 } // namespace internal 262 } // namespace internal
260 } // namespace v8 263 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/common-node-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698