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

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

Issue 1680783002: [intrinsics] Kill the %_IsMinusZero intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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') | test/cctest/compiler/test-run-intrinsics.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/assembler.h" 8 #include "src/assembler.h"
9 #include "src/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 RUNTIME_FUNCTION(Runtime_MathFround) { 231 RUNTIME_FUNCTION(Runtime_MathFround) {
232 HandleScope scope(isolate); 232 HandleScope scope(isolate);
233 DCHECK(args.length() == 1); 233 DCHECK(args.length() == 1);
234 234
235 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 235 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
236 float xf = DoubleToFloat32(x); 236 float xf = DoubleToFloat32(x);
237 return *isolate->factory()->NewNumber(xf); 237 return *isolate->factory()->NewNumber(xf);
238 } 238 }
239 239
240 240
241 RUNTIME_FUNCTION(Runtime_IsMinusZero) {
242 SealHandleScope shs(isolate);
243 DCHECK(args.length() == 1);
244 CONVERT_ARG_CHECKED(Object, obj, 0);
245 if (!obj->IsHeapNumber()) return isolate->heap()->false_value();
246 HeapNumber* number = HeapNumber::cast(obj);
247 return isolate->heap()->ToBoolean(IsMinusZero(number->value()));
248 }
249
250
251 RUNTIME_FUNCTION(Runtime_GenerateRandomNumbers) { 241 RUNTIME_FUNCTION(Runtime_GenerateRandomNumbers) {
252 HandleScope scope(isolate); 242 HandleScope scope(isolate);
253 DCHECK(args.length() == 1); 243 DCHECK(args.length() == 1);
254 // Random numbers in the snapshot are not really that random. 244 // Random numbers in the snapshot are not really that random.
255 DCHECK(!isolate->bootstrapper()->IsActive()); 245 DCHECK(!isolate->bootstrapper()->IsActive());
256 static const int kState0Offset = 0; 246 static const int kState0Offset = 0;
257 static const int kState1Offset = 1; 247 static const int kState1Offset = 1;
258 static const int kRandomBatchSize = 64; 248 static const int kRandomBatchSize = 64;
259 CONVERT_ARG_HANDLE_CHECKED(Object, maybe_typed_array, 0); 249 CONVERT_ARG_HANDLE_CHECKED(Object, maybe_typed_array, 0);
260 Handle<JSTypedArray> typed_array; 250 Handle<JSTypedArray> typed_array;
(...skipping 27 matching lines...) Expand all
288 base::RandomNumberGenerator::XorShift128(&state0, &state1); 278 base::RandomNumberGenerator::XorShift128(&state0, &state1);
289 array[i] = base::RandomNumberGenerator::ToDouble(state0, state1); 279 array[i] = base::RandomNumberGenerator::ToDouble(state0, state1);
290 } 280 }
291 // Persist current state. 281 // Persist current state.
292 array[kState0Offset] = uint64_to_double(state0); 282 array[kState0Offset] = uint64_to_double(state0);
293 array[kState1Offset] = uint64_to_double(state1); 283 array[kState1Offset] = uint64_to_double(state1);
294 return *typed_array; 284 return *typed_array;
295 } 285 }
296 } // namespace internal 286 } // namespace internal
297 } // namespace v8 287 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/compiler/test-run-intrinsics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698