Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |