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

Side by Side Diff: Source/bindings/v8/DebuggerScript.js

Issue 466243002: Support merged Dart-JS callstacks (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/dart/DartScriptDebugServer.cpp ('k') | Source/bindings/v8/ScriptDebugServer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 var funcObject = frameDetails.func(); 345 var funcObject = frameDetails.func();
346 var sourcePosition; 346 var sourcePosition;
347 // FIXMEDART: if added purely for Dart. 347 // FIXMEDART: if added purely for Dart.
348 if (frameDetails.sourcePosition) { 348 if (frameDetails.sourcePosition) {
349 sourcePosition = frameDetails.sourcePosition(); 349 sourcePosition = frameDetails.sourcePosition();
350 } 350 }
351 var thisObject = frameDetails.receiver(); 351 var thisObject = frameDetails.receiver();
352 352
353 var isAtReturn = !!frameDetails.isAtReturn(); 353 var isAtReturn = !!frameDetails.isAtReturn();
354 var cachedFramePointerHigh = frameDetails.framePointerHigh();
355 var cachedFramePointerLow = frameDetails.framePointerLow();
354 var returnValue = isAtReturn ? frameDetails.returnValue() : undefined; 356 var returnValue = isAtReturn ? frameDetails.returnValue() : undefined;
355 357
356 var scopeMirrors = (scopeDetailsLevel === DebuggerScript.ScopeInfoDetails.No Scopes ? [] : frameMirror.allScopes(scopeDetailsLevel === DebuggerScript.ScopeIn foDetails.FastAsyncScopes)); 358 var scopeMirrors = (scopeDetailsLevel === DebuggerScript.ScopeInfoDetails.No Scopes ? [] : frameMirror.allScopes(scopeDetailsLevel === DebuggerScript.ScopeIn foDetails.FastAsyncScopes));
357 var scopeTypes = new Array(scopeMirrors.length); 359 var scopeTypes = new Array(scopeMirrors.length);
358 var scopeObjects = new Array(scopeMirrors.length); 360 var scopeObjects = new Array(scopeMirrors.length);
359 for (var i = 0; i < scopeMirrors.length; ++i) { 361 for (var i = 0; i < scopeMirrors.length; ++i) {
360 var scopeDetails = scopeMirrors[i].details(); 362 var scopeDetails = scopeMirrors[i].details();
361 scopeTypes[i] = scopeDetails.type(); 363 scopeTypes[i] = scopeDetails.type();
362 scopeObjects[i] = scopeDetails.object(); 364 scopeObjects[i] = scopeDetails.object();
363 } 365 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 function sourceID() 429 function sourceID()
428 { 430 {
429 // FIXMEDART: remove caching when Dart devtools refactor CL lands. 431 // FIXMEDART: remove caching when Dart devtools refactor CL lands.
430 if (!scriptId) { 432 if (!scriptId) {
431 var script = ensureFuncMirror().script(); 433 var script = ensureFuncMirror().script();
432 scriptId = script && script.id(); 434 scriptId = script && script.id();
433 } 435 }
434 return scriptId; 436 return scriptId;
435 } 437 }
436 438
439 function framePointerHigh() {
440 return cachedFramePointerHigh;
441 }
442
443 function framePointerLow() {
444 return cachedFramePointerLow;
445 }
446
437 function functionName() 447 function functionName()
438 { 448 {
439 // FIXMEDART: remove caching when Dart devtools refactor CL lands. 449 // FIXMEDART: remove caching when Dart devtools refactor CL lands.
440 if (!functionNameCache) { 450 if (!functionNameCache) {
441 var func = ensureFuncMirror(); 451 var func = ensureFuncMirror();
442 if (!func.resolved()) 452 if (!func.resolved())
443 return undefined; 453 return undefined;
444 var displayName; 454 var displayName;
445 var valueMirror = func.property("displayName").value(); 455 var valueMirror = func.property("displayName").value();
446 if (valueMirror && valueMirror.isString()) 456 if (valueMirror && valueMirror.isString())
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 "functionName": functionName, 504 "functionName": functionName,
495 "thisObject": thisObject, 505 "thisObject": thisObject,
496 "scopeChain": lazyScopeChain, 506 "scopeChain": lazyScopeChain,
497 "scopeType": scopeTypes, 507 "scopeType": scopeTypes,
498 "evaluate": evaluate, 508 "evaluate": evaluate,
499 "caller": callerFrame, 509 "caller": callerFrame,
500 "restart": restart, 510 "restart": restart,
501 "setVariableValue": setVariableValue, 511 "setVariableValue": setVariableValue,
502 "stepInPositions": stepInPositions, 512 "stepInPositions": stepInPositions,
503 "isAtReturn": isAtReturn, 513 "isAtReturn": isAtReturn,
514 "framePointerHigh": framePointerHigh,
515 "framePointerLow": framePointerLow,
504 "returnValue": returnValue 516 "returnValue": returnValue
505 }; 517 };
506 } 518 }
507 519
508 DebuggerScript._buildScopeObject = function(scopeType, scopeObject) 520 DebuggerScript._buildScopeObject = function(scopeType, scopeObject)
509 { 521 {
510 var result; 522 var result;
511 switch (scopeType) { 523 switch (scopeType) {
512 case ScopeType.Local: 524 case ScopeType.Local:
513 case ScopeType.Closure: 525 case ScopeType.Closure:
(...skipping 20 matching lines...) Expand all
534 break; 546 break;
535 } 547 }
536 return result; 548 return result;
537 } 549 }
538 550
539 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it. 551 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it.
540 ToggleMirrorCache(false); 552 ToggleMirrorCache(false);
541 553
542 return DebuggerScript; 554 return DebuggerScript;
543 })(); 555 })();
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartScriptDebugServer.cpp ('k') | Source/bindings/v8/ScriptDebugServer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698