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

Side by Side Diff: src/bootstrapper.cc

Issue 2589083002: [debugger] sunset --expose-debug-as flag. (Closed)
Patch Set: Created 4 years 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 | « no previous file | src/flag-definitions.h » ('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 4058 matching lines...) Expand 10 before | Expand all | Expand 10 after
4069 HandleScope scope(isolate); 4069 HandleScope scope(isolate);
4070 Handle<JSGlobalObject> global(JSGlobalObject::cast( 4070 Handle<JSGlobalObject> global(JSGlobalObject::cast(
4071 native_context->global_object())); 4071 native_context->global_object()));
4072 4072
4073 Handle<JSObject> Error = isolate->error_function(); 4073 Handle<JSObject> Error = isolate->error_function();
4074 Handle<String> name = 4074 Handle<String> name =
4075 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); 4075 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit"));
4076 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); 4076 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate);
4077 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); 4077 JSObject::AddProperty(Error, name, stack_trace_limit, NONE);
4078 4078
4079 // Expose the debug global object in global if a name for it is specified.
4080 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
4081 // If loading fails we just bail out without installing the
4082 // debugger but without tanking the whole context.
4083 Debug* debug = isolate->debug();
4084 if (!debug->Load()) return true;
4085 Handle<Context> debug_context = debug->debug_context();
4086 // Set the security token for the debugger context to the same as
4087 // the shell native context to allow calling between these (otherwise
4088 // exposing debug global object doesn't make much sense).
4089 debug_context->set_security_token(native_context->security_token());
4090 Handle<String> debug_string =
4091 factory->InternalizeUtf8String(FLAG_expose_debug_as);
4092 uint32_t index;
4093 if (debug_string->AsArrayIndex(&index)) return true;
4094 Handle<Object> global_proxy(debug_context->global_proxy(), isolate);
4095 JSObject::AddProperty(global, debug_string, global_proxy, DONT_ENUM);
4096 }
4097
4098 WasmJs::Install(isolate, global); 4079 WasmJs::Install(isolate, global);
4099 4080
4100 return true; 4081 return true;
4101 } 4082 }
4102 4083
4103 4084
4104 static uint32_t Hash(RegisteredExtension* extension) { 4085 static uint32_t Hash(RegisteredExtension* extension) {
4105 return v8::internal::ComputePointerHash(extension); 4086 return v8::internal::ComputePointerHash(extension);
4106 } 4087 }
4107 4088
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
4675 } 4656 }
4676 4657
4677 4658
4678 // Called when the top-level V8 mutex is destroyed. 4659 // Called when the top-level V8 mutex is destroyed.
4679 void Bootstrapper::FreeThreadResources() { 4660 void Bootstrapper::FreeThreadResources() {
4680 DCHECK(!IsActive()); 4661 DCHECK(!IsActive());
4681 } 4662 }
4682 4663
4683 } // namespace internal 4664 } // namespace internal
4684 } // namespace v8 4665 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698