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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11564034: Revert r16154: some browser tests in checked mode fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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) 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 ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 2284
2285 void checkFixedArray(HInstruction input) { 2285 void checkFixedArray(HInstruction input) {
2286 checkFieldExists(input, 'fixed\$length'); 2286 checkFieldExists(input, 'fixed\$length');
2287 } 2287 }
2288 2288
2289 void checkNull(HInstruction input) { 2289 void checkNull(HInstruction input) {
2290 use(input); 2290 use(input);
2291 push(new js.Binary('==', pop(), new js.LiteralNull())); 2291 push(new js.Binary('==', pop(), new js.LiteralNull()));
2292 } 2292 }
2293 2293
2294 void checkNonNull(HInstruction input) {
2295 use(input);
2296 push(new js.Binary('!=', pop(), new js.LiteralNull()));
2297 }
2298
2299 void checkFunction(HInstruction input, DartType type) { 2294 void checkFunction(HInstruction input, DartType type) {
2300 checkTypeOf(input, '===', 'function'); 2295 checkTypeOf(input, '===', 'function');
2301 js.Expression functionTest = pop(); 2296 js.Expression functionTest = pop();
2302 checkObject(input, '==='); 2297 checkObject(input, '===');
2303 js.Expression objectTest = pop(); 2298 js.Expression objectTest = pop();
2304 checkType(input, type); 2299 checkType(input, type);
2305 push(new js.Binary('||', 2300 push(new js.Binary('||',
2306 functionTest, 2301 functionTest,
2307 new js.Binary('&&', objectTest, pop()))); 2302 new js.Binary('&&', objectTest, pop())));
2308 } 2303 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 } else if (Elements.isNumberOrStringSupertype(element, compiler)) { 2408 } else if (Elements.isNumberOrStringSupertype(element, compiler)) {
2414 handleNumberOrStringSupertypeCheck(input, type); 2409 handleNumberOrStringSupertypeCheck(input, type);
2415 attachLocationToLast(node); 2410 attachLocationToLast(node);
2416 } else if (Elements.isStringOnlySupertype(element, compiler)) { 2411 } else if (Elements.isStringOnlySupertype(element, compiler)) {
2417 handleStringSupertypeCheck(input, type); 2412 handleStringSupertypeCheck(input, type);
2418 attachLocationToLast(node); 2413 attachLocationToLast(node);
2419 } else if (identical(element, compiler.listClass) 2414 } else if (identical(element, compiler.listClass)
2420 || Elements.isListSupertype(element, compiler)) { 2415 || Elements.isListSupertype(element, compiler)) {
2421 handleListOrSupertypeCheck(input, type); 2416 handleListOrSupertypeCheck(input, type);
2422 attachLocationToLast(node); 2417 attachLocationToLast(node);
2423 } else if (element.isTypedef()) {
2424 checkNonNull(input);
2425 js.Expression nullTest = pop();
2426 checkType(input, type);
2427 push(new js.Binary('&&', nullTest, pop()));
2428 attachLocationToLast(node);
2429 } else if (types[input].canBePrimitive() || types[input].canBeNull()) { 2418 } else if (types[input].canBePrimitive() || types[input].canBeNull()) {
2430 checkObject(input, '==='); 2419 checkObject(input, '===');
2431 js.Expression objectTest = pop(); 2420 js.Expression objectTest = pop();
2432 checkType(input, type); 2421 checkType(input, type);
2433 push(new js.Binary('&&', objectTest, pop()), node); 2422 push(new js.Binary('&&', objectTest, pop()), node);
2434 } else { 2423 } else {
2435 checkType(input, type); 2424 checkType(input, type);
2436 attachLocationToLast(node); 2425 attachLocationToLast(node);
2437 } 2426 }
2438 if (node.hasArgumentChecks()) { 2427 if (node.hasArgumentChecks()) {
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 if (leftType.canBeNull() && rightType.canBeNull()) { 3067 if (leftType.canBeNull() && rightType.canBeNull()) {
3079 if (left.isConstantNull() || right.isConstantNull() || 3068 if (left.isConstantNull() || right.isConstantNull() ||
3080 (leftType.isPrimitive() && leftType == rightType)) { 3069 (leftType.isPrimitive() && leftType == rightType)) {
3081 return '=='; 3070 return '==';
3082 } 3071 }
3083 return null; 3072 return null;
3084 } else { 3073 } else {
3085 return '==='; 3074 return '===';
3086 } 3075 }
3087 } 3076 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698