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

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: Refactor dynamic target logic Created 5 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 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 9936fce10d9a5a35f63d6e04a4cfc034df52a457..1f3ec5d4ed4f87c0f93bc628c086e0e16a296e92 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 a.hashCode;
}
let _Equality$ = dart.generic(function(K) {
class _Equality extends core.Function {}
@@ -3569,7 +3569,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];
@@ -3977,7 +3977,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];
@@ -4353,7 +4353,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];
@@ -4725,7 +4725,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