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

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

Issue 2043183003: Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifying checks 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
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 110
111 Node* JSGraph::Constant(Handle<Object> value) { 111 Node* JSGraph::Constant(Handle<Object> value) {
112 // Dereference the handle to determine if a number constant or other 112 // Dereference the handle to determine if a number constant or other
113 // canonicalized node can be used. 113 // canonicalized node can be used.
114 if (value->IsNumber()) { 114 if (value->IsNumber()) {
115 return Constant(value->Number()); 115 return Constant(value->Number());
116 } else if (value->IsUndefined(isolate())) { 116 } else if (value->IsUndefined(isolate())) {
117 return UndefinedConstant(); 117 return UndefinedConstant();
118 } else if (value->IsTrue()) { 118 } else if (value->IsTrue(isolate())) {
119 return TrueConstant(); 119 return TrueConstant();
120 } else if (value->IsFalse()) { 120 } else if (value->IsFalse(isolate())) {
121 return FalseConstant(); 121 return FalseConstant();
122 } else if (value->IsNull()) { 122 } else if (value->IsNull(isolate())) {
123 return NullConstant(); 123 return NullConstant();
124 } else if (value->IsTheHole(isolate())) { 124 } else if (value->IsTheHole(isolate())) {
125 return TheHoleConstant(); 125 return TheHoleConstant();
126 } else { 126 } else {
127 return HeapConstant(Handle<HeapObject>::cast(value)); 127 return HeapConstant(Handle<HeapObject>::cast(value));
128 } 128 }
129 } 129 }
130 130
131 131
132 Node* JSGraph::Constant(double value) { 132 Node* JSGraph::Constant(double value) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { 239 for (size_t i = 0; i < arraysize(cached_nodes_); i++) {
240 if (Node* node = cached_nodes_[i]) { 240 if (Node* node = cached_nodes_[i]) {
241 if (!node->IsDead()) nodes->push_back(node); 241 if (!node->IsDead()) nodes->push_back(node);
242 } 242 }
243 } 243 }
244 } 244 }
245 245
246 } // namespace compiler 246 } // namespace compiler
247 } // namespace internal 247 } // namespace internal
248 } // namespace v8 248 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-create-lowering.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698