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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/glue.dart

Issue 1144163004: dart2js cps: Always use interceptors and type tags for 'is' checks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase + status file 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library code_generator_dependencies; 5 library code_generator_dependencies;
6 6
7 import '../js_backend.dart'; 7 import '../js_backend.dart';
8 import '../../dart2jslib.dart'; 8 import '../../dart2jslib.dart';
9 import '../../js_emitter/js_emitter.dart'; 9 import '../../js_emitter/js_emitter.dart';
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 js.Expression generateTypeRepresentation(DartType dartType, 192 js.Expression generateTypeRepresentation(DartType dartType,
193 List<js.Expression> arguments) { 193 List<js.Expression> arguments) {
194 int variableIndex = 0; 194 int variableIndex = 0;
195 js.Expression representation = _backend.rti.getTypeRepresentation( 195 js.Expression representation = _backend.rti.getTypeRepresentation(
196 dartType, 196 dartType,
197 (_) => arguments[variableIndex++]); 197 (_) => arguments[variableIndex++]);
198 assert(variableIndex == arguments.length); 198 assert(variableIndex == arguments.length);
199 return representation; 199 return representation;
200 } 200 }
201 201
202 bool isNativePrimitiveType(DartType type) {
203 if (type is! InterfaceType) return false;
204 return _backend.isNativePrimitiveType(type.element);
205 }
206
207 void registerIsCheck(DartType type, Registry registry) { 202 void registerIsCheck(DartType type, Registry registry) {
208 _enqueuer.registerIsCheck(type, registry); 203 _enqueuer.registerIsCheck(type, registry);
209 _backend.registerIsCheckForCodegen(type, _enqueuer, registry); 204 _backend.registerIsCheckForCodegen(type, _enqueuer, registry);
210 } 205 }
211 206
212 bool isIntClass(ClassElement cls) => cls == _compiler.intClass;
213
214 bool isStringClass(ClassElement cls) => cls == _compiler.stringClass;
215
216 bool isBoolClass(ClassElement cls) => cls == _compiler.boolClass;
217
218 bool isNumClass(ClassElement cls) => cls == _compiler.numClass;
219
220 bool isDoubleClass(ClassElement cls) => cls == _compiler.doubleClass;
221
222 String getTypeTestTag(DartType type) { 207 String getTypeTestTag(DartType type) {
223 return _backend.namer.operatorIsType(type); 208 return _backend.namer.operatorIsType(type);
224 } 209 }
225 210
226 bool operatorEqHandlesNullArgument(FunctionElement element) { 211 bool operatorEqHandlesNullArgument(FunctionElement element) {
227 return _backend.operatorEqHandlesNullArgument(element); 212 return _backend.operatorEqHandlesNullArgument(element);
228 } 213 }
229
230 bool isListClass(ClassElement cls) => cls == _compiler.listClass;
231 } 214 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/type_test_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698