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

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1106443003: Optimize DateTime properties (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase 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) 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 final SourceInformationFactory sourceInformationFactory; 10 final SourceInformationFactory sourceInformationFactory;
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 visitMultiply(HMultiply node) => visitInvokeBinary(node, '*'); 1277 visitMultiply(HMultiply node) => visitInvokeBinary(node, '*');
1278 visitSubtract(HSubtract node) => visitInvokeBinary(node, '-'); 1278 visitSubtract(HSubtract node) => visitInvokeBinary(node, '-');
1279 visitBitAnd(HBitAnd node) => visitBitInvokeBinary(node, '&'); 1279 visitBitAnd(HBitAnd node) => visitBitInvokeBinary(node, '&');
1280 visitBitNot(HBitNot node) => visitBitInvokeUnary(node, '~'); 1280 visitBitNot(HBitNot node) => visitBitInvokeUnary(node, '~');
1281 visitBitOr(HBitOr node) => visitBitInvokeBinary(node, '|'); 1281 visitBitOr(HBitOr node) => visitBitInvokeBinary(node, '|');
1282 visitBitXor(HBitXor node) => visitBitInvokeBinary(node, '^'); 1282 visitBitXor(HBitXor node) => visitBitInvokeBinary(node, '^');
1283 visitShiftLeft(HShiftLeft node) => visitBitInvokeBinary(node, '<<'); 1283 visitShiftLeft(HShiftLeft node) => visitBitInvokeBinary(node, '<<');
1284 visitShiftRight(HShiftRight node) => visitBitInvokeBinary(node, '>>>'); 1284 visitShiftRight(HShiftRight node) => visitBitInvokeBinary(node, '>>>');
1285 1285
1286 visitTruncatingDivide(HTruncatingDivide node) { 1286 visitTruncatingDivide(HTruncatingDivide node) {
1287 assert(node.left.isUInt31(compiler)); 1287 assert(node.isUInt31(compiler));
1288 assert(node.left.isUInt32(compiler));
1288 assert(node.right.isPositiveInteger(compiler)); 1289 assert(node.right.isPositiveInteger(compiler));
1289 use(node.left); 1290 use(node.left);
1290 js.Expression jsLeft = pop(); 1291 js.Expression jsLeft = pop();
1291 use(node.right); 1292 use(node.right);
1292 push(new js.Binary('/', jsLeft, pop()), node); 1293 push(new js.Binary('/', jsLeft, pop()), node);
1293 push(new js.Binary('|', pop(), new js.LiteralNumber("0")), node); 1294 push(new js.Binary('|', pop(), new js.LiteralNumber("0")), node);
1294 } 1295 }
1295 1296
1296 visitNegate(HNegate node) => visitInvokeUnary(node, '-'); 1297 visitNegate(HNegate node) => visitInvokeUnary(node, '-');
1297 1298
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 js.PropertyAccess accessHelper(String name) { 2726 js.PropertyAccess accessHelper(String name) {
2726 Element helper = backend.findHelper(name); 2727 Element helper = backend.findHelper(name);
2727 if (helper == null) { 2728 if (helper == null) {
2728 // For mocked-up tests. 2729 // For mocked-up tests.
2729 return js.js('(void 0).$name'); 2730 return js.js('(void 0).$name');
2730 } 2731 }
2731 registry.registerStaticUse(helper); 2732 registry.registerStaticUse(helper);
2732 return backend.emitter.staticFunctionAccess(helper); 2733 return backend.emitter.staticFunctionAccess(helper);
2733 } 2734 }
2734 } 2735 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698