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