| 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 #include "src/factory.h" | 5 #include "src/factory.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 PretenureFlag pretenure) { | 160 PretenureFlag pretenure) { |
| 161 DCHECK(0 <= size); | 161 DCHECK(0 <= size); |
| 162 CALL_HEAP_FUNCTION( | 162 CALL_HEAP_FUNCTION( |
| 163 isolate(), | 163 isolate(), |
| 164 isolate()->heap()->AllocateFixedArrayWithFiller(size, | 164 isolate()->heap()->AllocateFixedArrayWithFiller(size, |
| 165 pretenure, | 165 pretenure, |
| 166 *the_hole_value()), | 166 *the_hole_value()), |
| 167 FixedArray); | 167 FixedArray); |
| 168 } | 168 } |
| 169 | 169 |
| 170 |
| 170 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { | 171 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { |
| 171 CALL_HEAP_FUNCTION( | 172 CALL_HEAP_FUNCTION( |
| 172 isolate(), | 173 isolate(), |
| 173 isolate()->heap()->AllocateUninitializedFixedArray(size), | 174 isolate()->heap()->AllocateUninitializedFixedArray(size), |
| 174 FixedArray); | 175 FixedArray); |
| 175 } | 176 } |
| 176 | 177 |
| 177 | 178 |
| 178 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, | 179 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, |
| 179 PretenureFlag pretenure) { | 180 PretenureFlag pretenure) { |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 script->set_name(heap->undefined_value()); | 1051 script->set_name(heap->undefined_value()); |
| 1051 script->set_id(isolate()->heap()->NextScriptId()); | 1052 script->set_id(isolate()->heap()->NextScriptId()); |
| 1052 script->set_line_offset(0); | 1053 script->set_line_offset(0); |
| 1053 script->set_column_offset(0); | 1054 script->set_column_offset(0); |
| 1054 script->set_context_data(heap->undefined_value()); | 1055 script->set_context_data(heap->undefined_value()); |
| 1055 script->set_type(Script::TYPE_NORMAL); | 1056 script->set_type(Script::TYPE_NORMAL); |
| 1056 script->set_wrapper(heap->undefined_value()); | 1057 script->set_wrapper(heap->undefined_value()); |
| 1057 script->set_line_ends(heap->undefined_value()); | 1058 script->set_line_ends(heap->undefined_value()); |
| 1058 script->set_eval_from_shared(heap->undefined_value()); | 1059 script->set_eval_from_shared(heap->undefined_value()); |
| 1059 script->set_eval_from_position(0); | 1060 script->set_eval_from_position(0); |
| 1060 script->set_shared_function_infos(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 1061 script->set_shared_function_infos(Smi::kZero); |
| 1061 script->set_flags(0); | 1062 script->set_flags(0); |
| 1062 | 1063 |
| 1063 heap->set_script_list(*WeakFixedArray::Add(script_list(), script)); | 1064 heap->set_script_list(*WeakFixedArray::Add(script_list(), script)); |
| 1064 return script; | 1065 return script; |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 | 1068 |
| 1068 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { | 1069 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { |
| 1069 CALL_HEAP_FUNCTION(isolate(), | 1070 CALL_HEAP_FUNCTION(isolate(), |
| 1070 isolate()->heap()->AllocateForeign(addr, pretenure), | 1071 isolate()->heap()->AllocateForeign(addr, pretenure), |
| (...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2778 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); | 2779 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); |
| 2779 iterator->set_initial_next(*next); | 2780 iterator->set_initial_next(*next); |
| 2780 iterator->set_array(*array); | 2781 iterator->set_array(*array); |
| 2781 iterator->set_index(0); | 2782 iterator->set_index(0); |
| 2782 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); | 2783 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); |
| 2783 return iterator; | 2784 return iterator; |
| 2784 } | 2785 } |
| 2785 | 2786 |
| 2786 } // namespace internal | 2787 } // namespace internal |
| 2787 } // namespace v8 | 2788 } // namespace v8 |
| OLD | NEW |