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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 946023004: Inline special case of inheritFrom to call site. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index bbce58a28536a7dc6a33645df781061ec2993511..9d5be9da87f9d2fcd7221bb7c1c31535c25d9b32 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -424,13 +424,6 @@ class OldEmitter implements Emitter {
function() {
function tmp() {}
return function (constructor, superConstructor) {
- if (superConstructor == null) {
- // Fix up the the Dart Object class' prototype.
- var prototype = constructor.prototype;
- prototype.constructor = constructor;
- prototype.#isObject = constructor;
- return prototype;
- }
tmp.prototype = superConstructor.prototype;
var object = new tmp();
var properties = constructor.prototype;
@@ -447,8 +440,7 @@ class OldEmitter implements Emitter {
return object;
};
}()
- """, { 'operatorIsPrefix' : js.string(namer.operatorIsPrefix),
- 'isObject' : namer.operatorIs(compiler.objectClass) });
+ """, { 'operatorIsPrefix' : js.string(namer.operatorIsPrefix)});
if (compiler.hasIncrementalSupport) {
result = js(
r'#.inheritFrom = #', [namer.accessIncrementalHelper, result]);
@@ -512,7 +504,12 @@ class OldEmitter implements Emitter {
// the Object.prototype object, and they show through here, so we check
// that we have a string.
if (!superclass || typeof superclass != "string") {
- inheritFrom(allClasses[cls], null);
+ // Inlined special case of InheritFrom here for performance reasons.
+ // Fix up the the Dart Object class' prototype.
+ var constructor = allClasses[cls];
+ var prototype = constructor.prototype;
+ prototype.constructor = constructor;
+ prototype.#isObject = constructor;
return;
}
finishClass(superclass);
@@ -531,7 +528,8 @@ class OldEmitter implements Emitter {
}''', {'finishedClassesAccess': finishedClassesAccess,
'needsMixinSupport': needsMixinSupport,
'hasNativeClasses': hasNativeClasses,
- 'nativeInfoHandler': nativeInfoHandler});
+ 'nativeInfoHandler': nativeInfoHandler,
+ 'isObject' : namer.operatorIs(compiler.objectClass) });
}
void emitFinishIsolateConstructorInvocation(CodeOutput output) {
« 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