Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 1062143002: Create result array of %DebugGetLoadedScripts outside the debug context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-474297.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 isolate, result, DebugEvaluate(isolate, outer_info, context, 2331 isolate, result, DebugEvaluate(isolate, outer_info, context,
2332 context_extension, receiver, source)); 2332 context_extension, receiver, source));
2333 return *result; 2333 return *result;
2334 } 2334 }
2335 2335
2336 2336
2337 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { 2337 RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) {
2338 HandleScope scope(isolate); 2338 HandleScope scope(isolate);
2339 DCHECK(args.length() == 0); 2339 DCHECK(args.length() == 0);
2340 2340
2341 DebugScope debug_scope(isolate->debug()); 2341 Handle<FixedArray> instances;
2342 // Fill the script objects. 2342 {
2343 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts(); 2343 DebugScope debug_scope(isolate->debug());
2344 // Fill the script objects.
2345 instances = isolate->debug()->GetLoadedScripts();
2346 }
2344 2347
2345 // Convert the script objects to proper JS objects. 2348 // Convert the script objects to proper JS objects.
2346 for (int i = 0; i < instances->length(); i++) { 2349 for (int i = 0; i < instances->length(); i++) {
2347 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i))); 2350 Handle<Script> script = Handle<Script>(Script::cast(instances->get(i)));
2348 // Get the script wrapper in a local handle before calling GetScriptWrapper, 2351 // Get the script wrapper in a local handle before calling GetScriptWrapper,
2349 // because using 2352 // because using
2350 // instances->set(i, *GetScriptWrapper(script)) 2353 // instances->set(i, *GetScriptWrapper(script))
2351 // is unsafe as GetScriptWrapper might call GC and the C++ compiler might 2354 // is unsafe as GetScriptWrapper might call GC and the C++ compiler might
2352 // already have dereferenced the instances handle. 2355 // already have dereferenced the instances handle.
2353 Handle<JSObject> wrapper = Script::GetWrapper(script); 2356 Handle<JSObject> wrapper = Script::GetWrapper(script);
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 return Smi::FromInt(isolate->debug()->is_active()); 2808 return Smi::FromInt(isolate->debug()->is_active());
2806 } 2809 }
2807 2810
2808 2811
2809 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 2812 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
2810 UNIMPLEMENTED(); 2813 UNIMPLEMENTED();
2811 return NULL; 2814 return NULL;
2812 } 2815 }
2813 } 2816 }
2814 } // namespace v8::internal 2817 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-474297.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698