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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 Smi::IsValid(static_cast<int32_t>(value))) { | 429 Smi::IsValid(static_cast<int32_t>(value))) { |
430 return Handle<Object>(Smi::FromInt(static_cast<int32_t>(value)), | 430 return Handle<Object>(Smi::FromInt(static_cast<int32_t>(value)), |
431 isolate()); | 431 isolate()); |
432 } | 432 } |
433 return NewNumber(static_cast<double>(value), pretenure); | 433 return NewNumber(static_cast<double>(value), pretenure); |
434 } | 434 } |
435 Handle<HeapNumber> NewHeapNumber(double value, | 435 Handle<HeapNumber> NewHeapNumber(double value, |
436 MutableMode mode = IMMUTABLE, | 436 MutableMode mode = IMMUTABLE, |
437 PretenureFlag pretenure = NOT_TENURED); | 437 PretenureFlag pretenure = NOT_TENURED); |
438 | 438 |
| 439 Handle<HeapNumber> NewMutableHeapNumber( |
| 440 PretenureFlag pretenure = NOT_TENURED) { |
| 441 double hole_nan = bit_cast<double>(kHoleNanInt64); |
| 442 return NewHeapNumber(hole_nan, MUTABLE, pretenure); |
| 443 } |
| 444 |
439 #define SIMD128_NEW_DECL(TYPE, Type, type, lane_count, lane_type) \ | 445 #define SIMD128_NEW_DECL(TYPE, Type, type, lane_count, lane_type) \ |
440 Handle<Type> New##Type(lane_type lanes[lane_count], \ | 446 Handle<Type> New##Type(lane_type lanes[lane_count], \ |
441 PretenureFlag pretenure = NOT_TENURED); | 447 PretenureFlag pretenure = NOT_TENURED); |
442 SIMD128_TYPES(SIMD128_NEW_DECL) | 448 SIMD128_TYPES(SIMD128_NEW_DECL) |
443 #undef SIMD128_NEW_DECL | 449 #undef SIMD128_NEW_DECL |
444 | 450 |
445 Handle<JSWeakMap> NewJSWeakMap(); | 451 Handle<JSWeakMap> NewJSWeakMap(); |
446 | 452 |
447 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); | 453 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); |
448 | 454 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, | 817 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
812 FunctionMode function_mode); | 818 FunctionMode function_mode); |
813 | 819 |
814 void SetClassFunctionInstanceDescriptor(Handle<Map> map); | 820 void SetClassFunctionInstanceDescriptor(Handle<Map> map); |
815 }; | 821 }; |
816 | 822 |
817 } // namespace internal | 823 } // namespace internal |
818 } // namespace v8 | 824 } // namespace v8 |
819 | 825 |
820 #endif // V8_FACTORY_H_ | 826 #endif // V8_FACTORY_H_ |
OLD | NEW |