| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 CALL_HEAP_FUNCTION(Heap::AllocateJSObject(*constructor, pretenure), JSObject); | 594 CALL_HEAP_FUNCTION(Heap::AllocateJSObject(*constructor, pretenure), JSObject); |
| 595 } | 595 } |
| 596 | 596 |
| 597 | 597 |
| 598 Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) { | 598 Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) { |
| 599 CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(*map, NOT_TENURED), | 599 CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(*map, NOT_TENURED), |
| 600 JSObject); | 600 JSObject); |
| 601 } | 601 } |
| 602 | 602 |
| 603 | 603 |
| 604 Handle<JSArray> Factory::NewArrayLiteral(int length) { | |
| 605 return NewJSArrayWithElements(NewFixedArray(length), TENURED); | |
| 606 } | |
| 607 | |
| 608 | |
| 609 Handle<JSArray> Factory::NewJSArray(int length, | 604 Handle<JSArray> Factory::NewJSArray(int length, |
| 610 PretenureFlag pretenure) { | 605 PretenureFlag pretenure) { |
| 611 Handle<JSObject> obj = NewJSObject(Top::array_function(), pretenure); | 606 Handle<JSObject> obj = NewJSObject(Top::array_function(), pretenure); |
| 612 CALL_HEAP_FUNCTION(Handle<JSArray>::cast(obj)->Initialize(length), JSArray); | 607 CALL_HEAP_FUNCTION(Handle<JSArray>::cast(obj)->Initialize(length), JSArray); |
| 613 } | 608 } |
| 614 | 609 |
| 615 | 610 |
| 616 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements, | 611 Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArray> elements, |
| 617 PretenureFlag pretenure) { | 612 PretenureFlag pretenure) { |
| 618 Handle<JSArray> result = | 613 Handle<JSArray> result = |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 Execution::ConfigureInstance(instance, | 856 Execution::ConfigureInstance(instance, |
| 862 instance_template, | 857 instance_template, |
| 863 pending_exception); | 858 pending_exception); |
| 864 } else { | 859 } else { |
| 865 *pending_exception = false; | 860 *pending_exception = false; |
| 866 } | 861 } |
| 867 } | 862 } |
| 868 | 863 |
| 869 | 864 |
| 870 } } // namespace v8::internal | 865 } } // namespace v8::internal |
| OLD | NEW |