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 // add thrown javascript exceptions | |
Michael Starzinger
2015/10/30 12:27:10
nit: Please capitalize and punctuate comment.
Michael Hablich
2015/10/30 15:55:02
I removed the comment entirely because the code is
| |
377 env->GetIsolate()->counters()->exceptions_thrown_per_context()->AddSample( | |
378 env->GetExceptionsThrown()); | |
379 | |
376 Factory* factory = env->GetIsolate()->factory(); | 380 Factory* factory = env->GetIsolate()->factory(); |
377 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); | 381 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); |
378 global_proxy->set_native_context(*factory->null_value()); | 382 global_proxy->set_native_context(*factory->null_value()); |
379 SetObjectPrototype(global_proxy, factory->null_value()); | 383 SetObjectPrototype(global_proxy, factory->null_value()); |
380 global_proxy->map()->SetConstructor(*factory->null_value()); | 384 global_proxy->map()->SetConstructor(*factory->null_value()); |
381 if (FLAG_track_detached_contexts) { | 385 if (FLAG_track_detached_contexts) { |
382 env->GetIsolate()->AddDetachedContext(env); | 386 env->GetIsolate()->AddDetachedContext(env); |
383 } | 387 } |
384 } | 388 } |
385 | 389 |
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3320 } | 3324 } |
3321 | 3325 |
3322 | 3326 |
3323 // Called when the top-level V8 mutex is destroyed. | 3327 // Called when the top-level V8 mutex is destroyed. |
3324 void Bootstrapper::FreeThreadResources() { | 3328 void Bootstrapper::FreeThreadResources() { |
3325 DCHECK(!IsActive()); | 3329 DCHECK(!IsActive()); |
3326 } | 3330 } |
3327 | 3331 |
3328 } // namespace internal | 3332 } // namespace internal |
3329 } // namespace v8 | 3333 } // namespace v8 |
OLD | NEW |