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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10265027: Move all the builtin$ interceptors to a new interceptors library and shorten the names of them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 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
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 594d87f01d11369b51865f0150cbb9742f062518..5e476da679906e6cb3001e57851b5ebfbfecdf7d 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -44,18 +44,27 @@ class Interceptors {
}
Element getStaticInterceptor(SourceString name, int parameters) {
- String mangledName = "builtin\$${name.slowToString()}\$${parameters}";
- return compiler.findHelper(new SourceString(mangledName));
+ String mangledName = name.slowToString();
+ Element element = compiler.findInterceptor(new SourceString(mangledName));
+ if (element !== null && element.isFunction()) {
+ // Only pick the function element with the short name if the
+ // number of parameters it expects matches the number we're
+ // passing modulo the receiver.
+ FunctionElement function = element;
+ if (function.parameterCount(compiler) == parameters + 1) return element;
+ }
+ String longMangledName = "$mangledName\$$parameters";
+ return compiler.findInterceptor(new SourceString(longMangledName));
}
Element getStaticGetInterceptor(SourceString name) {
- String mangledName = "builtin\$get\$${name.slowToString()}";
- return compiler.findHelper(new SourceString(mangledName));
+ String mangledName = "get\$${name.slowToString()}";
+ return compiler.findInterceptor(new SourceString(mangledName));
}
Element getStaticSetInterceptor(SourceString name) {
- String mangledName = "builtin\$set\$${name.slowToString()}";
- return compiler.findHelper(new SourceString(mangledName));
+ String mangledName = "set\$${name.slowToString()}";
+ return compiler.findInterceptor(new SourceString(mangledName));
}
Element getOperatorInterceptor(Operator op) {
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698