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

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

Issue 10041026: Reapply "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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 // If a method is overridden, we must check if the prototype of 334 // If a method is overridden, we must check if the prototype of
335 // 'this' has the method available. Otherwise, we may end up 335 // 'this' has the method available. Otherwise, we may end up
336 // calling the method from the super class. If the method is not 336 // calling the method from the super class. If the method is not
337 // available, we make a direct call to Object.prototype.$methodName. 337 // available, we make a direct call to Object.prototype.$methodName.
338 // This method will patch the prototype of 'this' to the real method. 338 // This method will patch the prototype of 'this' to the real method.
339 void generateMethodWithPrototypeCheck(Compiler compiler, 339 void generateMethodWithPrototypeCheck(Compiler compiler,
340 StringBuffer buffer, 340 StringBuffer buffer,
341 String methodName, 341 String methodName,
342 String code, 342 String code,
343 String parameters) { 343 String parameters) {
344 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 344 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
345 buffer.add("('$methodName')) {\n"); 345 buffer.add("('$methodName')) {\n");
346 buffer.add(" $code"); 346 buffer.add(" $code");
347 buffer.add(" } else {\n"); 347 buffer.add(" } else {\n");
348 buffer.add(" return Object.prototype.$methodName.call(this"); 348 buffer.add(" return Object.prototype.$methodName.call(this");
349 buffer.add(parameters == '' ? '' : ', $parameters'); 349 buffer.add(parameters == '' ? '' : ', $parameters');
350 buffer.add(");\n"); 350 buffer.add(");\n");
351 buffer.add(" }\n"); 351 buffer.add(" }\n");
352 } 352 }
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