| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 | 1236 |
| 1237 | 1237 |
| 1238 const kFrameDetailsFrameIdIndex = 0; | 1238 const kFrameDetailsFrameIdIndex = 0; |
| 1239 const kFrameDetailsReceiverIndex = 1; | 1239 const kFrameDetailsReceiverIndex = 1; |
| 1240 const kFrameDetailsFunctionIndex = 2; | 1240 const kFrameDetailsFunctionIndex = 2; |
| 1241 const kFrameDetailsArgumentCountIndex = 3; | 1241 const kFrameDetailsArgumentCountIndex = 3; |
| 1242 const kFrameDetailsLocalCountIndex = 4; | 1242 const kFrameDetailsLocalCountIndex = 4; |
| 1243 const kFrameDetailsSourcePositionIndex = 5; | 1243 const kFrameDetailsSourcePositionIndex = 5; |
| 1244 const kFrameDetailsConstructCallIndex = 6; | 1244 const kFrameDetailsConstructCallIndex = 6; |
| 1245 const kFrameDetailsAtReturnIndex = 7; | 1245 const kFrameDetailsAtReturnIndex = 7; |
| 1246 const kFrameDetailsDebuggerFrameIndex = 8; | 1246 const kFrameDetailsFlagsIndex = 8; |
| 1247 const kFrameDetailsFirstDynamicIndex = 9; | 1247 const kFrameDetailsFirstDynamicIndex = 9; |
| 1248 | 1248 |
| 1249 const kFrameDetailsNameIndex = 0; | 1249 const kFrameDetailsNameIndex = 0; |
| 1250 const kFrameDetailsValueIndex = 1; | 1250 const kFrameDetailsValueIndex = 1; |
| 1251 const kFrameDetailsNameValueSize = 2; | 1251 const kFrameDetailsNameValueSize = 2; |
| 1252 | 1252 |
| 1253 const kFrameDetailsFlagDebuggerFrame = 1; |
| 1254 const kFrameDetailsFlagOptimizedFrame = 2; |
| 1255 const kFrameDetailsFlagInlinedFrame = 4; |
| 1256 |
| 1253 /** | 1257 /** |
| 1254 * Wrapper for the frame details information retreived from the VM. The frame | 1258 * Wrapper for the frame details information retreived from the VM. The frame |
| 1255 * details from the VM is an array with the following content. See runtime.cc | 1259 * details from the VM is an array with the following content. See runtime.cc |
| 1256 * Runtime_GetFrameDetails. | 1260 * Runtime_GetFrameDetails. |
| 1257 * 0: Id | 1261 * 0: Id |
| 1258 * 1: Receiver | 1262 * 1: Receiver |
| 1259 * 2: Function | 1263 * 2: Function |
| 1260 * 3: Argument count | 1264 * 3: Argument count |
| 1261 * 4: Local count | 1265 * 4: Local count |
| 1262 * 5: Source position | 1266 * 5: Source position |
| 1263 * 6: Construct call | 1267 * 6: Construct call |
| 1264 * 7: Is at return | 1268 * 7: Is at return |
| 1265 * 8: Debugger frame | 1269 * 8: Flags (debugger frame, optimized frame, inlined frame) |
| 1266 * Arguments name, value | 1270 * Arguments name, value |
| 1267 * Locals name, value | 1271 * Locals name, value |
| 1268 * Return value if any | 1272 * Return value if any |
| 1269 * @param {number} break_id Current break id | 1273 * @param {number} break_id Current break id |
| 1270 * @param {number} index Frame number | 1274 * @param {number} index Frame number |
| 1271 * @constructor | 1275 * @constructor |
| 1272 */ | 1276 */ |
| 1273 function FrameDetails(break_id, index) { | 1277 function FrameDetails(break_id, index) { |
| 1274 this.break_id_ = break_id; | 1278 this.break_id_ = break_id; |
| 1275 this.details_ = %GetFrameDetails(break_id, index); | 1279 this.details_ = %GetFrameDetails(break_id, index); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1301 | 1305 |
| 1302 | 1306 |
| 1303 FrameDetails.prototype.isAtReturn = function() { | 1307 FrameDetails.prototype.isAtReturn = function() { |
| 1304 %CheckExecutionState(this.break_id_); | 1308 %CheckExecutionState(this.break_id_); |
| 1305 return this.details_[kFrameDetailsAtReturnIndex]; | 1309 return this.details_[kFrameDetailsAtReturnIndex]; |
| 1306 } | 1310 } |
| 1307 | 1311 |
| 1308 | 1312 |
| 1309 FrameDetails.prototype.isDebuggerFrame = function() { | 1313 FrameDetails.prototype.isDebuggerFrame = function() { |
| 1310 %CheckExecutionState(this.break_id_); | 1314 %CheckExecutionState(this.break_id_); |
| 1311 return this.details_[kFrameDetailsDebuggerFrameIndex]; | 1315 var f = kFrameDetailsFlagDebuggerFrame; |
| 1316 return (this.details_[kFrameDetailsFlagsIndex] & f) == f; |
| 1312 } | 1317 } |
| 1313 | 1318 |
| 1314 | 1319 |
| 1320 FrameDetails.prototype.isOptimizedFrame = function() { |
| 1321 %CheckExecutionState(this.break_id_); |
| 1322 var f = kFrameDetailsFlagOptimizedFrame; |
| 1323 return (this.details_[kFrameDetailsFlagsIndex] & f) == f; |
| 1324 } |
| 1325 |
| 1326 |
| 1327 FrameDetails.prototype.isInlinedFrame = function() { |
| 1328 %CheckExecutionState(this.break_id_); |
| 1329 var f = kFrameDetailsFlagInlinedFrame; |
| 1330 return (this.details_[kFrameDetailsFlagsIndex] & f) == f; |
| 1331 } |
| 1332 |
| 1333 |
| 1315 FrameDetails.prototype.argumentCount = function() { | 1334 FrameDetails.prototype.argumentCount = function() { |
| 1316 %CheckExecutionState(this.break_id_); | 1335 %CheckExecutionState(this.break_id_); |
| 1317 return this.details_[kFrameDetailsArgumentCountIndex]; | 1336 return this.details_[kFrameDetailsArgumentCountIndex]; |
| 1318 } | 1337 } |
| 1319 | 1338 |
| 1320 | 1339 |
| 1321 FrameDetails.prototype.argumentName = function(index) { | 1340 FrameDetails.prototype.argumentName = function(index) { |
| 1322 %CheckExecutionState(this.break_id_); | 1341 %CheckExecutionState(this.break_id_); |
| 1323 if (index >= 0 && index < this.argumentCount()) { | 1342 if (index >= 0 && index < this.argumentCount()) { |
| 1324 return this.details_[kFrameDetailsFirstDynamicIndex + | 1343 return this.details_[kFrameDetailsFirstDynamicIndex + |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 FrameMirror.prototype.isAtReturn = function() { | 1459 FrameMirror.prototype.isAtReturn = function() { |
| 1441 return this.details_.isAtReturn(); | 1460 return this.details_.isAtReturn(); |
| 1442 }; | 1461 }; |
| 1443 | 1462 |
| 1444 | 1463 |
| 1445 FrameMirror.prototype.isDebuggerFrame = function() { | 1464 FrameMirror.prototype.isDebuggerFrame = function() { |
| 1446 return this.details_.isDebuggerFrame(); | 1465 return this.details_.isDebuggerFrame(); |
| 1447 }; | 1466 }; |
| 1448 | 1467 |
| 1449 | 1468 |
| 1469 FrameMirror.prototype.isOptimizedFrame = function() { |
| 1470 return this.details_.isOptimizedFrame(); |
| 1471 }; |
| 1472 |
| 1473 |
| 1474 FrameMirror.prototype.isInlinedFrame = function() { |
| 1475 return this.details_.isInlinedFrame(); |
| 1476 }; |
| 1477 |
| 1478 |
| 1450 FrameMirror.prototype.argumentCount = function() { | 1479 FrameMirror.prototype.argumentCount = function() { |
| 1451 return this.details_.argumentCount(); | 1480 return this.details_.argumentCount(); |
| 1452 }; | 1481 }; |
| 1453 | 1482 |
| 1454 | 1483 |
| 1455 FrameMirror.prototype.argumentName = function(index) { | 1484 FrameMirror.prototype.argumentName = function(index) { |
| 1456 return this.details_.argumentName(index); | 1485 return this.details_.argumentName(index); |
| 1457 }; | 1486 }; |
| 1458 | 1487 |
| 1459 | 1488 |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2373 } | 2402 } |
| 2374 if (!NUMBER_IS_FINITE(value)) { | 2403 if (!NUMBER_IS_FINITE(value)) { |
| 2375 if (value > 0) { | 2404 if (value > 0) { |
| 2376 return 'Infinity'; | 2405 return 'Infinity'; |
| 2377 } else { | 2406 } else { |
| 2378 return '-Infinity'; | 2407 return '-Infinity'; |
| 2379 } | 2408 } |
| 2380 } | 2409 } |
| 2381 return value; | 2410 return value; |
| 2382 } | 2411 } |
| OLD | NEW |