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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10273026: Revert "Move all the builtin$ interceptors to a new interceptors library and shorten the names of t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 26 matching lines...) Expand all
37 if (name === '>>=') return const SourceString('shr'); 37 if (name === '>>=') return const SourceString('shr');
38 if (name === '|=') return const SourceString('or'); 38 if (name === '|=') return const SourceString('or');
39 if (name === '&=') return const SourceString('and'); 39 if (name === '&=') return const SourceString('and');
40 if (name === '^=') return const SourceString('xor'); 40 if (name === '^=') return const SourceString('xor');
41 if (name === '++') return const SourceString('add'); 41 if (name === '++') return const SourceString('add');
42 if (name === '--') return const SourceString('sub'); 42 if (name === '--') return const SourceString('sub');
43 compiler.unimplemented('Unknown operator', node: op); 43 compiler.unimplemented('Unknown operator', node: op);
44 } 44 }
45 45
46 Element getStaticInterceptor(SourceString name, int parameters) { 46 Element getStaticInterceptor(SourceString name, int parameters) {
47 String mangledName = name.slowToString(); 47 String mangledName = "builtin\$${name.slowToString()}\$${parameters}";
48 Element element = compiler.findInterceptor(new SourceString(mangledName)); 48 return compiler.findHelper(new SourceString(mangledName));
49 if (element !== null && element.isFunction()) {
50 // Only pick the function element with the short name if the
51 // number of parameters it expects matches the number we're
52 // passing modulo the receiver.
53 FunctionElement function = element;
54 if (function.parameterCount(compiler) == parameters + 1) return element;
55 }
56 String longMangledName = "$mangledName\$$parameters";
57 return compiler.findInterceptor(new SourceString(longMangledName));
58 } 49 }
59 50
60 Element getStaticGetInterceptor(SourceString name) { 51 Element getStaticGetInterceptor(SourceString name) {
61 String mangledName = "get\$${name.slowToString()}"; 52 String mangledName = "builtin\$get\$${name.slowToString()}";
62 return compiler.findInterceptor(new SourceString(mangledName)); 53 return compiler.findHelper(new SourceString(mangledName));
63 } 54 }
64 55
65 Element getStaticSetInterceptor(SourceString name) { 56 Element getStaticSetInterceptor(SourceString name) {
66 String mangledName = "set\$${name.slowToString()}"; 57 String mangledName = "builtin\$set\$${name.slowToString()}";
67 return compiler.findInterceptor(new SourceString(mangledName)); 58 return compiler.findHelper(new SourceString(mangledName));
68 } 59 }
69 60
70 Element getOperatorInterceptor(Operator op) { 61 Element getOperatorInterceptor(Operator op) {
71 SourceString name = mapOperatorToMethodName(op); 62 SourceString name = mapOperatorToMethodName(op);
72 return compiler.findHelper(name); 63 return compiler.findHelper(name);
73 } 64 }
74 65
75 Element getBoolifiedVersionOf(Element interceptor) { 66 Element getBoolifiedVersionOf(Element interceptor) {
76 String boolifiedName = "${interceptor.name.slowToString()}B"; 67 String boolifiedName = "${interceptor.name.slowToString()}B";
77 return compiler.findHelper(new SourceString(boolifiedName)); 68 return compiler.findHelper(new SourceString(boolifiedName));
(...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 <HInstruction>[target, input], 3193 <HInstruction>[target, input],
3203 HType.STRING)); 3194 HType.STRING));
3204 return builder.pop(); 3195 return builder.pop();
3205 } 3196 }
3206 3197
3207 HInstruction result() { 3198 HInstruction result() {
3208 flushLiterals(); 3199 flushLiterals();
3209 return prefix; 3200 return prefix;
3210 } 3201 }
3211 } 3202 }
OLDNEW
« 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