| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 isolate(), | 1434 isolate(), |
| 1435 isolate()->heap()->AllocateJSObjectFromMap( | 1435 isolate()->heap()->AllocateJSObjectFromMap( |
| 1436 *map, | 1436 *map, |
| 1437 pretenure, | 1437 pretenure, |
| 1438 alloc_props, | 1438 alloc_props, |
| 1439 allocation_site.is_null() ? NULL : *allocation_site), | 1439 allocation_site.is_null() ? NULL : *allocation_site), |
| 1440 JSObject); | 1440 JSObject); |
| 1441 } | 1441 } |
| 1442 | 1442 |
| 1443 | 1443 |
| 1444 Handle<JSArray> Factory::NewJSArray(int capacity, | 1444 Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind, |
| 1445 ElementsKind elements_kind, | 1445 int length, |
| 1446 int capacity, |
| 1446 PretenureFlag pretenure) { | 1447 PretenureFlag pretenure) { |
| 1447 if (capacity != 0) { | 1448 if (capacity != 0) { |
| 1448 elements_kind = GetHoleyElementsKind(elements_kind); | 1449 elements_kind = GetHoleyElementsKind(elements_kind); |
| 1449 } | 1450 } |
| 1450 CALL_HEAP_FUNCTION(isolate(), | 1451 CALL_HEAP_FUNCTION(isolate(), |
| 1451 isolate()->heap()->AllocateJSArrayAndStorage( | 1452 isolate()->heap()->AllocateJSArrayAndStorage( |
| 1452 elements_kind, | 1453 elements_kind, |
| 1453 0, | 1454 length, |
| 1454 capacity, | 1455 capacity, |
| 1455 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, | 1456 INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, |
| 1456 pretenure), | 1457 pretenure), |
| 1457 JSArray); | 1458 JSArray); |
| 1458 } | 1459 } |
| 1459 | 1460 |
| 1460 | 1461 |
| 1461 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArrayBase> elements, | 1462 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArrayBase> elements, |
| 1462 ElementsKind elements_kind, | 1463 ElementsKind elements_kind, |
| 1464 int length, |
| 1463 PretenureFlag pretenure) { | 1465 PretenureFlag pretenure) { |
| 1466 ASSERT(length <= elements->length()); |
| 1464 CALL_HEAP_FUNCTION( | 1467 CALL_HEAP_FUNCTION( |
| 1465 isolate(), | 1468 isolate(), |
| 1466 isolate()->heap()->AllocateJSArrayWithElements(*elements, | 1469 isolate()->heap()->AllocateJSArrayWithElements(*elements, |
| 1467 elements_kind, | 1470 elements_kind, |
| 1468 elements->length(), | 1471 length, |
| 1469 pretenure), | 1472 pretenure), |
| 1470 JSArray); | 1473 JSArray); |
| 1471 } | 1474 } |
| 1472 | 1475 |
| 1473 | 1476 |
| 1474 void Factory::NewJSArrayStorage(Handle<JSArray> array, | 1477 void Factory::NewJSArrayStorage(Handle<JSArray> array, |
| 1475 int length, | 1478 int length, |
| 1476 int capacity, | 1479 int capacity, |
| 1477 ArrayStorageAllocationMode mode) { | 1480 ArrayStorageAllocationMode mode) { |
| 1478 CALL_HEAP_FUNCTION_VOID(isolate(), | 1481 CALL_HEAP_FUNCTION_VOID(isolate(), |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 return Handle<Object>::null(); | 2042 return Handle<Object>::null(); |
| 2040 } | 2043 } |
| 2041 | 2044 |
| 2042 | 2045 |
| 2043 Handle<Object> Factory::ToBoolean(bool value) { | 2046 Handle<Object> Factory::ToBoolean(bool value) { |
| 2044 return value ? true_value() : false_value(); | 2047 return value ? true_value() : false_value(); |
| 2045 } | 2048 } |
| 2046 | 2049 |
| 2047 | 2050 |
| 2048 } } // namespace v8::internal | 2051 } } // namespace v8::internal |
| OLD | NEW |