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

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

Issue 553843002: Replace our home-grown BitCast with bit_cast from Chrome/Google3. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « src/compiler/instruction.h ('k') | src/compiler/machine-operator-reducer-unittest.cc » ('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-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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return NullConstant(); 127 return NullConstant();
128 } else if (value->IsTheHole()) { 128 } else if (value->IsTheHole()) {
129 return TheHoleConstant(); 129 return TheHoleConstant();
130 } else { 130 } else {
131 return HeapConstant(value); 131 return HeapConstant(value);
132 } 132 }
133 } 133 }
134 134
135 135
136 Node* JSGraph::Constant(double value) { 136 Node* JSGraph::Constant(double value) {
137 if (BitCast<int64_t>(value) == BitCast<int64_t>(0.0)) return ZeroConstant(); 137 if (bit_cast<int64_t>(value) == bit_cast<int64_t>(0.0)) return ZeroConstant();
138 if (BitCast<int64_t>(value) == BitCast<int64_t>(1.0)) return OneConstant(); 138 if (bit_cast<int64_t>(value) == bit_cast<int64_t>(1.0)) return OneConstant();
139 return NumberConstant(value); 139 return NumberConstant(value);
140 } 140 }
141 141
142 142
143 Node* JSGraph::Constant(int32_t value) { 143 Node* JSGraph::Constant(int32_t value) {
144 if (value == 0) return ZeroConstant(); 144 if (value == 0) return ZeroConstant();
145 if (value == 1) return OneConstant(); 145 if (value == 1) return OneConstant();
146 return NumberConstant(value); 146 return NumberConstant(value);
147 } 147 }
148 148
(...skipping 28 matching lines...) Expand all
177 Node* JSGraph::ExternalConstant(ExternalReference reference) { 177 Node* JSGraph::ExternalConstant(ExternalReference reference) {
178 Node** loc = cache_.FindExternalConstant(reference); 178 Node** loc = cache_.FindExternalConstant(reference);
179 if (*loc == NULL) { 179 if (*loc == NULL) {
180 *loc = NewNode(common()->ExternalConstant(reference)); 180 *loc = NewNode(common()->ExternalConstant(reference));
181 } 181 }
182 return *loc; 182 return *loc;
183 } 183 }
184 } // namespace compiler 184 } // namespace compiler
185 } // namespace internal 185 } // namespace internal
186 } // namespace v8 186 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698