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

Unified Diff: lib/runtime/dart/collection.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/collection.js
diff --git a/lib/runtime/dart/collection.js b/lib/runtime/dart/collection.js
index f9be7a825730c28c345d57acd0ecf15deba43e7b..e51de150e9f9517015f3294f6f02157b32c5524e 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -24,7 +24,7 @@ var collection;
}
// Function _defaultHashCode: (dynamic) → int
function _defaultHashCode(a) {
- return dart.as(dart.dload(a, 'hashCode'), core.int);
+ return dart.as(a.hashCode, core.int);
}
let HashMap$ = dart.generic(function(K, V) {
class HashMap extends core.Object {
@@ -3557,7 +3557,7 @@ var collection;
return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key;
}
[_computeHashCode](key) {
- return dart.dload(key, 'hashCode') & 0x3ffffff;
+ return key.hashCode & 0x3ffffff;
}
static [_hasTableEntry](table, key) {
let entry = table[key];
@@ -3965,7 +3965,7 @@ var collection;
return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key;
}
[_computeHashCode](key) {
- return dart.dload(key, 'hashCode') & 0x3ffffff;
+ return key.hashCode & 0x3ffffff;
}
static [_getTableEntry](table, key) {
return table[key];
@@ -4341,7 +4341,7 @@ var collection;
return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
}
[_computeHashCode](element) {
- return dart.dload(element, 'hashCode') & 0x3ffffff;
+ return element.hashCode & 0x3ffffff;
}
static [_hasTableEntry](table, key) {
let entry = table[key];
@@ -4713,7 +4713,7 @@ var collection;
return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
}
[_computeHashCode](element) {
- return dart.dload(element, 'hashCode') & 0x3ffffff;
+ return element.hashCode & 0x3ffffff;
}
static [_getTableEntry](table, key) {
return table[key];

Powered by Google App Engine
This is Rietveld 408576698