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

Side by Side Diff: src/factory.cc

Issue 2472573004: Reland "Create internal fields on global proxy objects" (Closed)
Patch Set: rebase 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/bootstrapper.cc ('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 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
2182 Handle<JSGlobalProxy> Factory::NewUninitializedJSGlobalProxy() { 2182 Handle<JSGlobalProxy> Factory::NewUninitializedJSGlobalProxy() {
2183 // Create an empty shell of a JSGlobalProxy that needs to be reinitialized 2183 // Create an empty shell of a JSGlobalProxy that needs to be reinitialized
2184 // via ReinitializeJSGlobalProxy later. 2184 // via ReinitializeJSGlobalProxy later.
2185 Handle<Map> map = NewMap(JS_GLOBAL_PROXY_TYPE, JSGlobalProxy::kSize); 2185 Handle<Map> map =
2186 NewMap(JS_GLOBAL_PROXY_TYPE, JSGlobalProxy::kSizeWithInternalFields);
2186 // Maintain invariant expected from any JSGlobalProxy. 2187 // Maintain invariant expected from any JSGlobalProxy.
2187 map->set_is_access_check_needed(true); 2188 map->set_is_access_check_needed(true);
2188 CALL_HEAP_FUNCTION( 2189 CALL_HEAP_FUNCTION(
2189 isolate(), isolate()->heap()->AllocateJSObjectFromMap(*map, NOT_TENURED), 2190 isolate(), isolate()->heap()->AllocateJSObjectFromMap(*map, NOT_TENURED),
2190 JSGlobalProxy); 2191 JSGlobalProxy);
2191 } 2192 }
2192 2193
2193 2194
2194 void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object, 2195 void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object,
2195 Handle<JSFunction> constructor) { 2196 Handle<JSFunction> constructor) {
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2708 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map)); 2709 Handle<JSFixedArrayIterator>::cast(NewJSObjectFromMap(map));
2709 iterator->set_initial_next(*next); 2710 iterator->set_initial_next(*next);
2710 iterator->set_array(*array); 2711 iterator->set_array(*array);
2711 iterator->set_index(0); 2712 iterator->set_index(0);
2712 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next); 2713 iterator->InObjectPropertyAtPut(JSFixedArrayIterator::kNextIndex, *next);
2713 return iterator; 2714 return iterator;
2714 } 2715 }
2715 2716
2716 } // namespace internal 2717 } // namespace internal
2717 } // namespace v8 2718 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698