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 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 PretenureFlag pretenure = NOT_TENURED); | 345 PretenureFlag pretenure = NOT_TENURED); |
346 Handle<Object> NewNumberFromSize(size_t value, | 346 Handle<Object> NewNumberFromSize(size_t value, |
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 PretenureFlag pretenure = NOT_TENURED); | 356 PretenureFlag pretenure = NOT_TENURED); |
356 | 357 |
357 | |
358 // 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 |
359 // structures in the heap. | 359 // structures in the heap. |
360 inline Handle<JSObject> NewNeanderObject() { | 360 inline Handle<JSObject> NewNeanderObject() { |
361 return NewJSObjectFromMap(neander_map()); | 361 return NewJSObjectFromMap(neander_map()); |
362 } | 362 } |
363 | 363 |
364 Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length); | 364 Handle<JSObject> NewArgumentsObject(Handle<Object> callee, int length); |
365 | 365 |
366 // JS objects are pretenured when allocated by the bootstrapper and | 366 // JS objects are pretenured when allocated by the bootstrapper and |
367 // runtime. | 367 // runtime. |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 PretenureFlag pretenure = TENURED); | 710 PretenureFlag pretenure = TENURED); |
711 | 711 |
712 Handle<JSFunction> NewFunction(Handle<Map> map, | 712 Handle<JSFunction> NewFunction(Handle<Map> map, |
713 Handle<String> name, | 713 Handle<String> name, |
714 MaybeHandle<Code> maybe_code); | 714 MaybeHandle<Code> maybe_code); |
715 }; | 715 }; |
716 | 716 |
717 } } // namespace v8::internal | 717 } } // namespace v8::internal |
718 | 718 |
719 #endif // V8_FACTORY_H_ | 719 #endif // V8_FACTORY_H_ |
OLD | NEW |