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

Side by Side Diff: src/factory.cc

Issue 2577063002: Reland of "Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID" (Closed)
Patch Set: fix 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
« no previous file with comments | « src/debug/liveedit.js ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
171 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { 170 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) {
172 CALL_HEAP_FUNCTION( 171 CALL_HEAP_FUNCTION(
173 isolate(), 172 isolate(),
174 isolate()->heap()->AllocateUninitializedFixedArray(size), 173 isolate()->heap()->AllocateUninitializedFixedArray(size),
175 FixedArray); 174 FixedArray);
176 } 175 }
177 176
178 177
179 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, 178 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size,
180 PretenureFlag pretenure) { 179 PretenureFlag pretenure) {
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 script->set_name(heap->undefined_value()); 1050 script->set_name(heap->undefined_value());
1052 script->set_id(isolate()->heap()->NextScriptId()); 1051 script->set_id(isolate()->heap()->NextScriptId());
1053 script->set_line_offset(0); 1052 script->set_line_offset(0);
1054 script->set_column_offset(0); 1053 script->set_column_offset(0);
1055 script->set_context_data(heap->undefined_value()); 1054 script->set_context_data(heap->undefined_value());
1056 script->set_type(Script::TYPE_NORMAL); 1055 script->set_type(Script::TYPE_NORMAL);
1057 script->set_wrapper(heap->undefined_value()); 1056 script->set_wrapper(heap->undefined_value());
1058 script->set_line_ends(heap->undefined_value()); 1057 script->set_line_ends(heap->undefined_value());
1059 script->set_eval_from_shared(heap->undefined_value()); 1058 script->set_eval_from_shared(heap->undefined_value());
1060 script->set_eval_from_position(0); 1059 script->set_eval_from_position(0);
1061 script->set_shared_function_infos(Smi::kZero); 1060 script->set_shared_function_infos(*empty_fixed_array(), SKIP_WRITE_BARRIER);
1062 script->set_flags(0); 1061 script->set_flags(0);
1063 1062
1064 heap->set_script_list(*WeakFixedArray::Add(script_list(), script)); 1063 heap->set_script_list(*WeakFixedArray::Add(script_list(), script));
1065 return script; 1064 return script;
1066 } 1065 }
1067 1066
1068 1067
1069 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { 1068 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) {
1070 CALL_HEAP_FUNCTION(isolate(), 1069 CALL_HEAP_FUNCTION(isolate(),
1071 isolate()->heap()->AllocateForeign(addr, pretenure), 1070 isolate()->heap()->AllocateForeign(addr, pretenure),
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2779 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2781 iterator->set_initial_next(*next); 2780 iterator->set_initial_next(*next);
2782 iterator->set_array(*array); 2781 iterator->set_array(*array);
2783 iterator->set_index(0); 2782 iterator->set_index(0);
2784 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2783 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2785 return iterator; 2784 return iterator;
2786 } 2785 }
2787 2786
2788 } // namespace internal 2787 } // namespace internal
2789 } // namespace v8 2788 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/liveedit.js ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698