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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 11453032: Reapply class/method/field minification (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback Created 8 years 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
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 part of js_backend; 5 part of js_backend;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 8
9 CodeEmitterTask emitter; 9 CodeEmitterTask emitter;
10 CodeBuffer nativeBuffer; 10 CodeBuffer nativeBuffer;
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 emitIsChecks(objectProperties); 533 emitIsChecks(objectProperties);
534 534
535 // In order to have the toString method on every native class, 535 // In order to have the toString method on every native class,
536 // we must patch the JS Object prototype with a helper method. 536 // we must patch the JS Object prototype with a helper method.
537 String toStringName = backend.namer.publicInstanceMethodNameByArity( 537 String toStringName = backend.namer.publicInstanceMethodNameByArity(
538 const SourceString('toString'), 0); 538 const SourceString('toString'), 0);
539 objectProperties[toStringName] = 539 objectProperties[toStringName] =
540 'function() { return $toStringHelperName(this); }'; 540 'function() { return $toStringHelperName(this); }';
541 541
542 // Same as above, but for hashCode. 542 // Same as above, but for hashCode.
543 String hashCodeName = backend.namer.publicGetterName( 543 String hashCodeName =
544 const SourceString('hashCode')); 544 backend.namer.publicGetterName(const SourceString('hashCode'));
545 objectProperties[hashCodeName] = 545 objectProperties[hashCodeName] =
546 'function() { return $hashCodeHelperName(this); }'; 546 'function() { return $hashCodeHelperName(this); }';
547 547
548 // If the native emitter has been asked to take care of the 548 // If the native emitter has been asked to take care of the
549 // noSuchMethod handlers, we do that now. 549 // noSuchMethod handlers, we do that now.
550 if (handleNoSuchMethod) { 550 if (handleNoSuchMethod) {
551 emitter.emitNoSuchMethodHandlers((String name, CodeBuffer buffer) { 551 emitter.emitNoSuchMethodHandlers((String name, CodeBuffer buffer) {
552 objectProperties[name] = buffer.toString(); 552 objectProperties[name] = buffer.toString();
553 }); 553 });
554 } 554 }
(...skipping 11 matching lines...) Expand all
566 if (!first) targetBuffer.add(",\n"); 566 if (!first) targetBuffer.add(",\n");
567 targetBuffer.add(" $name: $function"); 567 targetBuffer.add(" $name: $function");
568 first = false; 568 first = false;
569 }); 569 });
570 targetBuffer.add("\n});\n\n"); 570 targetBuffer.add("\n});\n\n");
571 } 571 }
572 targetBuffer.add(nativeBuffer); 572 targetBuffer.add(nativeBuffer);
573 targetBuffer.add('\n'); 573 targetBuffer.add('\n');
574 } 574 }
575 } 575 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698