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

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

Issue 1182053010: Revert "Split TypedSelector into Selector and TypeMask." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) {
57 bool accessible = 57 bool accessible = compiler.world.allFunctions.filter(selector).any(
58 compiler.world.allFunctions.filter(selector, null).any(
59 (Element e) => backend.isAccessibleByReflection(e)); 58 (Element e) => backend.isAccessibleByReflection(e));
60 addProperty('+$reflectionName', js(accessible ? '2' : '0')); 59 addProperty('+$reflectionName', js(accessible ? '2' : '0'));
61 } 60 }
62 } 61 }
63 } 62 }
64 } 63 }
65 64
66 // Identify the noSuchMethod handlers that are so simple that we can 65 // Identify the noSuchMethod handlers that are so simple that we can
67 // generate them programatically. 66 // generate them programatically.
68 bool isTrivialNsmHandler( 67 bool isTrivialNsmHandler(
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 }''', { 316 }''', {
318 'sliceOffsetParams': sliceOffsetParams, 317 'sliceOffsetParams': sliceOffsetParams,
319 'noSuchMethodName': namer.noSuchMethodName, 318 'noSuchMethodName': namer.noSuchMethodName,
320 'createInvocationMirror': createInvocationMirror, 319 'createInvocationMirror': createInvocationMirror,
321 'names': minify ? 'shortNames' : 'longNames', 320 'names': minify ? 'shortNames' : 'longNames',
322 'sliceOffsetArguments': sliceOffsetArguments})); 321 'sliceOffsetArguments': sliceOffsetArguments}));
323 322
324 return statements; 323 return statements;
325 } 324 }
326 } 325 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/js_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698