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

Side by Side Diff: src/bootstrapper.cc

Issue 2715593002: Don't mark remote contexts as callable. (Closed)
Patch Set: hmm Created 3 years, 10 months 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/api-natives.cc ('k') | test/unittests/api/remote-object-unittest.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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4940 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 Handle<JSFunction> global_proxy_function = 4951 Handle<JSFunction> global_proxy_function =
4952 isolate->factory()->NewFunctionFromSharedFunctionInfo( 4952 isolate->factory()->NewFunctionFromSharedFunctionInfo(
4953 initial_map, shared, factory()->undefined_value()); 4953 initial_map, shared, factory()->undefined_value());
4954 DCHECK_EQ(global_proxy_data->internal_field_count(), 4954 DCHECK_EQ(global_proxy_data->internal_field_count(),
4955 global_proxy_template->InternalFieldCount()); 4955 global_proxy_template->InternalFieldCount());
4956 Handle<Map> global_proxy_map = isolate->factory()->NewMap( 4956 Handle<Map> global_proxy_map = isolate->factory()->NewMap(
4957 JS_GLOBAL_PROXY_TYPE, proxy_size, FAST_HOLEY_SMI_ELEMENTS); 4957 JS_GLOBAL_PROXY_TYPE, proxy_size, FAST_HOLEY_SMI_ELEMENTS);
4958 JSFunction::SetInitialMap(global_proxy_function, global_proxy_map, 4958 JSFunction::SetInitialMap(global_proxy_function, global_proxy_map,
4959 factory()->null_value()); 4959 factory()->null_value());
4960 global_proxy_map->set_is_access_check_needed(true); 4960 global_proxy_map->set_is_access_check_needed(true);
4961 global_proxy_map->set_is_callable();
4962 global_proxy_map->set_is_constructor(true);
dcheng 2017/02/23 09:41:44 So I tried a crazier version of this patch... and
4963 global_proxy_map->set_has_hidden_prototype(true); 4961 global_proxy_map->set_has_hidden_prototype(true);
4964 4962
4965 Handle<String> global_name = factory()->global_string(); 4963 Handle<String> global_name = factory()->global_string();
4966 global_proxy_function->shared()->set_instance_class_name(*global_name); 4964 global_proxy_function->shared()->set_instance_class_name(*global_name);
4967 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function); 4965 factory()->ReinitializeJSGlobalProxy(global_proxy, global_proxy_function);
4968 4966
4969 // A remote global proxy has no native context. 4967 // A remote global proxy has no native context.
4970 global_proxy->set_native_context(heap()->null_value()); 4968 global_proxy->set_native_context(heap()->null_value());
4971 4969
4972 // Configure the hidden prototype chain of the global proxy. 4970 // Configure the hidden prototype chain of the global proxy.
(...skipping 28 matching lines...) Expand all
5001 } 4999 }
5002 5000
5003 5001
5004 // Called when the top-level V8 mutex is destroyed. 5002 // Called when the top-level V8 mutex is destroyed.
5005 void Bootstrapper::FreeThreadResources() { 5003 void Bootstrapper::FreeThreadResources() {
5006 DCHECK(!IsActive()); 5004 DCHECK(!IsActive());
5007 } 5005 }
5008 5006
5009 } // namespace internal 5007 } // namespace internal
5010 } // namespace v8 5008 } // namespace v8
OLDNEW
« no previous file with comments | « src/api-natives.cc ('k') | test/unittests/api/remote-object-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698