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

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

Issue 10915200: Optimistically inline Math.sqrt as unboxed sqrtsd instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | 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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 intptr_t BinaryMintOpInstr::ResultCid() const { 1052 intptr_t BinaryMintOpInstr::ResultCid() const {
1053 return kMintCid; 1053 return kMintCid;
1054 } 1054 }
1055 1055
1056 1056
1057 RawAbstractType* UnboxedDoubleBinaryOpInstr::CompileType() const { 1057 RawAbstractType* UnboxedDoubleBinaryOpInstr::CompileType() const {
1058 return Type::Double(); 1058 return Type::Double();
1059 } 1059 }
1060 1060
1061 1061
1062 RawAbstractType* MathSqrtInstr::CompileType() const {
1063 return Type::Double();
1064 }
1065
1066
1062 RawAbstractType* UnboxDoubleInstr::CompileType() const { 1067 RawAbstractType* UnboxDoubleInstr::CompileType() const {
1063 return Type::null(); 1068 return Type::null();
1064 } 1069 }
1065 1070
1066 1071
1067 intptr_t BoxDoubleInstr::ResultCid() const { 1072 intptr_t BoxDoubleInstr::ResultCid() const {
1068 return kDoubleCid; 1073 return kDoubleCid;
1069 } 1074 }
1070 1075
1071 1076
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 locs()); 1466 locs());
1462 } 1467 }
1463 1468
1464 1469
1465 LocationSummary* StaticCallInstr::MakeLocationSummary() const { 1470 LocationSummary* StaticCallInstr::MakeLocationSummary() const {
1466 return MakeCallSummary(); 1471 return MakeCallSummary();
1467 } 1472 }
1468 1473
1469 1474
1470 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1475 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1471 Label done;
1472 if (recognized() == MethodRecognizer::kMathSqrt) {
1473 compiler->GenerateInlinedMathSqrt(&done);
1474 // Falls through to static call when operand type is not double or smi.
1475 }
1476 compiler->GenerateStaticCall(deopt_id(), 1476 compiler->GenerateStaticCall(deopt_id(),
1477 token_pos(), 1477 token_pos(),
1478 function(), 1478 function(),
1479 ArgumentCount(), 1479 ArgumentCount(),
1480 argument_names(), 1480 argument_names(),
1481 locs()); 1481 locs());
1482 __ Bind(&done);
1483 } 1482 }
1484 1483
1485 1484
1486 void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1485 void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1487 if (!is_eliminated()) { 1486 if (!is_eliminated()) {
1488 compiler->GenerateAssertAssignable(token_pos(), 1487 compiler->GenerateAssertAssignable(token_pos(),
1489 dst_type(), 1488 dst_type(),
1490 dst_name(), 1489 dst_name(),
1491 locs()); 1490 locs());
1492 } 1491 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 value->set_use_index(use_index++); 1653 value->set_use_index(use_index++);
1655 value->AddToEnvUseList(); 1654 value->AddToEnvUseList();
1656 } 1655 }
1657 instr->set_env(copy); 1656 instr->set_env(copy);
1658 } 1657 }
1659 1658
1660 1659
1661 #undef __ 1660 #undef __
1662 1661
1663 } // namespace dart 1662 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698