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

Side by Side Diff: src/mirror-debugger.js

Issue 142813003: A64: Synchronize with r15358. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | « src/mips/stub-cache-mips.cc ('k') | src/objects.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 // Copyright 2006-2012 the V8 project authors. All rights reserved. 1 // Copyright 2006-2012 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 return this.details_[return_value_offset]; 1502 return this.details_[return_value_offset];
1503 } 1503 }
1504 }; 1504 };
1505 1505
1506 1506
1507 FrameDetails.prototype.scopeCount = function() { 1507 FrameDetails.prototype.scopeCount = function() {
1508 return %GetScopeCount(this.break_id_, this.frameId()); 1508 return %GetScopeCount(this.break_id_, this.frameId());
1509 }; 1509 };
1510 1510
1511 1511
1512 FrameDetails.prototype.stepInPositionsImpl = function() {
1513 return %GetStepInPositions(this.break_id_, this.frameId());
1514 };
1515
1516
1512 /** 1517 /**
1513 * Mirror object for stack frames. 1518 * Mirror object for stack frames.
1514 * @param {number} break_id The break id in the VM for which this frame is 1519 * @param {number} break_id The break id in the VM for which this frame is
1515 valid 1520 valid
1516 * @param {number} index The frame index (top frame is index 0) 1521 * @param {number} index The frame index (top frame is index 0)
1517 * @constructor 1522 * @constructor
1518 * @extends Mirror 1523 * @extends Mirror
1519 */ 1524 */
1520 function FrameMirror(break_id, index) { 1525 function FrameMirror(break_id, index) {
1521 %_CallFunction(this, FRAME_TYPE, Mirror); 1526 %_CallFunction(this, FRAME_TYPE, Mirror);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 FrameMirror.prototype.scopeCount = function() { 1667 FrameMirror.prototype.scopeCount = function() {
1663 return this.details_.scopeCount(); 1668 return this.details_.scopeCount();
1664 }; 1669 };
1665 1670
1666 1671
1667 FrameMirror.prototype.scope = function(index) { 1672 FrameMirror.prototype.scope = function(index) {
1668 return new ScopeMirror(this, void 0, index); 1673 return new ScopeMirror(this, void 0, index);
1669 }; 1674 };
1670 1675
1671 1676
1677 FrameMirror.prototype.stepInPositions = function() {
1678 var script = this.func().script();
1679 var funcOffset = this.func().sourcePosition_();
1680
1681 var stepInRaw = this.details_.stepInPositionsImpl();
1682 var result = [];
1683 if (stepInRaw) {
1684 for (var i = 0; i < stepInRaw.length; i++) {
1685 var posStruct = {};
1686 var offset = script.locationFromPosition(funcOffset + stepInRaw[i],
1687 true);
1688 serializeLocationFields(offset, posStruct);
1689 var item = {
1690 position: posStruct
1691 };
1692 result.push(item);
1693 }
1694 }
1695
1696 return result;
1697 };
1698
1699
1672 FrameMirror.prototype.evaluate = function(source, disable_break, 1700 FrameMirror.prototype.evaluate = function(source, disable_break,
1673 opt_context_object) { 1701 opt_context_object) {
1674 var result = %DebugEvaluate(this.break_id_, 1702 var result_array = %DebugEvaluate(this.break_id_,
1675 this.details_.frameId(), 1703 this.details_.frameId(),
1676 this.details_.inlinedFrameIndex(), 1704 this.details_.inlinedFrameIndex(),
1677 source, 1705 source,
1678 Boolean(disable_break), 1706 Boolean(disable_break),
1679 opt_context_object); 1707 opt_context_object);
1680 return MakeMirror(result); 1708 // Silently ignore local variables changes if the frame is optimized.
1709 if (!this.isOptimizedFrame()) {
1710 var local_scope_on_stack = result_array[1];
1711 var local_scope_modifed = result_array[2];
1712 for (var n in local_scope_modifed) {
1713 var value_on_stack = local_scope_on_stack[n];
1714 var value_modifed = local_scope_modifed[n];
1715 if (value_on_stack !== value_modifed) {
1716 %SetScopeVariableValue(this.break_id_,
1717 this.details_.frameId(),
1718 this.details_.inlinedFrameIndex(),
1719 0,
1720 n,
1721 value_modifed);
1722 }
1723 }
1724 }
1725 return MakeMirror(result_array[0]);
1681 }; 1726 };
1682 1727
1683 1728
1684 FrameMirror.prototype.invocationText = function() { 1729 FrameMirror.prototype.invocationText = function() {
1685 // Format frame invoaction (receiver, function and arguments). 1730 // Format frame invoaction (receiver, function and arguments).
1686 var result = ''; 1731 var result = '';
1687 var func = this.func(); 1732 var func = this.func();
1688 var receiver = this.receiver(); 1733 var receiver = this.receiver();
1689 if (this.isConstructCall()) { 1734 if (this.isConstructCall()) {
1690 // For constructor frames display new followed by the function name. 1735 // For constructor frames display new followed by the function name.
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 } 2662 }
2618 if (!NUMBER_IS_FINITE(value)) { 2663 if (!NUMBER_IS_FINITE(value)) {
2619 if (value > 0) { 2664 if (value > 0) {
2620 return 'Infinity'; 2665 return 'Infinity';
2621 } else { 2666 } else {
2622 return '-Infinity'; 2667 return '-Infinity';
2623 } 2668 }
2624 } 2669 }
2625 return value; 2670 return value;
2626 } 2671 }
OLDNEW
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698