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 "isolate.h" | 8 #include "isolate.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 ElementsKind elements_kind, | 329 ElementsKind elements_kind, |
330 int length, | 330 int length, |
331 int capacity, | 331 int capacity, |
332 ArrayStorageAllocationMode mode = INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, | 332 ArrayStorageAllocationMode mode = INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, |
333 PretenureFlag pretenure = NOT_TENURED); | 333 PretenureFlag pretenure = NOT_TENURED); |
334 | 334 |
335 Handle<JSArray> NewJSArray( | 335 Handle<JSArray> NewJSArray( |
336 int capacity, | 336 int capacity, |
337 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, | 337 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND, |
338 PretenureFlag pretenure = NOT_TENURED) { | 338 PretenureFlag pretenure = NOT_TENURED) { |
339 if (capacity != 0) { | |
340 elements_kind = GetHoleyElementsKind(elements_kind); | |
341 } | |
Igor Sheludko
2014/04/03 07:41:11
This piece of code should be here from the beginni
| |
339 return NewJSArray(elements_kind, 0, capacity, | 342 return NewJSArray(elements_kind, 0, capacity, |
340 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, pretenure); | 343 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, pretenure); |
341 } | 344 } |
342 | 345 |
343 Handle<JSArray> NewJSArrayWithElements( | 346 Handle<JSArray> NewJSArrayWithElements( |
344 Handle<FixedArrayBase> elements, | 347 Handle<FixedArrayBase> elements, |
345 ElementsKind elements_kind, | 348 ElementsKind elements_kind, |
346 int length, | 349 int length, |
347 PretenureFlag pretenure = NOT_TENURED); | 350 PretenureFlag pretenure = NOT_TENURED); |
348 | 351 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 | 592 |
590 // Update the map cache in the native context with (keys, map) | 593 // Update the map cache in the native context with (keys, map) |
591 Handle<MapCache> AddToMapCache(Handle<Context> context, | 594 Handle<MapCache> AddToMapCache(Handle<Context> context, |
592 Handle<FixedArray> keys, | 595 Handle<FixedArray> keys, |
593 Handle<Map> map); | 596 Handle<Map> map); |
594 }; | 597 }; |
595 | 598 |
596 } } // namespace v8::internal | 599 } } // namespace v8::internal |
597 | 600 |
598 #endif // V8_FACTORY_H_ | 601 #endif // V8_FACTORY_H_ |
OLD | NEW |