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

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

Issue 1121313007: dart2js: add builtin 'isSubtype'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 case JsBuiltin.typeName: 292 case JsBuiltin.typeName:
293 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); 293 return jsAst.js.expressionTemplateFor("#.$typeNameProperty");
294 294
295 case JsBuiltin.rawRuntimeType: 295 case JsBuiltin.rawRuntimeType:
296 return jsAst.js.expressionTemplateFor("#.constructor"); 296 return jsAst.js.expressionTemplateFor("#.constructor");
297 297
298 case JsBuiltin.createFunctionType: 298 case JsBuiltin.createFunctionType:
299 return backend.rti.representationGenerator 299 return backend.rti.representationGenerator
300 .templateForCreateFunctionType; 300 .templateForCreateFunctionType;
301 301
302 case JsBuiltin.isSubtype:
303 // TODO(floitsch): move this closer to where is-check properties are
304 // built.
305 String isPrefix = namer.operatorIsPrefix;
306 return jsAst.js.expressionTemplateFor(
307 "('$isPrefix' + #) in #.prototype");
308
302 default: 309 default:
303 compiler.internalError(NO_LOCATION_SPANNABLE, 310 compiler.internalError(NO_LOCATION_SPANNABLE,
304 "Unhandled Builtin: $builtin"); 311 "Unhandled Builtin: $builtin");
305 return null; 312 return null;
306 } 313 }
307 } 314 }
308 315
309 List<jsAst.Statement> buildTrivialNsmHandlers(){ 316 List<jsAst.Statement> buildTrivialNsmHandlers(){
310 return nsmEmitter.buildTrivialNsmHandlers(); 317 return nsmEmitter.buildTrivialNsmHandlers();
311 } 318 }
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 1941 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
1935 if (element.isInstanceMember) { 1942 if (element.isInstanceMember) {
1936 cachedClassBuilders.remove(element.enclosingClass); 1943 cachedClassBuilders.remove(element.enclosingClass);
1937 1944
1938 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 1945 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
1939 1946
1940 } 1947 }
1941 } 1948 }
1942 } 1949 }
1943 } 1950 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698