| 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 4204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4215 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); | 4215 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("stackTraceLimit")); |
| 4216 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); | 4216 Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate); |
| 4217 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); | 4217 JSObject::AddProperty(Error, name, stack_trace_limit, NONE); |
| 4218 | 4218 |
| 4219 if (FLAG_expose_wasm || FLAG_validate_asm) { | 4219 if (FLAG_expose_wasm || FLAG_validate_asm) { |
| 4220 WasmJs::Install(isolate); | 4220 WasmJs::Install(isolate); |
| 4221 } | 4221 } |
| 4222 | 4222 |
| 4223 InstallFFIMap(isolate); | 4223 InstallFFIMap(isolate); |
| 4224 | 4224 |
| 4225 // Expose the debug global object in global if a name for it is specified. | |
| 4226 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { | |
| 4227 // If loading fails we just bail out without installing the | |
| 4228 // debugger but without tanking the whole context. | |
| 4229 Debug* debug = isolate->debug(); | |
| 4230 if (!debug->Load()) return true; | |
| 4231 Handle<Context> debug_context = debug->debug_context(); | |
| 4232 // Set the security token for the debugger context to the same as | |
| 4233 // the shell native context to allow calling between these (otherwise | |
| 4234 // exposing debug global object doesn't make much sense). | |
| 4235 debug_context->set_security_token(native_context->security_token()); | |
| 4236 Handle<String> debug_string = | |
| 4237 factory->InternalizeUtf8String(FLAG_expose_debug_as); | |
| 4238 uint32_t index; | |
| 4239 if (debug_string->AsArrayIndex(&index)) return true; | |
| 4240 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); | |
| 4241 JSObject::AddProperty(handle(native_context->global_proxy()), debug_string, | |
| 4242 global_proxy, DONT_ENUM); | |
| 4243 } | |
| 4244 | |
| 4245 return true; | 4225 return true; |
| 4246 } | 4226 } |
| 4247 | 4227 |
| 4248 | 4228 |
| 4249 static uint32_t Hash(RegisteredExtension* extension) { | 4229 static uint32_t Hash(RegisteredExtension* extension) { |
| 4250 return v8::internal::ComputePointerHash(extension); | 4230 return v8::internal::ComputePointerHash(extension); |
| 4251 } | 4231 } |
| 4252 | 4232 |
| 4253 Genesis::ExtensionStates::ExtensionStates() : map_(8) {} | 4233 Genesis::ExtensionStates::ExtensionStates() : map_(8) {} |
| 4254 | 4234 |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4824 } | 4804 } |
| 4825 | 4805 |
| 4826 | 4806 |
| 4827 // Called when the top-level V8 mutex is destroyed. | 4807 // Called when the top-level V8 mutex is destroyed. |
| 4828 void Bootstrapper::FreeThreadResources() { | 4808 void Bootstrapper::FreeThreadResources() { |
| 4829 DCHECK(!IsActive()); | 4809 DCHECK(!IsActive()); |
| 4830 } | 4810 } |
| 4831 | 4811 |
| 4832 } // namespace internal | 4812 } // namespace internal |
| 4833 } // namespace v8 | 4813 } // namespace v8 |
| OLD | NEW |