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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 Smi::FromInt(FLAG_stack_trace_limit), isolate); | 2111 Smi::FromInt(FLAG_stack_trace_limit), isolate); |
2112 RETURN_ON_EXCEPTION_VALUE( | 2112 RETURN_ON_EXCEPTION_VALUE( |
2113 isolate, | 2113 isolate, |
2114 JSObject::SetLocalPropertyIgnoreAttributes( | 2114 JSObject::SetLocalPropertyIgnoreAttributes( |
2115 Handle<JSObject>::cast(Error), name, stack_trace_limit, NONE), | 2115 Handle<JSObject>::cast(Error), name, stack_trace_limit, NONE), |
2116 false); | 2116 false); |
2117 } | 2117 } |
2118 | 2118 |
2119 // Expose the debug global object in global if a name for it is specified. | 2119 // Expose the debug global object in global if a name for it is specified. |
2120 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { | 2120 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { |
2121 Debug* debug = isolate->debug(); | |
2122 // If loading fails we just bail out without installing the | 2121 // If loading fails we just bail out without installing the |
2123 // debugger but without tanking the whole context. | 2122 // debugger but without tanking the whole context. |
| 2123 Debug* debug = isolate->debug(); |
2124 if (!debug->Load()) return true; | 2124 if (!debug->Load()) return true; |
| 2125 Handle<Context> debug_context = debug->debug_context(); |
2125 // Set the security token for the debugger context to the same as | 2126 // Set the security token for the debugger context to the same as |
2126 // the shell native context to allow calling between these (otherwise | 2127 // the shell native context to allow calling between these (otherwise |
2127 // exposing debug global object doesn't make much sense). | 2128 // exposing debug global object doesn't make much sense). |
2128 debug->debug_context()->set_security_token( | 2129 debug_context->set_security_token(native_context->security_token()); |
2129 native_context->security_token()); | |
2130 | |
2131 Handle<String> debug_string = | 2130 Handle<String> debug_string = |
2132 factory->InternalizeUtf8String(FLAG_expose_debug_as); | 2131 factory->InternalizeUtf8String(FLAG_expose_debug_as); |
2133 Handle<Object> global_proxy( | 2132 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); |
2134 debug->debug_context()->global_proxy(), isolate); | |
2135 RETURN_ON_EXCEPTION_VALUE( | 2133 RETURN_ON_EXCEPTION_VALUE( |
2136 isolate, | 2134 isolate, |
2137 JSObject::SetLocalPropertyIgnoreAttributes( | 2135 JSObject::SetLocalPropertyIgnoreAttributes( |
2138 global, debug_string, global_proxy, DONT_ENUM), | 2136 global, debug_string, global_proxy, DONT_ENUM), |
2139 false); | 2137 false); |
2140 } | 2138 } |
2141 return true; | 2139 return true; |
2142 } | 2140 } |
2143 | 2141 |
2144 | 2142 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 return from + sizeof(NestingCounterType); | 2651 return from + sizeof(NestingCounterType); |
2654 } | 2652 } |
2655 | 2653 |
2656 | 2654 |
2657 // Called when the top-level V8 mutex is destroyed. | 2655 // Called when the top-level V8 mutex is destroyed. |
2658 void Bootstrapper::FreeThreadResources() { | 2656 void Bootstrapper::FreeThreadResources() { |
2659 ASSERT(!IsActive()); | 2657 ASSERT(!IsActive()); |
2660 } | 2658 } |
2661 | 2659 |
2662 } } // namespace v8::internal | 2660 } } // namespace v8::internal |
OLD | NEW |