| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 isolate, | 97 isolate, |
| 98 isolate->stub_cache()->ComputeCallDebugPrepareStepIn(argc, kind), | 98 isolate->stub_cache()->ComputeCallDebugPrepareStepIn(argc, kind), |
| 99 Code); | 99 Code); |
| 100 } | 100 } |
| 101 | 101 |
| 102 | 102 |
| 103 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) { | 103 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) { |
| 104 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); | 104 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); |
| 105 // Isolate::context() may have been NULL when "script collected" event | 105 // Isolate::context() may have been NULL when "script collected" event |
| 106 // occured. | 106 // occured. |
| 107 if (*context == NULL) { | 107 if (context.is_null()) return v8::Local<v8::Context>(); |
| 108 return v8::Local<v8::Context>(); | |
| 109 } | |
| 110 Handle<Context> global_context(context->global_context()); | 108 Handle<Context> global_context(context->global_context()); |
| 111 return v8::Utils::ToLocal(global_context); | 109 return v8::Utils::ToLocal(global_context); |
| 112 } | 110 } |
| 113 | 111 |
| 114 | 112 |
| 115 BreakLocationIterator::BreakLocationIterator(Handle<DebugInfo> debug_info, | 113 BreakLocationIterator::BreakLocationIterator(Handle<DebugInfo> debug_info, |
| 116 BreakLocatorType type) { | 114 BreakLocatorType type) { |
| 117 debug_info_ = debug_info; | 115 debug_info_ = debug_info; |
| 118 type_ = type; | 116 type_ = type; |
| 119 reloc_iterator_ = NULL; | 117 reloc_iterator_ = NULL; |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 | 842 |
| 845 // Create the debugger context. | 843 // Create the debugger context. |
| 846 HandleScope scope; | 844 HandleScope scope; |
| 847 Handle<Context> context = | 845 Handle<Context> context = |
| 848 isolate->bootstrapper()->CreateEnvironment( | 846 isolate->bootstrapper()->CreateEnvironment( |
| 849 Handle<Object>::null(), | 847 Handle<Object>::null(), |
| 850 v8::Handle<ObjectTemplate>(), | 848 v8::Handle<ObjectTemplate>(), |
| 851 NULL); | 849 NULL); |
| 852 | 850 |
| 853 // Use the debugger context. | 851 // Use the debugger context. |
| 854 SaveContext save; | 852 SaveContext save(isolate); |
| 855 isolate->set_context(*context); | 853 isolate->set_context(*context); |
| 856 | 854 |
| 857 // Expose the builtins object in the debugger context. | 855 // Expose the builtins object in the debugger context. |
| 858 Handle<String> key = FACTORY->LookupAsciiSymbol("builtins"); | 856 Handle<String> key = FACTORY->LookupAsciiSymbol("builtins"); |
| 859 Handle<GlobalObject> global = Handle<GlobalObject>(context->global()); | 857 Handle<GlobalObject> global = Handle<GlobalObject>(context->global()); |
| 860 SetProperty(global, key, Handle<Object>(global->builtins()), NONE); | 858 SetProperty(global, key, Handle<Object>(global->builtins()), NONE); |
| 861 | 859 |
| 862 // Compile the JavaScript for the debugger in the debugger context. | 860 // Compile the JavaScript for the debugger in the debugger context. |
| 863 isolate->debugger()->set_compiling_natives(true); | 861 isolate->debugger()->set_compiling_natives(true); |
| 864 bool caught_exception = | 862 bool caught_exception = |
| (...skipping 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3152 { | 3150 { |
| 3153 Locker locker; | 3151 Locker locker; |
| 3154 Isolate::Current()->debugger()->CallMessageDispatchHandler(); | 3152 Isolate::Current()->debugger()->CallMessageDispatchHandler(); |
| 3155 } | 3153 } |
| 3156 } | 3154 } |
| 3157 } | 3155 } |
| 3158 | 3156 |
| 3159 #endif // ENABLE_DEBUGGER_SUPPORT | 3157 #endif // ENABLE_DEBUGGER_SUPPORT |
| 3160 | 3158 |
| 3161 } } // namespace v8::internal | 3159 } } // namespace v8::internal |
| OLD | NEW |