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

Side by Side Diff: lib/compiler/implementation/native_handler.dart

Issue 10100001: Refactoring if block-information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | lib/compiler/implementation/ssa/builder.dart » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #library('native'); 5 #library('native');
6 #import('dart:uri'); 6 #import('dart:uri');
7 #import('leg.dart'); 7 #import('leg.dart');
8 #import('elements/elements.dart'); 8 #import('elements/elements.dart');
9 #import('scanner/scannerlib.dart'); 9 #import('scanner/scannerlib.dart');
10 #import('ssa/ssa.dart'); 10 #import('ssa/ssa.dart');
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 // If a method is overridden, we must check if the prototype of 327 // If a method is overridden, we must check if the prototype of
328 // 'this' has the method available. Otherwise, we may end up 328 // 'this' has the method available. Otherwise, we may end up
329 // calling the method from the super class. If the method is not 329 // calling the method from the super class. If the method is not
330 // available, we make a direct call to Object.prototype.$methodName. 330 // available, we make a direct call to Object.prototype.$methodName.
331 // This method will patch the prototype of 'this' to the real method. 331 // This method will patch the prototype of 'this' to the real method.
332 void generateMethodWithPrototypeCheck(Compiler compiler, 332 void generateMethodWithPrototypeCheck(Compiler compiler,
333 StringBuffer buffer, 333 StringBuffer buffer,
334 String methodName, 334 String methodName,
335 String code, 335 String code,
336 String parameters) { 336 String parameters) {
337 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 337 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
338 buffer.add("('$methodName')) {\n"); 338 buffer.add("('$methodName')) {\n");
339 buffer.add(" $code"); 339 buffer.add(" $code");
340 buffer.add(" } else {\n"); 340 buffer.add(" } else {\n");
341 buffer.add(" return Object.prototype.$methodName.call(this"); 341 buffer.add(" return Object.prototype.$methodName.call(this");
342 buffer.add(parameters == '' ? '' : ', $parameters'); 342 buffer.add(parameters == '' ? '' : ', $parameters');
343 buffer.add(");\n"); 343 buffer.add(");\n");
344 buffer.add(" }\n"); 344 buffer.add(" }\n");
345 } 345 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698