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 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2322 isolate, result, DebugEvaluate(isolate, outer_info, context, | 2322 isolate, result, DebugEvaluate(isolate, outer_info, context, |
2323 context_extension, receiver, source)); | 2323 context_extension, receiver, source)); |
2324 return *result; | 2324 return *result; |
2325 } | 2325 } |
2326 | 2326 |
2327 | 2327 |
2328 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { | 2328 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { |
2329 HandleScope scope(isolate); | 2329 HandleScope scope(isolate); |
2330 DCHECK(args.length() == 0); | 2330 DCHECK(args.length() == 0); |
2331 | 2331 |
| 2332 DebugScope debug_scope(isolate->debug()); |
2332 // Fill the script objects. | 2333 // Fill the script objects. |
2333 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts(); | 2334 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts(); |
2334 | 2335 |
2335 // Convert the script objects to proper JS objects. | 2336 // Convert the script objects to proper JS objects. |
2336 for (int i = 0; i < instances->length(); i++) { | 2337 for (int i = 0; i < instances->length(); i++) { |
2337 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i))); | 2338 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i))); |
2338 // Get the script wrapper in a local handle before calling GetScriptWrapper, | 2339 // Get the script wrapper in a local handle before calling GetScriptWrapper, |
2339 // because using | 2340 // because using |
2340 // instances->set(i, *GetScriptWrapper(script)) | 2341 // instances->set(i, *GetScriptWrapper(script)) |
2341 // is unsafe as GetScriptWrapper might call GC and the C++ compiler might | 2342 // is unsafe as GetScriptWrapper might call GC and the C++ compiler might |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2826 return Smi::FromInt(isolate->debug()->is_active()); | 2827 return Smi::FromInt(isolate->debug()->is_active()); |
2827 } | 2828 } |
2828 | 2829 |
2829 | 2830 |
2830 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 2831 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
2831 UNIMPLEMENTED(); | 2832 UNIMPLEMENTED(); |
2832 return NULL; | 2833 return NULL; |
2833 } | 2834 } |
2834 } | 2835 } |
2835 } // namespace v8::internal | 2836 } // namespace v8::internal |
OLD | NEW |