OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 Handle<JSObject> NewJSObjectFromMapForDeoptimizer( | 349 Handle<JSObject> NewJSObjectFromMapForDeoptimizer( |
350 Handle<Map> map, PretenureFlag pretenure = NOT_TENURED); | 350 Handle<Map> map, PretenureFlag pretenure = NOT_TENURED); |
351 | 351 |
352 // JS modules are pretenured. | 352 // JS modules are pretenured. |
353 Handle<JSModule> NewJSModule(Handle<Context> context, | 353 Handle<JSModule> NewJSModule(Handle<Context> context, |
354 Handle<ScopeInfo> scope_info); | 354 Handle<ScopeInfo> scope_info); |
355 | 355 |
356 // JS arrays are pretenured when allocated by the parser. | 356 // JS arrays are pretenured when allocated by the parser. |
357 Handle<JSArray> NewJSArray( | 357 Handle<JSArray> NewJSArray( |
| 358 ElementsKind elements_kind, |
| 359 int length, |
| 360 int capacity, |
| 361 PretenureFlag pretenure = NOT_TENURED); |
| 362 |
| 363 Handle<JSArray> NewJSArray( |
358 int capacity, | 364 int capacity, |
359 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, | 365 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, |
| 366 PretenureFlag pretenure = NOT_TENURED) { |
| 367 return NewJSArray(elements_kind, 0, capacity, pretenure); |
| 368 } |
| 369 |
| 370 Handle<JSArray> NewJSArrayWithElements( |
| 371 Handle<FixedArrayBase> elements, |
| 372 ElementsKind elements_kind, |
| 373 int length, |
360 PretenureFlag pretenure = NOT_TENURED); | 374 PretenureFlag pretenure = NOT_TENURED); |
361 | 375 |
362 Handle<JSArray> NewJSArrayWithElements( | 376 Handle<JSArray> NewJSArrayWithElements( |
363 Handle<FixedArrayBase> elements, | 377 Handle<FixedArrayBase> elements, |
364 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, | 378 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, |
365 PretenureFlag pretenure = NOT_TENURED); | 379 PretenureFlag pretenure = NOT_TENURED) { |
| 380 return NewJSArrayWithElements( |
| 381 elements, elements_kind, elements->length(), pretenure); |
| 382 } |
366 | 383 |
367 void NewJSArrayStorage( | 384 void NewJSArrayStorage( |
368 Handle<JSArray> array, | 385 Handle<JSArray> array, |
369 int length, | 386 int length, |
370 int capacity, | 387 int capacity, |
371 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); | 388 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS); |
372 | 389 |
373 void SetElementsCapacityAndLength(Handle<JSArray> array, | 390 void SetElementsCapacityAndLength(Handle<JSArray> array, |
374 int capacity, | 391 int capacity, |
375 int length); | 392 int length); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 isolate()); | 634 isolate()); |
618 } else { | 635 } else { |
619 return NewNumber(static_cast<double>(value), pretenure); | 636 return NewNumber(static_cast<double>(value), pretenure); |
620 } | 637 } |
621 } | 638 } |
622 | 639 |
623 | 640 |
624 } } // namespace v8::internal | 641 } } // namespace v8::internal |
625 | 642 |
626 #endif // V8_FACTORY_H_ | 643 #endif // V8_FACTORY_H_ |
OLD | NEW |