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

Side by Side Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2273943002: VM: More refactoring of recognized methods inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC.
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 } 1517 }
1518 1518
1519 1519
1520 EMIT_NATIVE_CODE(MathUnary, 1, Location::RequiresRegister()) { 1520 EMIT_NATIVE_CODE(MathUnary, 1, Location::RequiresRegister()) {
1521 const Register value = locs()->in(0).reg(); 1521 const Register value = locs()->in(0).reg();
1522 const Register result = locs()->out(0).reg(); 1522 const Register result = locs()->out(0).reg();
1523 if (kind() == MathUnaryInstr::kSqrt) { 1523 if (kind() == MathUnaryInstr::kSqrt) {
1524 __ DSqrt(result, value); 1524 __ DSqrt(result, value);
1525 } else if (kind() == MathUnaryInstr::kDoubleSquare) { 1525 } else if (kind() == MathUnaryInstr::kDoubleSquare) {
1526 __ DMul(result, value, value); 1526 __ DMul(result, value, value);
1527 } else if (kind() == MathUnaryInstr::kSin) {
1528 __ DSin(result, value);
1529 } else if (kind() == MathUnaryInstr::kCos) {
1530 __ DCos(result, value);
1531 } else { 1527 } else {
1532 Unsupported(compiler); 1528 Unsupported(compiler);
1533 UNREACHABLE(); 1529 UNREACHABLE();
1534 } 1530 }
1535 } 1531 }
1536 1532
1537 1533
1538 EMIT_NATIVE_CODE(InvokeMathCFunction, 1534 EMIT_NATIVE_CODE(InvokeMathCFunction,
1539 InputCount(), Location::RequiresRegister()) { 1535 InputCount(), Location::RequiresRegister()) {
1540 const Register left = locs()->in(0).reg(); 1536 const Register left = locs()->in(0).reg();
1541 const Register result = locs()->out(0).reg(); 1537 const Register result = locs()->out(0).reg();
1542 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { 1538 if (recognized_kind() == MethodRecognizer::kMathDoublePow) {
1543 const Register right = locs()->in(1).reg(); 1539 const Register right = locs()->in(1).reg();
1544 __ DPow(result, left, right); 1540 __ DPow(result, left, right);
1545 } else if (recognized_kind() == MethodRecognizer::kDoubleMod) { 1541 } else if (recognized_kind() == MethodRecognizer::kDoubleMod) {
1546 const Register right = locs()->in(1).reg(); 1542 const Register right = locs()->in(1).reg();
1547 __ DMod(result, left, right); 1543 __ DMod(result, left, right);
1544 } else if (recognized_kind() == MethodRecognizer::kMathSin) {
1545 __ DSin(result, left);
1546 } else if (recognized_kind() == MethodRecognizer::kMathCos) {
1547 __ DCos(result, left);
1548 } else { 1548 } else {
1549 Unsupported(compiler); 1549 Unsupported(compiler);
1550 UNREACHABLE(); 1550 UNREACHABLE();
1551 } 1551 }
1552 } 1552 }
1553 1553
1554 1554
1555 EMIT_NATIVE_CODE(MathMinMax, 2, Location::RequiresRegister()) { 1555 EMIT_NATIVE_CODE(MathMinMax, 2, Location::RequiresRegister()) {
1556 ASSERT((op_kind() == MethodRecognizer::kMathMin) || 1556 ASSERT((op_kind() == MethodRecognizer::kMathMin) ||
1557 (op_kind() == MethodRecognizer::kMathMax)); 1557 (op_kind() == MethodRecognizer::kMathMax));
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 __ IfULe(length, index); 1743 __ IfULe(length, index);
1744 compiler->EmitDeopt(deopt_id(), 1744 compiler->EmitDeopt(deopt_id(),
1745 ICData::kDeoptCheckArrayBound, 1745 ICData::kDeoptCheckArrayBound,
1746 (generalized_ ? ICData::kGeneralized : 0) | 1746 (generalized_ ? ICData::kGeneralized : 0) |
1747 (licm_hoisted_ ? ICData::kHoisted : 0)); 1747 (licm_hoisted_ ? ICData::kHoisted : 0));
1748 } 1748 }
1749 1749
1750 } // namespace dart 1750 } // namespace dart
1751 1751
1752 #endif // defined TARGET_ARCH_DBC 1752 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698