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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart

Issue 961653002: Simplify index computation in reflectionDataParser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 // TODO(ahe): Share these with js_helper.dart. 7 // TODO(ahe): Share these with js_helper.dart.
8 const FUNCTION_INDEX = 0; 8 const FUNCTION_INDEX = 0;
9 const NAME_INDEX = 1; 9 const NAME_INDEX = 1;
10 const CALL_NAME_INDEX = 2; 10 const CALL_NAME_INDEX = 2;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 for (; index < array.length; index += 2) { 202 for (; index < array.length; index += 2) {
203 f = array[index + 1]; 203 f = array[index + 1];
204 if (typeof f != "function") break; 204 if (typeof f != "function") break;
205 f.\$stubName = ${readString("array", "index + 2")}; 205 f.\$stubName = ${readString("array", "index + 2")};
206 funcs.push(f); 206 funcs.push(f);
207 if (f.\$stubName) { 207 if (f.\$stubName) {
208 originalDescriptor[f.\$stubName] = descriptor[f.\$stubName] = f; 208 originalDescriptor[f.\$stubName] = descriptor[f.\$stubName] = f;
209 functions.push(f.\$stubName); 209 functions.push(f.\$stubName);
210 } 210 }
211 } 211 }
212 index++;
212 for (var i = 0; i < funcs.length; index++, i++) { 213 for (var i = 0; i < funcs.length; index++, i++) {
213 funcs[i].\$callName = ${readString("array", "index + 1")}; 214 funcs[i].\$callName = ${readString("array", "index")};
214 } 215 }
215 var getterStubName = ${readString("array", "++index")}; 216 var getterStubName = ${readString("array", "index")};
216 array = array.slice(++index); 217 array = array.slice(++index);
217 var requiredParameterInfo = ${readInt("array", "0")}; 218 var requiredParameterInfo = ${readInt("array", "0")};
218 var requiredParameterCount = requiredParameterInfo >> 1; 219 var requiredParameterCount = requiredParameterInfo >> 1;
219 var isAccessor = (requiredParameterInfo & 1) === 1; 220 var isAccessor = (requiredParameterInfo & 1) === 1;
220 var isSetter = requiredParameterInfo === 3; 221 var isSetter = requiredParameterInfo === 3;
221 var isGetter = requiredParameterInfo === 1; 222 var isGetter = requiredParameterInfo === 1;
222 var optionalParameterInfo = ${readInt("array", "1")}; 223 var optionalParameterInfo = ${readInt("array", "1")};
223 var optionalParameterCount = optionalParameterInfo >> 1; 224 var optionalParameterCount = optionalParameterInfo >> 1;
224 var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1; 225 var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1;
225 var isIntercepted = 226 var isIntercepted =
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 (function() { 485 (function() {
485 var result = $array[$index]; 486 var result = $array[$index];
486 if ($check) { 487 if ($check) {
487 throw new Error( 488 throw new Error(
488 name + ": expected value of type \'$type\' at index " + ($index) + 489 name + ": expected value of type \'$type\' at index " + ($index) +
489 " but got " + (typeof result)); 490 " but got " + (typeof result));
490 } 491 }
491 return result; 492 return result;
492 })()'''; 493 })()''';
493 } 494 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698