| 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 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 Smi::FromInt(FLAG_stack_trace_limit), isolate); | 2162 Smi::FromInt(FLAG_stack_trace_limit), isolate); |
| 2163 RETURN_ON_EXCEPTION_VALUE( | 2163 RETURN_ON_EXCEPTION_VALUE( |
| 2164 isolate, | 2164 isolate, |
| 2165 JSObject::SetLocalPropertyIgnoreAttributes( | 2165 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2166 Handle<JSObject>::cast(Error), name, stack_trace_limit, NONE), | 2166 Handle<JSObject>::cast(Error), name, stack_trace_limit, NONE), |
| 2167 false); | 2167 false); |
| 2168 } | 2168 } |
| 2169 | 2169 |
| 2170 // Expose the debug global object in global if a name for it is specified. | 2170 // Expose the debug global object in global if a name for it is specified. |
| 2171 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { | 2171 if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) { |
| 2172 Debug* debug = isolate->debug(); | |
| 2173 // If loading fails we just bail out without installing the | 2172 // If loading fails we just bail out without installing the |
| 2174 // debugger but without tanking the whole context. | 2173 // debugger but without tanking the whole context. |
| 2174 Debug* debug = isolate->debug(); |
| 2175 if (!debug->Load()) return true; | 2175 if (!debug->Load()) return true; |
| 2176 Handle<Context> debug_context = debug->debug_context(); |
| 2176 // Set the security token for the debugger context to the same as | 2177 // Set the security token for the debugger context to the same as |
| 2177 // the shell native context to allow calling between these (otherwise | 2178 // the shell native context to allow calling between these (otherwise |
| 2178 // exposing debug global object doesn't make much sense). | 2179 // exposing debug global object doesn't make much sense). |
| 2179 debug->debug_context()->set_security_token( | 2180 debug_context->set_security_token(native_context->security_token()); |
| 2180 native_context->security_token()); | |
| 2181 | |
| 2182 Handle<String> debug_string = | 2181 Handle<String> debug_string = |
| 2183 factory->InternalizeUtf8String(FLAG_expose_debug_as); | 2182 factory->InternalizeUtf8String(FLAG_expose_debug_as); |
| 2184 Handle<Object> global_proxy( | 2183 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); |
| 2185 debug->debug_context()->global_proxy(), isolate); | |
| 2186 RETURN_ON_EXCEPTION_VALUE( | 2184 RETURN_ON_EXCEPTION_VALUE( |
| 2187 isolate, | 2185 isolate, |
| 2188 JSObject::SetLocalPropertyIgnoreAttributes( | 2186 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2189 global, debug_string, global_proxy, DONT_ENUM), | 2187 global, debug_string, global_proxy, DONT_ENUM), |
| 2190 false); | 2188 false); |
| 2191 } | 2189 } |
| 2192 return true; | 2190 return true; |
| 2193 } | 2191 } |
| 2194 | 2192 |
| 2195 | 2193 |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2704 return from + sizeof(NestingCounterType); | 2702 return from + sizeof(NestingCounterType); |
| 2705 } | 2703 } |
| 2706 | 2704 |
| 2707 | 2705 |
| 2708 // Called when the top-level V8 mutex is destroyed. | 2706 // Called when the top-level V8 mutex is destroyed. |
| 2709 void Bootstrapper::FreeThreadResources() { | 2707 void Bootstrapper::FreeThreadResources() { |
| 2710 ASSERT(!IsActive()); | 2708 ASSERT(!IsActive()); |
| 2711 } | 2709 } |
| 2712 | 2710 |
| 2713 } } // namespace v8::internal | 2711 } } // namespace v8::internal |
| OLD | NEW |