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

Side by Side Diff: src/runtime/runtime-numbers.cc

Issue 2010183003: [runtime] Kill the %NumberToIntegerMapMinusZero runtime entry. (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/runtime/runtime.h ('k') | src/s390/code-stubs-s390.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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 RUNTIME_FUNCTION(Runtime_NumberToStringSkipCache) { 168 RUNTIME_FUNCTION(Runtime_NumberToStringSkipCache) {
169 HandleScope scope(isolate); 169 HandleScope scope(isolate);
170 DCHECK(args.length() == 1); 170 DCHECK(args.length() == 1);
171 CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, 0); 171 CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, 0);
172 172
173 return *isolate->factory()->NumberToString(number, false); 173 return *isolate->factory()->NumberToString(number, false);
174 } 174 }
175 175
176 176
177 // TODO(bmeurer): Kill this runtime entry. Uses in date.js are wrong anyway.
178 RUNTIME_FUNCTION(Runtime_NumberToIntegerMapMinusZero) {
179 HandleScope scope(isolate);
180 DCHECK(args.length() == 1);
181 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
182 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, input, Object::ToNumber(input));
183 double double_value = DoubleToInteger(input->Number());
184 // Map both -0 and +0 to +0.
185 if (double_value == 0) double_value = 0;
186
187 return *isolate->factory()->NewNumber(double_value);
188 }
189
190
191 // Converts a Number to a Smi, if possible. Returns NaN if the number is not 177 // Converts a Number to a Smi, if possible. Returns NaN if the number is not
192 // a small integer. 178 // a small integer.
193 RUNTIME_FUNCTION(Runtime_NumberToSmi) { 179 RUNTIME_FUNCTION(Runtime_NumberToSmi) {
194 SealHandleScope shs(isolate); 180 SealHandleScope shs(isolate);
195 DCHECK(args.length() == 1); 181 DCHECK(args.length() == 1);
196 CONVERT_ARG_CHECKED(Object, obj, 0); 182 CONVERT_ARG_CHECKED(Object, obj, 0);
197 if (obj->IsSmi()) { 183 if (obj->IsSmi()) {
198 return obj; 184 return obj;
199 } 185 }
200 if (obj->IsHeapNumber()) { 186 if (obj->IsHeapNumber()) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 301
316 RUNTIME_FUNCTION(Runtime_GetHoleNaNLower) { 302 RUNTIME_FUNCTION(Runtime_GetHoleNaNLower) {
317 HandleScope scope(isolate); 303 HandleScope scope(isolate);
318 DCHECK(args.length() == 0); 304 DCHECK(args.length() == 0);
319 return *isolate->factory()->NewNumberFromUint(kHoleNanLower32); 305 return *isolate->factory()->NewNumberFromUint(kHoleNanLower32);
320 } 306 }
321 307
322 308
323 } // namespace internal 309 } // namespace internal
324 } // namespace v8 310 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/s390/code-stubs-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698