OLD | NEW |
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 RUNTIME_FUNCTION(Runtime_NumberMul) { | 243 RUNTIME_FUNCTION(Runtime_NumberMul) { |
244 HandleScope scope(isolate); | 244 HandleScope scope(isolate); |
245 DCHECK(args.length() == 2); | 245 DCHECK(args.length() == 2); |
246 | 246 |
247 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 247 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
248 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 248 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
249 return *isolate->factory()->NewNumber(x * y); | 249 return *isolate->factory()->NewNumber(x * y); |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 RUNTIME_FUNCTION(Runtime_NumberUnaryMinus) { | |
254 HandleScope scope(isolate); | |
255 DCHECK(args.length() == 1); | |
256 | |
257 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | |
258 return *isolate->factory()->NewNumber(-x); | |
259 } | |
260 | |
261 | |
262 RUNTIME_FUNCTION(Runtime_NumberDiv) { | 253 RUNTIME_FUNCTION(Runtime_NumberDiv) { |
263 HandleScope scope(isolate); | 254 HandleScope scope(isolate); |
264 DCHECK(args.length() == 2); | 255 DCHECK(args.length() == 2); |
265 | 256 |
266 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 257 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
267 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 258 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
268 return *isolate->factory()->NewNumber(x / y); | 259 return *isolate->factory()->NewNumber(x / y); |
269 } | 260 } |
270 | 261 |
271 | 262 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 } | 468 } |
478 | 469 |
479 | 470 |
480 RUNTIME_FUNCTION(Runtime_GetRootNaN) { | 471 RUNTIME_FUNCTION(Runtime_GetRootNaN) { |
481 SealHandleScope shs(isolate); | 472 SealHandleScope shs(isolate); |
482 DCHECK(args.length() == 0); | 473 DCHECK(args.length() == 0); |
483 return isolate->heap()->nan_value(); | 474 return isolate->heap()->nan_value(); |
484 } | 475 } |
485 } // namespace internal | 476 } // namespace internal |
486 } // namespace v8 | 477 } // namespace v8 |
OLD | NEW |