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 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 // JS arrays are pretenured when allocated by the parser. | 385 // JS arrays are pretenured when allocated by the parser. |
| 386 | 386 |
| 387 // Create a JSArray with no elements. | 387 // Create a JSArray with no elements. |
| 388 Handle<JSArray> NewJSArray( | 388 Handle<JSArray> NewJSArray( |
| 389 ElementsKind elements_kind, | 389 ElementsKind elements_kind, |
| 390 PretenureFlag pretenure = NOT_TENURED); | 390 PretenureFlag pretenure = NOT_TENURED); |
| 391 | 391 |
| 392 // Create a JSArray with a specified length and elements initialized | 392 // Create a JSArray with a specified length and elements initialized |
| 393 // according to the specified mode. | 393 // according to the specified mode. |
| 394 Handle<JSArray> NewJSArray( | 394 Handle<JSArray> NewJSArray( |
| 395 ElementsKind elements_kind, | 395 ElementsKind elements_kind, int length, int capacity, |
| 396 int length, | 396 ArrayStorageAllocationMode mode = DONT_INITIALIZE_ARRAY_ELEMENTS, |
|
Igor Sheludko
2014/07/25 12:42:49
Before handlification clients used to call Heap::A
| |
| 397 int capacity, | |
| 398 ArrayStorageAllocationMode mode = INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, | |
| 399 PretenureFlag pretenure = NOT_TENURED); | 397 PretenureFlag pretenure = NOT_TENURED); |
| 400 | 398 |
| 401 Handle<JSArray> NewJSArray( | 399 Handle<JSArray> NewJSArray( |
| 402 int capacity, | 400 int capacity, |
| 403 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, | 401 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, |
| 404 PretenureFlag pretenure = NOT_TENURED) { | 402 PretenureFlag pretenure = NOT_TENURED) { |
| 405 if (capacity != 0) { | 403 if (capacity != 0) { |
| 406 elements_kind = GetHoleyElementsKind(elements_kind); | 404 elements_kind = GetHoleyElementsKind(elements_kind); |
| 407 } | 405 } |
| 408 return NewJSArray(elements_kind, 0, capacity, | 406 return NewJSArray(elements_kind, 0, capacity, |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 703 PretenureFlag pretenure = TENURED); | 701 PretenureFlag pretenure = TENURED); |
| 704 | 702 |
| 705 Handle<JSFunction> NewFunction(Handle<Map> map, | 703 Handle<JSFunction> NewFunction(Handle<Map> map, |
| 706 Handle<String> name, | 704 Handle<String> name, |
| 707 MaybeHandle<Code> maybe_code); | 705 MaybeHandle<Code> maybe_code); |
| 708 }; | 706 }; |
| 709 | 707 |
| 710 } } // namespace v8::internal | 708 } } // namespace v8::internal |
| 711 | 709 |
| 712 #endif // V8_FACTORY_H_ | 710 #endif // V8_FACTORY_H_ |
| OLD | NEW |