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

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

Issue 1136913006: dart2js: remove JS_OBJECT_CLASS_NAME and JS_NULL_CLASS_NAME from foreign (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return js.js.expressionTemplateYielding( 140 return js.js.expressionTemplateYielding(
141 typeAccess(_compiler.objectClass)); 141 typeAccess(_compiler.objectClass));
142 142
143 case JsBuiltin.classNameFromIsCheckProperty: 143 case JsBuiltin.classNameFromIsCheckProperty:
144 int isPrefixLength = namer.operatorIsPrefix.length; 144 int isPrefixLength = namer.operatorIsPrefix.length;
145 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); 145 return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
146 146
147 case JsBuiltin.isFunctionType: 147 case JsBuiltin.isFunctionType:
148 return _backend.rti.representationGenerator.templateForIsFunctionType; 148 return _backend.rti.representationGenerator.templateForIsFunctionType;
149 149
150 case JsBuiltin.isFunctionTypeLiteral:
151 String functionClassName =
152 _backend.namer.runtimeTypeName(_compiler.functionClass);
153
154 return js.js.expressionTemplateFor(
155 '#.$typeNameProperty === "$functionClassName"');
156
157 case JsBuiltin.typeName: 150 case JsBuiltin.typeName:
158 return js.js.expressionTemplateFor("#.$typeNameProperty"); 151 return js.js.expressionTemplateFor("#.$typeNameProperty");
159 152
160 case JsBuiltin.rawRuntimeType: 153 case JsBuiltin.rawRuntimeType:
161 return js.js.expressionTemplateFor("#.constructor"); 154 return js.js.expressionTemplateFor("#.constructor");
162 155
163 case JsBuiltin.createFunctionType: 156 case JsBuiltin.createFunctionType:
164 return _backend.rti.representationGenerator 157 return _backend.rti.representationGenerator
165 .templateForCreateFunctionType; 158 .templateForCreateFunctionType;
166 159
167 case JsBuiltin.isSubtype: 160 case JsBuiltin.isSubtype:
168 // TODO(floitsch): move this closer to where is-check properties are 161 // TODO(floitsch): move this closer to where is-check properties are
169 // built. 162 // built.
170 String isPrefix = namer.operatorIsPrefix; 163 String isPrefix = namer.operatorIsPrefix;
171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); 164 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
172 165
166 case JsBuiltin.isFunctionTypeRti:
167 String functionClassName =
168 _backend.namer.runtimeTypeName(_compiler.functionClass);
169
sra1 2015/05/14 19:12:59 Remove these blank lines. (They are not in the ot
floitsch 2015/05/19 15:39:26 Done.
170 return js.js.expressionTemplateFor(
171 '#.$typeNameProperty === "$functionClassName"');
172
173 case JsBuiltin.isNullTypeRti:
174 String nullClassName =
175 _backend.namer.runtimeTypeName(_compiler.nullClass);
176
sra1 2015/05/14 19:12:59 here
floitsch 2015/05/19 15:39:26 Done.
177 return js.js.expressionTemplateFor(
178 '#.$typeNameProperty === "$nullClassName"');
179
180 case JsBuiltin.isDartObjectTypeRti:
181 String dartObjectClassName =
182 _backend.namer.runtimeTypeName(_compiler.objectClass);
183
sra1 2015/05/14 19:12:59 here
floitsch 2015/05/19 15:39:26 Done.
184 return js.js.expressionTemplateFor(
185 '#.$typeNameProperty === "$dartObjectClassName"');
186
173 case JsBuiltin.getMetadata: 187 case JsBuiltin.getMetadata:
174 return _emitter.templateForReadMetadata; 188 return _emitter.templateForReadMetadata;
175 189
176 case JsBuiltin.getType: 190 case JsBuiltin.getType:
177 return _emitter.templateForReadType; 191 return _emitter.templateForReadType;
178 192
179 default: 193 default:
180 _compiler.internalError(NO_LOCATION_SPANNABLE, 194 _compiler.internalError(NO_LOCATION_SPANNABLE,
181 "Unhandled Builtin: $builtin"); 195 "Unhandled Builtin: $builtin");
182 return null; 196 return null;
183 } 197 }
184 } 198 }
185 199
186 @override 200 @override
187 void invalidateCaches() { 201 void invalidateCaches() {
188 } 202 }
189 } 203 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698