| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 PretenureFlag pretenure = NOT_TENURED) { | 354 PretenureFlag pretenure = NOT_TENURED) { |
| 355 if (Smi::IsValid(static_cast<intptr_t>(value))) { | 355 if (Smi::IsValid(static_cast<intptr_t>(value))) { |
| 356 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), | 356 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), |
| 357 isolate()); | 357 isolate()); |
| 358 } | 358 } |
| 359 return NewNumber(static_cast<double>(value), pretenure); | 359 return NewNumber(static_cast<double>(value), pretenure); |
| 360 } | 360 } |
| 361 Handle<HeapNumber> NewHeapNumber(double value, | 361 Handle<HeapNumber> NewHeapNumber(double value, |
| 362 MutableMode mode = IMMUTABLE, | 362 MutableMode mode = IMMUTABLE, |
| 363 PretenureFlag pretenure = NOT_TENURED); | 363 PretenureFlag pretenure = NOT_TENURED); |
| 364 Handle<Float32x4> NewFloat32x4(float w, float x, float y, float z, |
| 365 PretenureFlag pretenure = NOT_TENURED); |
| 364 | 366 |
| 365 // These objects are used by the api to create env-independent data | 367 // These objects are used by the api to create env-independent data |
| 366 // structures in the heap. | 368 // structures in the heap. |
| 367 inline Handle<JSObject> NewNeanderObject() { | 369 inline Handle<JSObject> NewNeanderObject() { |
| 368 return NewJSObjectFromMap(neander_map()); | 370 return NewJSObjectFromMap(neander_map()); |
| 369 } | 371 } |
| 370 | 372 |
| 371 Handle<JSWeakMap> NewJSWeakMap(); | 373 Handle<JSWeakMap> NewJSWeakMap(); |
| 372 | 374 |
| 373 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); | 375 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 752 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
| 751 // size, but keeping the original prototype. The receiver must have at least | 753 // size, but keeping the original prototype. The receiver must have at least |
| 752 // the size of the new object. The object is reinitialized and behaves as an | 754 // the size of the new object. The object is reinitialized and behaves as an |
| 753 // object that has been freshly allocated. | 755 // object that has been freshly allocated. |
| 754 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 756 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
| 755 }; | 757 }; |
| 756 | 758 |
| 757 } } // namespace v8::internal | 759 } } // namespace v8::internal |
| 758 | 760 |
| 759 #endif // V8_FACTORY_H_ | 761 #endif // V8_FACTORY_H_ |
| OLD | NEW |