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/d8.js

Issue 7778013: NewGC: Merge bleeding edge up to 9009. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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 | « src/d8.gyp ('k') | src/debug-debugger.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 Debug.ScriptCompilationType = { Host: 0, 96 Debug.ScriptCompilationType = { Host: 0,
97 Eval: 1, 97 Eval: 1,
98 JSON: 2 }; 98 JSON: 2 };
99 99
100 100
101 // The different types of scopes matching constants runtime.cc. 101 // The different types of scopes matching constants runtime.cc.
102 Debug.ScopeType = { Global: 0, 102 Debug.ScopeType = { Global: 0,
103 Local: 1, 103 Local: 1,
104 With: 2, 104 With: 2,
105 Closure: 3, 105 Closure: 3,
106 Catch: 4 }; 106 Catch: 4,
107 Block: 5 };
107 108
108 109
109 // Current debug state. 110 // Current debug state.
110 const kNoFrame = -1; 111 const kNoFrame = -1;
111 Debug.State = { 112 Debug.State = {
112 currentFrame: kNoFrame, 113 currentFrame: kNoFrame,
113 displaySourceStartLine: -1, 114 displaySourceStartLine: -1,
114 displaySourceEndLine: -1, 115 displaySourceEndLine: -1,
115 currentSourceLine: -1 116 currentSourceLine: -1
116 } 117 }
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 case 'exit': 385 case 'exit':
385 case 'quit': 386 case 'quit':
386 this.request_ = this.disconnectCommandToJSONRequest_(args); 387 this.request_ = this.disconnectCommandToJSONRequest_(args);
387 break; 388 break;
388 389
389 case 'up': 390 case 'up':
390 this.request_ = 391 this.request_ =
391 this.frameCommandToJSONRequest_('' + 392 this.frameCommandToJSONRequest_('' +
392 (Debug.State.currentFrame + 1)); 393 (Debug.State.currentFrame + 1));
393 break; 394 break;
394 395
395 case 'down': 396 case 'down':
396 case 'do': 397 case 'do':
397 this.request_ = 398 this.request_ =
398 this.frameCommandToJSONRequest_('' + 399 this.frameCommandToJSONRequest_('' +
399 (Debug.State.currentFrame - 1)); 400 (Debug.State.currentFrame - 1));
400 break; 401 break;
401 402
402 case 'set': 403 case 'set':
403 case 'print': 404 case 'print':
404 case 'p': 405 case 'p':
405 this.request_ = this.printCommandToJSONRequest_(args); 406 this.request_ = this.printCommandToJSONRequest_(args);
406 break; 407 break;
407 408
408 case 'dir': 409 case 'dir':
409 this.request_ = this.dirCommandToJSONRequest_(args); 410 this.request_ = this.dirCommandToJSONRequest_(args);
410 break; 411 break;
411 412
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 if (arg1 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { 1065 if (arg1 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') {
1065 1066
1066 var arg2 = (nextPos > 0) ? 1067 var arg2 = (nextPos > 0) ?
1067 args.substring(nextPos + 1, args.length) : 'all'; 1068 args.substring(nextPos + 1, args.length) : 'all';
1068 if (!arg2) { 1069 if (!arg2) {
1069 arg2 = 'all'; // if unspecified, set for all. 1070 arg2 = 'all'; // if unspecified, set for all.
1070 } if (arg2 == 'unc') { // check for short cut. 1071 } if (arg2 == 'unc') { // check for short cut.
1071 arg2 = 'uncaught'; 1072 arg2 = 'uncaught';
1072 } 1073 }
1073 excType = arg2; 1074 excType = arg2;
1074 1075
1075 // Check for: 1076 // Check for:
1076 // en[able] [all|unc[aught]] exc[eptions] 1077 // en[able] [all|unc[aught]] exc[eptions]
1077 // dis[able] [all|unc[aught]] exc[eptions] 1078 // dis[able] [all|unc[aught]] exc[eptions]
1078 } else if (arg1 == 'all' || arg1 == 'unc' || arg1 == 'uncaught') { 1079 } else if (arg1 == 'all' || arg1 == 'unc' || arg1 == 'uncaught') {
1079 1080
1080 var arg2 = (nextPos > 0) ? 1081 var arg2 = (nextPos > 0) ?
1081 args.substring(nextPos + 1, args.length) : null; 1082 args.substring(nextPos + 1, args.length) : null;
1082 if (arg2 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { 1083 if (arg2 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') {
1083 excType = arg1; 1084 excType = arg1;
1084 if (excType == 'unc') { 1085 if (excType == 'unc') {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 case 'enable': 1124 case 'enable':
1124 request.arguments.enabled = true; 1125 request.arguments.enabled = true;
1125 break; 1126 break;
1126 case 'disable': 1127 case 'disable':
1127 request.arguments.enabled = false; 1128 request.arguments.enabled = false;
1128 break; 1129 break;
1129 case 'ignore': 1130 case 'ignore':
1130 request.arguments.ignoreCount = parseInt(otherArgs); 1131 request.arguments.ignoreCount = parseInt(otherArgs);
1131 break; 1132 break;
1132 default: 1133 default:
1133 throw new Error('Invalid arguments.'); 1134 throw new Error('Invalid arguments.');
1134 } 1135 }
1135 } else { 1136 } else {
1136 throw new Error('Invalid arguments.'); 1137 throw new Error('Invalid arguments.');
1137 } 1138 }
1138 1139
1139 return request.toJSONProtocol(); 1140 return request.toJSONProtocol();
1140 }; 1141 };
1141 1142
1142 1143
1143 // Create a JSON request for the disconnect command. 1144 // Create a JSON request for the disconnect command.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 1245
1245 // Check for i[ndex] <i>: 1246 // Check for i[ndex] <i>:
1246 } else if (arg === 'index' || arg === 'i') { 1247 } else if (arg === 'index' || arg === 'i') {
1247 i++; 1248 i++;
1248 if (args.length < i) { 1249 if (args.length < i) {
1249 throw new Error('Missing index after ' + arg + '.'); 1250 throw new Error('Missing index after ' + arg + '.');
1250 } 1251 }
1251 start_index = parseInt(args[i]); 1252 start_index = parseInt(args[i]);
1252 // The user input start index starts at 1: 1253 // The user input start index starts at 1:
1253 if (start_index <= 0) { 1254 if (start_index <= 0) {
1254 throw new Error('Invalid index ' + args[i] + '.'); 1255 throw new Error('Invalid index ' + args[i] + '.');
1255 } 1256 }
1256 start_index -= 1; 1257 start_index -= 1;
1257 is_verbose = true; 1258 is_verbose = true;
1258 1259
1259 // Check for t[ype] <type>: 1260 // Check for t[ype] <type>:
1260 } else if (arg === 'type' || arg === 't') { 1261 } else if (arg === 'type' || arg === 't') {
1261 i++; 1262 i++;
1262 if (args.length < i) { 1263 if (args.length < i) {
1263 throw new Error('Missing type after ' + arg + '.'); 1264 throw new Error('Missing type after ' + arg + '.');
1264 } 1265 }
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2013 if (body.breakpoints.length === 0) { 2014 if (body.breakpoints.length === 0) {
2014 result = "No user defined breakpoints\n"; 2015 result = "No user defined breakpoints\n";
2015 } else { 2016 } else {
2016 result += '\n'; 2017 result += '\n';
2017 } 2018 }
2018 if (body.breakOnExceptions) { 2019 if (body.breakOnExceptions) {
2019 result += '* breaking on ALL exceptions is enabled\n'; 2020 result += '* breaking on ALL exceptions is enabled\n';
2020 } else if (body.breakOnUncaughtExceptions) { 2021 } else if (body.breakOnUncaughtExceptions) {
2021 result += '* breaking on UNCAUGHT exceptions is enabled\n'; 2022 result += '* breaking on UNCAUGHT exceptions is enabled\n';
2022 } else { 2023 } else {
2023 result += '* all exception breakpoints are disabled\n'; 2024 result += '* all exception breakpoints are disabled\n';
2024 } 2025 }
2025 details.text = result; 2026 details.text = result;
2026 break; 2027 break;
2027 2028
2028 case 'setexceptionbreak': 2029 case 'setexceptionbreak':
2029 result = 'Break on ' + body.type + ' exceptions: '; 2030 result = 'Break on ' + body.type + ' exceptions: ';
2030 result += body.enabled ? 'enabled' : 'disabled'; 2031 result += body.enabled ? 'enabled' : 'disabled';
2031 details.text = result; 2032 details.text = result;
2032 break; 2033 break;
2033 2034
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 json += NumberToJSON_(elem); 2798 json += NumberToJSON_(elem);
2798 } else if (typeof(elem) === 'string') { 2799 } else if (typeof(elem) === 'string') {
2799 json += StringToJSON_(elem); 2800 json += StringToJSON_(elem);
2800 } else { 2801 } else {
2801 json += elem; 2802 json += elem;
2802 } 2803 }
2803 } 2804 }
2804 json += ']'; 2805 json += ']';
2805 return json; 2806 return json;
2806 } 2807 }
OLDNEW
« no previous file with comments | « src/d8.gyp ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698