| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 Element jsStringToString; | 62 Element jsStringToString; |
| 63 Element objectEquals; | 63 Element objectEquals; |
| 64 | 64 |
| 65 ClassElement typeLiteralClass; | 65 ClassElement typeLiteralClass; |
| 66 ClassElement mapLiteralClass; | 66 ClassElement mapLiteralClass; |
| 67 ClassElement constMapLiteralClass; | 67 ClassElement constMapLiteralClass; |
| 68 | 68 |
| 69 Element getInterceptorMethod; | 69 Element getInterceptorMethod; |
| 70 Element interceptedNames; | 70 Element interceptedNames; |
| 71 | 71 |
| 72 HType stringType; |
| 73 HType indexablePrimitiveType; |
| 74 HType readableArrayType; |
| 75 HType mutableArrayType; |
| 76 HType fixedArrayType; |
| 77 HType extendableArrayType; |
| 78 |
| 79 |
| 72 // TODO(9577): Make it so that these are not needed when there are no native | 80 // TODO(9577): Make it so that these are not needed when there are no native |
| 73 // classes. | 81 // classes. |
| 74 Element dispatchPropertyName; | 82 Element dispatchPropertyName; |
| 75 Element getNativeInterceptorMethod; | 83 Element getNativeInterceptorMethod; |
| 76 Element defineNativeMethodsFinishMethod; | 84 Element defineNativeMethodsFinishMethod; |
| 77 Element getDispatchPropertyMethod; | 85 Element getDispatchPropertyMethod; |
| 78 Element setDispatchPropertyMethod; | 86 Element setDispatchPropertyMethod; |
| 79 Element initializeDispatchPropertyMethod; | 87 Element initializeDispatchPropertyMethod; |
| 80 bool needToInitializeDispatchProperty = false; | 88 bool needToInitializeDispatchProperty = false; |
| 81 | 89 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 372 |
| 365 objectEquals = compiler.lookupElementIn( | 373 objectEquals = compiler.lookupElementIn( |
| 366 compiler.objectClass, const SourceString('==')); | 374 compiler.objectClass, const SourceString('==')); |
| 367 | 375 |
| 368 specialOperatorEqClasses | 376 specialOperatorEqClasses |
| 369 ..add(compiler.objectClass) | 377 ..add(compiler.objectClass) |
| 370 ..add(jsInterceptorClass) | 378 ..add(jsInterceptorClass) |
| 371 ..add(jsNullClass); | 379 ..add(jsNullClass); |
| 372 | 380 |
| 373 validateInterceptorImplementsAllObjectMethods(jsInterceptorClass); | 381 validateInterceptorImplementsAllObjectMethods(jsInterceptorClass); |
| 382 |
| 383 stringType = new HBoundedType( |
| 384 new TypeMask.nonNullExact(jsStringClass.rawType)); |
| 385 indexablePrimitiveType = new HBoundedType( |
| 386 new TypeMask.nonNullSubtype(jsIndexableClass.rawType)); |
| 387 readableArrayType = new HBoundedType( |
| 388 new TypeMask.nonNullSubclass(jsArrayClass.rawType)); |
| 389 mutableArrayType = new HBoundedType( |
| 390 new TypeMask.nonNullSubclass(jsMutableArrayClass.rawType)); |
| 391 fixedArrayType = new HBoundedType( |
| 392 new TypeMask.nonNullExact(jsFixedArrayClass.rawType)); |
| 393 extendableArrayType = new HBoundedType( |
| 394 new TypeMask.nonNullExact(jsExtendableArrayClass.rawType)); |
| 374 } | 395 } |
| 375 | 396 |
| 376 void validateInterceptorImplementsAllObjectMethods( | 397 void validateInterceptorImplementsAllObjectMethods( |
| 377 ClassElement interceptorClass) { | 398 ClassElement interceptorClass) { |
| 378 if (interceptorClass == null) return; | 399 if (interceptorClass == null) return; |
| 379 interceptorClass.ensureResolved(compiler); | 400 interceptorClass.ensureResolved(compiler); |
| 380 compiler.objectClass.forEachMember((_, Element member) { | 401 compiler.objectClass.forEachMember((_, Element member) { |
| 381 if (member.isGenerativeConstructor()) return; | 402 if (member.isGenerativeConstructor()) return; |
| 382 Element interceptorMember = interceptorClass.lookupMember(member.name); | 403 Element interceptorMember = interceptorClass.lookupMember(member.name); |
| 383 // Interceptors must override all Object methods due to calling convention | 404 // Interceptors must override all Object methods due to calling convention |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 ClassElement get listImplementation => jsArrayClass; | 1102 ClassElement get listImplementation => jsArrayClass; |
| 1082 ClassElement get constListImplementation => jsArrayClass; | 1103 ClassElement get constListImplementation => jsArrayClass; |
| 1083 ClassElement get fixedListImplementation => jsFixedArrayClass; | 1104 ClassElement get fixedListImplementation => jsFixedArrayClass; |
| 1084 ClassElement get growableListImplementation => jsExtendableArrayClass; | 1105 ClassElement get growableListImplementation => jsExtendableArrayClass; |
| 1085 ClassElement get mapImplementation => mapLiteralClass; | 1106 ClassElement get mapImplementation => mapLiteralClass; |
| 1086 ClassElement get constMapImplementation => constMapLiteralClass; | 1107 ClassElement get constMapImplementation => constMapLiteralClass; |
| 1087 ClassElement get typeImplementation => typeLiteralClass; | 1108 ClassElement get typeImplementation => typeLiteralClass; |
| 1088 ClassElement get boolImplementation => jsBoolClass; | 1109 ClassElement get boolImplementation => jsBoolClass; |
| 1089 ClassElement get nullImplementation => jsNullClass; | 1110 ClassElement get nullImplementation => jsNullClass; |
| 1090 } | 1111 } |
| OLD | NEW |