| 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/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 | 10 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 PretenureFlag pretenure = NOT_TENURED) { | 347 PretenureFlag pretenure = NOT_TENURED) { |
| 348 if (Smi::IsValid(static_cast<intptr_t>(value))) { | 348 if (Smi::IsValid(static_cast<intptr_t>(value))) { |
| 349 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), | 349 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), |
| 350 isolate()); | 350 isolate()); |
| 351 } | 351 } |
| 352 return NewNumber(static_cast<double>(value), pretenure); | 352 return NewNumber(static_cast<double>(value), pretenure); |
| 353 } | 353 } |
| 354 Handle<HeapNumber> NewHeapNumber(double value, | 354 Handle<HeapNumber> NewHeapNumber(double value, |
| 355 MutableMode mode = IMMUTABLE, | 355 MutableMode mode = IMMUTABLE, |
| 356 PretenureFlag pretenure = NOT_TENURED); | 356 PretenureFlag pretenure = NOT_TENURED); |
| 357 Handle<Float32x4> NewFloat32x4(float lanes[4], | 357 |
| 358 PretenureFlag pretenure = NOT_TENURED); | 358 #define SIMD128_NEW_DECL(TYPE, Type, type, lane_count, lane_type) \ |
| 359 Handle<Int32x4> NewInt32x4(int32_t lanes[4], | 359 Handle<Type> New##Type(lane_type lanes[lane_count], \ |
| 360 PretenureFlag pretenure = NOT_TENURED); | 360 PretenureFlag pretenure = NOT_TENURED); |
| 361 Handle<Bool32x4> NewBool32x4(bool lanes[4], | 361 SIMD128_TYPES(SIMD128_NEW_DECL) |
| 362 PretenureFlag pretenure = NOT_TENURED); | 362 #undef SIMD128_NEW_DECL |
| 363 Handle<Int16x8> NewInt16x8(int16_t lanes[8], | |
| 364 PretenureFlag pretenure = NOT_TENURED); | |
| 365 Handle<Bool16x8> NewBool16x8(bool lanes[8], | |
| 366 PretenureFlag pretenure = NOT_TENURED); | |
| 367 Handle<Int8x16> NewInt8x16(int8_t lanes[16], | |
| 368 PretenureFlag pretenure = NOT_TENURED); | |
| 369 Handle<Bool8x16> NewBool8x16(bool lanes[16], | |
| 370 PretenureFlag pretenure = NOT_TENURED); | |
| 371 | 363 |
| 372 // These objects are used by the api to create env-independent data | 364 // These objects are used by the api to create env-independent data |
| 373 // structures in the heap. | 365 // structures in the heap. |
| 374 inline Handle<JSObject> NewNeanderObject() { | 366 inline Handle<JSObject> NewNeanderObject() { |
| 375 return NewJSObjectFromMap(neander_map()); | 367 return NewJSObjectFromMap(neander_map()); |
| 376 } | 368 } |
| 377 | 369 |
| 378 Handle<JSWeakMap> NewJSWeakMap(); | 370 Handle<JSWeakMap> NewJSWeakMap(); |
| 379 | 371 |
| 380 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); | 372 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 727 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
| 736 // size, but keeping the original prototype. The receiver must have at least | 728 // size, but keeping the original prototype. The receiver must have at least |
| 737 // the size of the new object. The object is reinitialized and behaves as an | 729 // the size of the new object. The object is reinitialized and behaves as an |
| 738 // object that has been freshly allocated. | 730 // object that has been freshly allocated. |
| 739 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 731 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
| 740 }; | 732 }; |
| 741 | 733 |
| 742 } } // namespace v8::internal | 734 } } // namespace v8::internal |
| 743 | 735 |
| 744 #endif // V8_FACTORY_H_ | 736 #endif // V8_FACTORY_H_ |
| OLD | NEW |