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

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

Issue 1125083002: dart2js: Access to metadata and types goes through builtins. (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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 return backend.rti.representationGenerator 299 return backend.rti.representationGenerator
300 .templateForCreateFunctionType; 300 .templateForCreateFunctionType;
301 301
302 case JsBuiltin.isSubtype: 302 case JsBuiltin.isSubtype:
303 // TODO(floitsch): move this closer to where is-check properties are 303 // TODO(floitsch): move this closer to where is-check properties are
304 // built. 304 // built.
305 String isPrefix = namer.operatorIsPrefix; 305 String isPrefix = namer.operatorIsPrefix;
306 return jsAst.js.expressionTemplateFor( 306 return jsAst.js.expressionTemplateFor(
307 "('$isPrefix' + #) in #.prototype"); 307 "('$isPrefix' + #) in #.prototype");
308 308
309 case JsBuiltin.getMetadata:
310 String metadataAccess =
311 generateEmbeddedGlobalAccessString(embeddedNames.METADATA);
312 return jsAst.js.expressionTemplateFor("$metadataAccess[#]");
313
314 case JsBuiltin.getType:
315 String typesAccess =
316 generateEmbeddedGlobalAccessString(embeddedNames.TYPES);
317 return jsAst.js.expressionTemplateFor("$typesAccess[#]");
318
309 default: 319 default:
310 compiler.internalError(NO_LOCATION_SPANNABLE, 320 compiler.internalError(NO_LOCATION_SPANNABLE,
311 "Unhandled Builtin: $builtin"); 321 "Unhandled Builtin: $builtin");
312 return null; 322 return null;
313 } 323 }
314 } 324 }
315 325
316 List<jsAst.Statement> buildTrivialNsmHandlers(){ 326 List<jsAst.Statement> buildTrivialNsmHandlers(){
317 return nsmEmitter.buildTrivialNsmHandlers(); 327 return nsmEmitter.buildTrivialNsmHandlers();
318 } 328 }
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 1951 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
1942 if (element.isInstanceMember) { 1952 if (element.isInstanceMember) {
1943 cachedClassBuilders.remove(element.enclosingClass); 1953 cachedClassBuilders.remove(element.enclosingClass);
1944 1954
1945 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 1955 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
1946 1956
1947 } 1957 }
1948 } 1958 }
1949 } 1959 }
1950 } 1960 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698