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

Side by Side Diff: src/bootstrapper.cc

Issue 2601503002: Add Object::IsNullOrUndefined(Isolate*) helper method (Closed)
Patch Set: fixing merge conflicts Created 3 years, 11 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 | « include/v8.h ('k') | src/builtins/builtins-array.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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 MaybeHandle<JSGlobalProxy> maybe_global_proxy, 328 MaybeHandle<JSGlobalProxy> maybe_global_proxy,
329 v8::Local<v8::ObjectTemplate> global_proxy_template) { 329 v8::Local<v8::ObjectTemplate> global_proxy_template) {
330 HandleScope scope(isolate_); 330 HandleScope scope(isolate_);
331 Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template); 331 Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template);
332 Handle<JSGlobalProxy> global_proxy = genesis.global_proxy(); 332 Handle<JSGlobalProxy> global_proxy = genesis.global_proxy();
333 if (global_proxy.is_null()) return Handle<JSGlobalProxy>(); 333 if (global_proxy.is_null()) return Handle<JSGlobalProxy>();
334 return scope.CloseAndEscape(global_proxy); 334 return scope.CloseAndEscape(global_proxy);
335 } 335 }
336 336
337 void Bootstrapper::DetachGlobal(Handle<Context> env) { 337 void Bootstrapper::DetachGlobal(Handle<Context> env) {
338 env->GetIsolate()->counters()->errors_thrown_per_context()->AddSample( 338 Isolate* isolate = env->GetIsolate();
339 env->GetErrorsThrown()); 339 isolate->counters()->errors_thrown_per_context()->AddSample(
340 env->GetErrorsThrown());
340 341
341 Factory* factory = env->GetIsolate()->factory(); 342 Heap* heap = isolate->heap();
342 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); 343 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy()));
343 global_proxy->set_native_context(*factory->null_value()); 344 global_proxy->set_native_context(heap->null_value());
344 JSObject::ForceSetPrototype(global_proxy, factory->null_value()); 345 JSObject::ForceSetPrototype(global_proxy, isolate->factory()->null_value());
345 global_proxy->map()->SetConstructor(*factory->null_value()); 346 global_proxy->map()->SetConstructor(heap->null_value());
346 if (FLAG_track_detached_contexts) { 347 if (FLAG_track_detached_contexts) {
347 env->GetIsolate()->AddDetachedContext(env); 348 env->GetIsolate()->AddDetachedContext(env);
348 } 349 }
349 } 350 }
350 351
351 namespace { 352 namespace {
352 353
353 void InstallFunction(Handle<JSObject> target, Handle<Name> property_name, 354 void InstallFunction(Handle<JSObject> target, Handle<Name> property_name,
354 Handle<JSFunction> function, Handle<String> function_name, 355 Handle<JSFunction> function, Handle<String> function_name,
355 PropertyAttributes attributes = DONT_ENUM) { 356 PropertyAttributes attributes = DONT_ENUM) {
(...skipping 4385 matching lines...) Expand 10 before | Expand all | Expand 10 after
4741 } 4742 }
4742 4743
4743 4744
4744 // Called when the top-level V8 mutex is destroyed. 4745 // Called when the top-level V8 mutex is destroyed.
4745 void Bootstrapper::FreeThreadResources() { 4746 void Bootstrapper::FreeThreadResources() {
4746 DCHECK(!IsActive()); 4747 DCHECK(!IsActive());
4747 } 4748 }
4748 4749
4749 } // namespace internal 4750 } // namespace internal
4750 } // namespace v8 4751 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/builtins/builtins-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698