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

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

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