| 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/v8.h" | 5 #include "src/v8.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/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 HandleScope scope(isolate); | 105 HandleScope scope(isolate); |
| 106 DCHECK(args.length() == 1); | 106 DCHECK(args.length() == 1); |
| 107 isolate->counters()->math_exp()->Increment(); | 107 isolate->counters()->math_exp()->Increment(); |
| 108 | 108 |
| 109 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 109 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 110 lazily_initialize_fast_exp(); | 110 lazily_initialize_fast_exp(); |
| 111 return *isolate->factory()->NewNumber(fast_exp(x)); | 111 return *isolate->factory()->NewNumber(fast_exp(x)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 | 114 |
| 115 RUNTIME_FUNCTION(Runtime_MathClz32) { |
| 116 HandleScope scope(isolate); |
| 117 DCHECK(args.length() == 1); |
| 118 isolate->counters()->math_clz32()->Increment(); |
| 119 |
| 120 CONVERT_NUMBER_CHECKED(uint32_t, x, Uint32, args[0]); |
| 121 return *isolate->factory()->NewNumberFromUint( |
| 122 base::bits::CountLeadingZeros32(x)); |
| 123 } |
| 124 |
| 125 |
| 115 RUNTIME_FUNCTION(Runtime_MathFloor) { | 126 RUNTIME_FUNCTION(Runtime_MathFloor) { |
| 116 HandleScope scope(isolate); | 127 HandleScope scope(isolate); |
| 117 DCHECK(args.length() == 1); | 128 DCHECK(args.length() == 1); |
| 118 isolate->counters()->math_floor()->Increment(); | 129 isolate->counters()->math_floor()->Increment(); |
| 119 | 130 |
| 120 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 131 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 121 return *isolate->factory()->NewNumber(Floor(x)); | 132 return *isolate->factory()->NewNumber(Floor(x)); |
| 122 } | 133 } |
| 123 | 134 |
| 124 | 135 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 RUNTIME_FUNCTION(Runtime_IsMinusZero) { | 247 RUNTIME_FUNCTION(Runtime_IsMinusZero) { |
| 237 SealHandleScope shs(isolate); | 248 SealHandleScope shs(isolate); |
| 238 DCHECK(args.length() == 1); | 249 DCHECK(args.length() == 1); |
| 239 CONVERT_ARG_CHECKED(Object, obj, 0); | 250 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 240 if (!obj->IsHeapNumber()) return isolate->heap()->false_value(); | 251 if (!obj->IsHeapNumber()) return isolate->heap()->false_value(); |
| 241 HeapNumber* number = HeapNumber::cast(obj); | 252 HeapNumber* number = HeapNumber::cast(obj); |
| 242 return isolate->heap()->ToBoolean(IsMinusZero(number->value())); | 253 return isolate->heap()->ToBoolean(IsMinusZero(number->value())); |
| 243 } | 254 } |
| 244 } | 255 } |
| 245 } // namespace v8::internal | 256 } // namespace v8::internal |
| OLD | NEW |