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

Side by Side Diff: src/factory.cc

Issue 2475433008: Set global proxy internal field count based on the global object template. (Closed)
Patch Set: Address comments Created 4 years, 1 month 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/factory.h ('k') | src/objects.h » ('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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 } 2171 }
2172 DCHECK(map->prototype()->IsNull(isolate())); 2172 DCHECK(map->prototype()->IsNull(isolate()));
2173 Handle<JSProxy> result = New<JSProxy>(map, NEW_SPACE); 2173 Handle<JSProxy> result = New<JSProxy>(map, NEW_SPACE);
2174 result->initialize_properties(); 2174 result->initialize_properties();
2175 result->set_target(*target); 2175 result->set_target(*target);
2176 result->set_handler(*handler); 2176 result->set_handler(*handler);
2177 result->set_hash(*undefined_value(), SKIP_WRITE_BARRIER); 2177 result->set_hash(*undefined_value(), SKIP_WRITE_BARRIER);
2178 return result; 2178 return result;
2179 } 2179 }
2180 2180
2181 2181 Handle<JSGlobalProxy> Factory::NewUninitializedJSGlobalProxy(int size) {
2182 Handle<JSGlobalProxy> Factory::NewUninitializedJSGlobalProxy() {
2183 // Create an empty shell of a JSGlobalProxy that needs to be reinitialized 2182 // Create an empty shell of a JSGlobalProxy that needs to be reinitialized
2184 // via ReinitializeJSGlobalProxy later. 2183 // via ReinitializeJSGlobalProxy later.
2185 Handle<Map> map = 2184 Handle<Map> map = NewMap(JS_GLOBAL_PROXY_TYPE, size);
2186 NewMap(JS_GLOBAL_PROXY_TYPE, JSGlobalProxy::kSizeWithInternalFields);
2187 // Maintain invariant expected from any JSGlobalProxy. 2185 // Maintain invariant expected from any JSGlobalProxy.
2188 map->set_is_access_check_needed(true); 2186 map->set_is_access_check_needed(true);
2189 CALL_HEAP_FUNCTION( 2187 CALL_HEAP_FUNCTION(
2190 isolate(), isolate()->heap()->AllocateJSObjectFromMap(*map, NOT_TENURED), 2188 isolate(), isolate()->heap()->AllocateJSObjectFromMap(*map, NOT_TENURED),
2191 JSGlobalProxy); 2189 JSGlobalProxy);
2192 } 2190 }
2193 2191
2194 2192
2195 void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object, 2193 void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object,
2196 Handle<JSFunction> constructor) { 2194 Handle<JSFunction> constructor) {
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2707 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2710 iterator->set_initial_next(*next); 2708 iterator->set_initial_next(*next);
2711 iterator->set_array(*array); 2709 iterator->set_array(*array);
2712 iterator->set_index(0); 2710 iterator->set_index(0);
2713 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2711 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2714 return iterator; 2712 return iterator;
2715 } 2713 }
2716 2714
2717 } // namespace internal 2715 } // namespace internal
2718 } // namespace v8 2716 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698