| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 namespace v8 { namespace internal { | 36 namespace v8 { namespace internal { |
| 37 | 37 |
| 38 | 38 |
| 39 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { | 39 Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) { |
| 40 ASSERT(0 <= size); | 40 ASSERT(0 <= size); |
| 41 CALL_HEAP_FUNCTION(Heap::AllocateFixedArray(size, pretenure), FixedArray); | 41 CALL_HEAP_FUNCTION(Heap::AllocateFixedArray(size, pretenure), FixedArray); |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 Handle<FixedArray> Factory::NewFixedArrayWithHoles(int size) { |
| 46 ASSERT(0 <= size); |
| 47 CALL_HEAP_FUNCTION(Heap::AllocateFixedArrayWithHoles(size), FixedArray); |
| 48 } |
| 49 |
| 50 |
| 51 Handle<Dictionary> Factory::NewDictionary(int at_least_space_for) { |
| 52 ASSERT(0 <= at_least_space_for); |
| 53 CALL_HEAP_FUNCTION(Dictionary::Allocate(at_least_space_for), Dictionary); |
| 54 } |
| 55 |
| 56 |
| 45 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) { | 57 Handle<DescriptorArray> Factory::NewDescriptorArray(int number_of_descriptors) { |
| 46 ASSERT(0 <= number_of_descriptors); | 58 ASSERT(0 <= number_of_descriptors); |
| 47 CALL_HEAP_FUNCTION(DescriptorArray::Allocate(number_of_descriptors), | 59 CALL_HEAP_FUNCTION(DescriptorArray::Allocate(number_of_descriptors), |
| 48 DescriptorArray); | 60 DescriptorArray); |
| 49 } | 61 } |
| 50 | 62 |
| 51 | 63 |
| 52 // Symbols are created in the old generation (data space). | 64 // Symbols are created in the old generation (data space). |
| 53 Handle<String> Factory::LookupSymbol(Vector<const char> string) { | 65 Handle<String> Factory::LookupSymbol(Vector<const char> string) { |
| 54 CALL_HEAP_FUNCTION(Heap::LookupSymbol(string), String); | 66 CALL_HEAP_FUNCTION(Heap::LookupSymbol(string), String); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return info; | 143 return info; |
| 132 } | 144 } |
| 133 | 145 |
| 134 | 146 |
| 135 Handle<Script> Factory::NewScript(Handle<String> source) { | 147 Handle<Script> Factory::NewScript(Handle<String> source) { |
| 136 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); | 148 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); |
| 137 script->set_source(*source); | 149 script->set_source(*source); |
| 138 script->set_name(Heap::undefined_value()); | 150 script->set_name(Heap::undefined_value()); |
| 139 script->set_line_offset(Smi::FromInt(0)); | 151 script->set_line_offset(Smi::FromInt(0)); |
| 140 script->set_column_offset(Smi::FromInt(0)); | 152 script->set_column_offset(Smi::FromInt(0)); |
| 153 script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); |
| 141 script->set_wrapper(*Factory::NewProxy(0, TENURED)); | 154 script->set_wrapper(*Factory::NewProxy(0, TENURED)); |
| 142 script->set_type(Smi::FromInt(SCRIPT_TYPE_NORMAL)); | |
| 143 return script; | 155 return script; |
| 144 } | 156 } |
| 145 | 157 |
| 146 | 158 |
| 147 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) { | 159 Handle<Proxy> Factory::NewProxy(Address addr, PretenureFlag pretenure) { |
| 148 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy); | 160 CALL_HEAP_FUNCTION(Heap::AllocateProxy(addr, pretenure), Proxy); |
| 149 } | 161 } |
| 150 | 162 |
| 151 | 163 |
| 152 Handle<Proxy> Factory::NewProxy(const AccessorDescriptor* desc) { | 164 Handle<Proxy> Factory::NewProxy(const AccessorDescriptor* desc) { |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 Execution::ConfigureInstance(instance, | 844 Execution::ConfigureInstance(instance, |
| 833 instance_template, | 845 instance_template, |
| 834 pending_exception); | 846 pending_exception); |
| 835 } else { | 847 } else { |
| 836 *pending_exception = false; | 848 *pending_exception = false; |
| 837 } | 849 } |
| 838 } | 850 } |
| 839 | 851 |
| 840 | 852 |
| 841 } } // namespace v8::internal | 853 } } // namespace v8::internal |
| OLD | NEW |