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 4178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4189 Handle<JSObject> Error = isolate->error_function(); | 4189 Handle<JSObject> Error = isolate->error_function(); |
4190 Handle<String> name = | 4190 Handle<String> name = |
4191 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); | 4191 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); |
4192 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); | 4192 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); |
4193 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); | 4193 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); |
4194 | 4194 |
4195 if (FLAG_expose_wasm || FLAG_validate_asm) { | 4195 if (FLAG_expose_wasm || FLAG_validate_asm) { |
4196 WasmJs::Install(isolate); | 4196 WasmJs::Install(isolate); |
4197 } | 4197 } |
4198 | 4198 |
| 4199 // Expose the debug global object in global if a name for it is specified. |
| 4200 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { |
| 4201 // If loading fails we just bail out without installing the |
| 4202 // debugger but without tanking the whole context. |
| 4203 Debug* debug = isolate->debug(); |
| 4204 if (!debug->Load()) return true; |
| 4205 Handle<Context> debug_context = debug->debug_context(); |
| 4206 // Set the security token for the debugger context to the same as |
| 4207 // the shell native context to allow calling between these (otherwise |
| 4208 // exposing debug global object doesn't make much sense). |
| 4209 debug_context->set_security_token(native_context->security_token()); |
| 4210 Handle<String> debug_string = |
| 4211 factory->InternalizeUtf8String(FLAG_expose_debug_as); |
| 4212 uint32_t index; |
| 4213 if (debug_string->AsArrayIndex(&index)) return true; |
| 4214 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); |
| 4215 JSObject::AddProperty(handle(native_context->global_proxy()), debug_string, |
| 4216 global_proxy, DONT_ENUM); |
| 4217 } |
| 4218 |
4199 return true; | 4219 return true; |
4200 } | 4220 } |
4201 | 4221 |
4202 | 4222 |
4203 static uint32_t Hash(RegisteredExtension* extension) { | 4223 static uint32_t Hash(RegisteredExtension* extension) { |
4204 return v8::internal::ComputePointerHash(extension); | 4224 return v8::internal::ComputePointerHash(extension); |
4205 } | 4225 } |
4206 | 4226 |
4207 Genesis::ExtensionStates::ExtensionStates() : map_(8) {} | 4227 Genesis::ExtensionStates::ExtensionStates() : map_(8) {} |
4208 | 4228 |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4778 } | 4798 } |
4779 | 4799 |
4780 | 4800 |
4781 // Called when the top-level V8 mutex is destroyed. | 4801 // Called when the top-level V8 mutex is destroyed. |
4782 void Bootstrapper::FreeThreadResources() { | 4802 void Bootstrapper::FreeThreadResources() { |
4783 DCHECK(!IsActive()); | 4803 DCHECK(!IsActive()); |
4784 } | 4804 } |
4785 | 4805 |
4786 } // namespace internal | 4806 } // namespace internal |
4787 } // namespace v8 | 4807 } // namespace v8 |
OLD | NEW |