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

Unified Diff: lib/runtime/dart/_js_helper.js

Issue 1055923002: Don't call dinvoke on Object methods (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: modify test 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 side-by-side diff with in-line comments
Download patch
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index 397e5efc03f7a161a550353f8dfee25ace314d2e..93881885c44f94b8eefdb4aad65fa5f529b6ca31 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -964,7 +964,7 @@ var _js_helper;
return getConstructorName(type);
} else if (typeof type == 'number') {
if (onTypeVariable == null) {
- return dart.as(dart.dinvoke(type, 'toString'), core.String);
+ return dart.as(type.toString(), core.String);
} else {
return onTypeVariable(dart.as(type, core.int));
}
@@ -1368,7 +1368,7 @@ var _js_helper;
} else if (value == null) {
return 'null';
}
- let res = dart.dinvoke(value, 'toString');
+ let res = value.toString();
if (!(typeof res == 'string'))
throw new core.ArgumentError(value);
return dart.as(res, core.String);
@@ -2197,7 +2197,7 @@ var _js_helper;
}
// Function toStringWrapper: () → dynamic
function toStringWrapper() {
- return dart.dinvoke(this.dartException, 'toString');
+ return this.dartException.toString();
}
// Function throwExpression: (dynamic) → dynamic
function throwExpression(ex) {
@@ -2524,7 +2524,7 @@ var _js_helper;
// Function objectHashCode: (dynamic) → int
function objectHashCode(object) {
if (dart.notNull(object == null) || typeof object != 'object') {
- return dart.as(dart.dload(object, 'hashCode'), core.int);
+ return dart.as(object.hashCode, core.int);
} else {
return Primitives.objectHashCode(object);
}
@@ -2847,7 +2847,7 @@ var _js_helper;
if (this[_receiver] == null) {
receiverHashCode = Primitives.objectHashCode(this[_self]);
} else if (typeof this[_receiver] != 'object') {
- receiverHashCode = dart.as(dart.dload(this[_receiver], 'hashCode'), core.int);
+ receiverHashCode = dart.as(this[_receiver].hashCode, core.int);
} else {
receiverHashCode = Primitives.objectHashCode(this[_receiver]);
}

Powered by Google App Engine
This is Rietveld 408576698