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

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

Issue 1123413002: dart2js: build metadata-types lazily in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged 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 library dart2js.new_js_emitter.emitter; 5 library dart2js.new_js_emitter.emitter;
6 6
7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show 7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show
8 JsBuiltin, 8 JsBuiltin,
9 METADATA, 9 METADATA,
10 TYPES; 10 TYPES;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // built. 169 // built.
170 String isPrefix = namer.operatorIsPrefix; 170 String isPrefix = namer.operatorIsPrefix;
171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
172 172
173 case JsBuiltin.getMetadata: 173 case JsBuiltin.getMetadata:
174 String metadataAccess = 174 String metadataAccess =
175 _emitter.generateEmbeddedGlobalAccessString(METADATA); 175 _emitter.generateEmbeddedGlobalAccessString(METADATA);
176 return js.js.expressionTemplateFor("$metadataAccess[#]"); 176 return js.js.expressionTemplateFor("$metadataAccess[#]");
177 177
178 case JsBuiltin.getType: 178 case JsBuiltin.getType:
179 String typesAccess = _emitter.generateEmbeddedGlobalAccessString(TYPES); 179 return _emitter.templateForReadType;
180 return js.js.expressionTemplateFor("$typesAccess[#]");
181 180
182 default: 181 default:
183 _compiler.internalError(NO_LOCATION_SPANNABLE, 182 _compiler.internalError(NO_LOCATION_SPANNABLE,
184 "Unhandled Builtin: $builtin"); 183 "Unhandled Builtin: $builtin");
185 return null; 184 return null;
186 } 185 }
187 } 186 }
188 187
189 @override 188 @override
190 void invalidateCaches() { 189 void invalidateCaches() {
191 } 190 }
192 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698