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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/nsm_emitter.dart

Issue 1062913003: Extract CallStructure from Selector. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class NsmEmitter extends CodeEmitterHelper { 7 class NsmEmitter extends CodeEmitterHelper {
8 final List<Selector> trivialNsmHandlers = <Selector>[]; 8 final List<Selector> trivialNsmHandlers = <Selector>[];
9 9
10 /// If this is true then we can generate the noSuchMethod handlers at startup 10 /// If this is true then we can generate the noSuchMethod handlers at startup
(...skipping 24 matching lines...) Expand all
35 (addedJsNames.length < VERY_FEW_NO_SUCH_METHOD_HANDLERS); 35 (addedJsNames.length < VERY_FEW_NO_SUCH_METHOD_HANDLERS);
36 for (String jsName in addedJsNames.keys.toList()..sort()) { 36 for (String jsName in addedJsNames.keys.toList()..sort()) {
37 Selector selector = addedJsNames[jsName]; 37 Selector selector = addedJsNames[jsName];
38 String reflectionName = emitter.getReflectionName(selector, jsName); 38 String reflectionName = emitter.getReflectionName(selector, jsName);
39 39
40 if (reflectionName != null) { 40 if (reflectionName != null) {
41 emitter.mangledFieldNames[jsName] = reflectionName; 41 emitter.mangledFieldNames[jsName] = reflectionName;
42 } 42 }
43 43
44 List<jsAst.Expression> argNames = 44 List<jsAst.Expression> argNames =
45 selector.getOrderedNamedArguments().map((String name) => 45 selector.callStructure.getOrderedNamedArguments().map((String name) =>
46 js.string(name)).toList(); 46 js.string(name)).toList();
47 int type = selector.invocationMirrorKind; 47 int type = selector.invocationMirrorKind;
48 if (!haveVeryFewNoSuchMemberHandlers && 48 if (!haveVeryFewNoSuchMemberHandlers &&
49 isTrivialNsmHandler(type, argNames, selector, jsName) && 49 isTrivialNsmHandler(type, argNames, selector, jsName) &&
50 reflectionName == null) { 50 reflectionName == null) {
51 trivialNsmHandlers.add(selector); 51 trivialNsmHandlers.add(selector);
52 } else { 52 } else {
53 StubMethod method = 53 StubMethod method =
54 generator.generateStubForNoSuchMethod(jsName, selector); 54 generator.generateStubForNoSuchMethod(jsName, selector);
55 addProperty(method.name, method.code); 55 addProperty(method.name, method.code);
56 if (reflectionName != null) { 56 if (reflectionName != null) {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 }''', { 318 }''', {
319 'sliceOffsetParams': sliceOffsetParams, 319 'sliceOffsetParams': sliceOffsetParams,
320 'noSuchMethodName': namer.noSuchMethodName, 320 'noSuchMethodName': namer.noSuchMethodName,
321 'createInvocationMirror': createInvocationMirror, 321 'createInvocationMirror': createInvocationMirror,
322 'names': minify ? 'shortNames' : 'longNames', 322 'names': minify ? 'shortNames' : 'longNames',
323 'sliceOffsetArguments': sliceOffsetArguments})); 323 'sliceOffsetArguments': sliceOffsetArguments}));
324 324
325 return statements; 325 return statements;
326 } 326 }
327 } 327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698