| 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/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" | 
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" | 
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 366 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { | 366 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { | 
| 367   // object.__proto__ = proto; | 367   // object.__proto__ = proto; | 
| 368   Handle<Map> old_map = Handle<Map>(object->map()); | 368   Handle<Map> old_map = Handle<Map>(object->map()); | 
| 369   Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype"); | 369   Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype"); | 
| 370   Map::SetPrototype(new_map, proto, FAST_PROTOTYPE); | 370   Map::SetPrototype(new_map, proto, FAST_PROTOTYPE); | 
| 371   JSObject::MigrateToMap(object, new_map); | 371   JSObject::MigrateToMap(object, new_map); | 
| 372 } | 372 } | 
| 373 | 373 | 
| 374 | 374 | 
| 375 void Bootstrapper::DetachGlobal(Handle<Context> env) { | 375 void Bootstrapper::DetachGlobal(Handle<Context> env) { | 
|  | 376   env->GetIsolate()->counters()->errors_thrown_per_context()->AddSample( | 
|  | 377     env->GetErrorsThrown()); | 
|  | 378 | 
| 376   Factory* factory = env->GetIsolate()->factory(); | 379   Factory* factory = env->GetIsolate()->factory(); | 
| 377   Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); | 380   Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); | 
| 378   global_proxy->set_native_context(*factory->null_value()); | 381   global_proxy->set_native_context(*factory->null_value()); | 
| 379   SetObjectPrototype(global_proxy, factory->null_value()); | 382   SetObjectPrototype(global_proxy, factory->null_value()); | 
| 380   global_proxy->map()->SetConstructor(*factory->null_value()); | 383   global_proxy->map()->SetConstructor(*factory->null_value()); | 
| 381   if (FLAG_track_detached_contexts) { | 384   if (FLAG_track_detached_contexts) { | 
| 382     env->GetIsolate()->AddDetachedContext(env); | 385     env->GetIsolate()->AddDetachedContext(env); | 
| 383   } | 386   } | 
| 384 } | 387 } | 
| 385 | 388 | 
| (...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3320 } | 3323 } | 
| 3321 | 3324 | 
| 3322 | 3325 | 
| 3323 // Called when the top-level V8 mutex is destroyed. | 3326 // Called when the top-level V8 mutex is destroyed. | 
| 3324 void Bootstrapper::FreeThreadResources() { | 3327 void Bootstrapper::FreeThreadResources() { | 
| 3325   DCHECK(!IsActive()); | 3328   DCHECK(!IsActive()); | 
| 3326 } | 3329 } | 
| 3327 | 3330 | 
| 3328 }  // namespace internal | 3331 }  // namespace internal | 
| 3329 }  // namespace v8 | 3332 }  // namespace v8 | 
| OLD | NEW | 
|---|