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 // Class for intrinsifying functions. | 4 // Class for intrinsifying functions. |
5 | 5 |
6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 new StoreInstanceFieldInstr(GrowableObjectArray::length_offset(), | 861 new StoreInstanceFieldInstr(GrowableObjectArray::length_offset(), |
862 new Value(growable_array), | 862 new Value(growable_array), |
863 new Value(length), | 863 new Value(length), |
864 kNoStoreBarrier, | 864 kNoStoreBarrier, |
865 builder.TokenPos())); | 865 builder.TokenPos())); |
866 Definition* null_def = builder.AddNullDefinition(); | 866 Definition* null_def = builder.AddNullDefinition(); |
867 builder.AddIntrinsicReturn(new Value(null_def)); | 867 builder.AddIntrinsicReturn(new Value(null_def)); |
868 return true; | 868 return true; |
869 } | 869 } |
870 | 870 |
| 871 |
| 872 bool Intrinsifier::Build_DoubleFlipSignBit(FlowGraph* flow_graph) { |
| 873 GraphEntryInstr* graph_entry = flow_graph->graph_entry(); |
| 874 TargetEntryInstr* normal_entry = graph_entry->normal_entry(); |
| 875 BlockBuilder builder(flow_graph, normal_entry); |
| 876 |
| 877 Definition* receiver = builder.AddParameter(1); |
| 878 Definition* unboxed_value = |
| 879 builder.AddUnboxInstr(kUnboxedDouble, new Value(receiver)); |
| 880 Definition* unboxed_result = builder.AddDefinition( |
| 881 new UnaryDoubleOpInstr(Token::kNEGATE, |
| 882 new Value(unboxed_value), |
| 883 Thread::kNoDeoptId)); |
| 884 Definition* result = builder.AddDefinition( |
| 885 BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result))); |
| 886 builder.AddIntrinsicReturn(new Value(result)); |
| 887 return true; |
| 888 } |
| 889 |
871 } // namespace dart | 890 } // namespace dart |
OLD | NEW |