Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/factory.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: updates Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Handle<FixedArray> Factory::NewFixedArrayWithSmis(int size, int value,
171 PretenureFlag pretenure) {
172 DCHECK_LT(0, size);
173 CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateFixedArrayWithFiller(
174 size, pretenure, Smi::FromInt(value)),
175 FixedArray);
176 }
170 177
171 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { 178 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) {
172 CALL_HEAP_FUNCTION( 179 CALL_HEAP_FUNCTION(
173 isolate(), 180 isolate(),
174 isolate()->heap()->AllocateUninitializedFixedArray(size), 181 isolate()->heap()->AllocateUninitializedFixedArray(size),
175 FixedArray); 182 FixedArray);
176 } 183 }
177 184
178 185
179 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, 186 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size,
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 script->set_name(heap->undefined_value()); 1058 script->set_name(heap->undefined_value());
1052 script->set_id(isolate()->heap()->NextScriptId()); 1059 script->set_id(isolate()->heap()->NextScriptId());
1053 script->set_line_offset(0); 1060 script->set_line_offset(0);
1054 script->set_column_offset(0); 1061 script->set_column_offset(0);
1055 script->set_context_data(heap->undefined_value()); 1062 script->set_context_data(heap->undefined_value());
1056 script->set_type(Script::TYPE_NORMAL); 1063 script->set_type(Script::TYPE_NORMAL);
1057 script->set_wrapper(heap->undefined_value()); 1064 script->set_wrapper(heap->undefined_value());
1058 script->set_line_ends(heap->undefined_value()); 1065 script->set_line_ends(heap->undefined_value());
1059 script->set_eval_from_shared(heap->undefined_value()); 1066 script->set_eval_from_shared(heap->undefined_value());
1060 script->set_eval_from_position(0); 1067 script->set_eval_from_position(0);
1061 script->set_shared_function_infos(Smi::kZero); 1068 script->set_shared_function_infos(*empty_fixed_array(), SKIP_WRITE_BARRIER);
1062 script->set_flags(0); 1069 script->set_flags(0);
1063 1070
1064 heap->set_script_list(*WeakFixedArray::Add(script_list(), script)); 1071 heap->set_script_list(*WeakFixedArray::Add(script_list(), script));
1065 return script; 1072 return script;
1066 } 1073 }
1067 1074
1068 1075
1069 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { 1076 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) {
1070 CALL_HEAP_FUNCTION(isolate(), 1077 CALL_HEAP_FUNCTION(isolate(),
1071 isolate()->heap()->AllocateForeign(addr, pretenure), 1078 isolate()->heap()->AllocateForeign(addr, pretenure),
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2750 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2744 iterator->set_initial_next(*next); 2751 iterator->set_initial_next(*next);
2745 iterator->set_array(*array); 2752 iterator->set_array(*array);
2746 iterator->set_index(0); 2753 iterator->set_index(0);
2747 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2754 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2748 return iterator; 2755 return iterator;
2749 } 2756 }
2750 2757
2751 } // namespace internal 2758 } // namespace internal
2752 } // namespace v8 2759 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698