Chromium Code Reviews| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 PretenureFlag pretenure = NOT_TENURED) { | 345 PretenureFlag pretenure = NOT_TENURED) { |
| 346 if (Smi::IsValid(static_cast<intptr_t>(value))) { | 346 if (Smi::IsValid(static_cast<intptr_t>(value))) { |
| 347 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), | 347 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), |
| 348 isolate()); | 348 isolate()); |
| 349 } | 349 } |
| 350 return NewNumber(static_cast<double>(value), pretenure); | 350 return NewNumber(static_cast<double>(value), pretenure); |
| 351 } | 351 } |
| 352 Handle<HeapNumber> NewHeapNumber(double value, | 352 Handle<HeapNumber> NewHeapNumber(double value, |
| 353 MutableMode mode = IMMUTABLE, | 353 MutableMode mode = IMMUTABLE, |
| 354 PretenureFlag pretenure = NOT_TENURED); | 354 PretenureFlag pretenure = NOT_TENURED); |
| 355 Handle<Float32x4> NewFloat32x4(double w, double x, double y, double z, | |
|
titzer
2015/06/03 13:27:15
Should we use float here to force the rounding int
bbudge
2015/06/03 20:31:48
Yes, much better.
| |
| 356 PretenureFlag pretenure = NOT_TENURED); | |
| 355 | 357 |
| 356 // These objects are used by the api to create env-independent data | 358 // These objects are used by the api to create env-independent data |
| 357 // structures in the heap. | 359 // structures in the heap. |
| 358 inline Handle<JSObject> NewNeanderObject() { | 360 inline Handle<JSObject> NewNeanderObject() { |
| 359 return NewJSObjectFromMap(neander_map()); | 361 return NewJSObjectFromMap(neander_map()); |
| 360 } | 362 } |
| 361 | 363 |
| 362 Handle<JSWeakMap> NewJSWeakMap(); | 364 Handle<JSWeakMap> NewJSWeakMap(); |
| 363 | 365 |
| 364 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); | 366 Handle<JSObject> NewArgumentsObject(Handle<JSFunction> callee, int length); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 741 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 743 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
| 742 // size, but keeping the original prototype. The receiver must have at least | 744 // size, but keeping the original prototype. The receiver must have at least |
| 743 // the size of the new object. The object is reinitialized and behaves as an | 745 // the size of the new object. The object is reinitialized and behaves as an |
| 744 // object that has been freshly allocated. | 746 // object that has been freshly allocated. |
| 745 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 747 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
| 746 }; | 748 }; |
| 747 | 749 |
| 748 } } // namespace v8::internal | 750 } } // namespace v8::internal |
| 749 | 751 |
| 750 #endif // V8_FACTORY_H_ | 752 #endif // V8_FACTORY_H_ |
| OLD | NEW |