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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2740 } | 2740 } |
2741 | 2741 |
2742 | 2742 |
2743 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { | 2743 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { |
2744 HandleScope scope(isolate); | 2744 HandleScope scope(isolate); |
2745 DCHECK(args.length() == 0); | 2745 DCHECK(args.length() == 0); |
2746 | 2746 |
2747 Handle<FixedArray> instances; | 2747 Handle<FixedArray> instances; |
2748 { | 2748 { |
2749 DebugScope debug_scope(isolate->debug()); | 2749 DebugScope debug_scope(isolate->debug()); |
| 2750 if (debug_scope.failed()) return isolate->heap()->exception(); |
2750 // Fill the script objects. | 2751 // Fill the script objects. |
2751 instances = isolate->debug()->GetLoadedScripts(); | 2752 instances = isolate->debug()->GetLoadedScripts(); |
2752 } | 2753 } |
2753 | 2754 |
2754 // Convert the script objects to proper JS objects. | 2755 // Convert the script objects to proper JS objects. |
2755 for (int i = 0; i < instances->length(); i++) { | 2756 for (int i = 0; i < instances->length(); i++) { |
2756 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i))); | 2757 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i))); |
2757 // Get the script wrapper in a local handle before calling GetScriptWrapper, | 2758 // Get the script wrapper in a local handle before calling GetScriptWrapper, |
2758 // because using | 2759 // because using |
2759 // instances->set(i, *GetScriptWrapper(script)) | 2760 // instances->set(i, *GetScriptWrapper(script)) |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 return Smi::FromInt(isolate->debug()->is_active()); | 3211 return Smi::FromInt(isolate->debug()->is_active()); |
3211 } | 3212 } |
3212 | 3213 |
3213 | 3214 |
3214 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 3215 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
3215 UNIMPLEMENTED(); | 3216 UNIMPLEMENTED(); |
3216 return NULL; | 3217 return NULL; |
3217 } | 3218 } |
3218 } // namespace internal | 3219 } // namespace internal |
3219 } // namespace v8 | 3220 } // namespace v8 |
OLD | NEW |