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

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

Issue 1422753004: VM: Add double unary minus intrinsic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/lib/double.dart ('k') | runtime/vm/method_recognizer.h » ('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) 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
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
OLDNEW
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698