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

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

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 6 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 // Class for intrinsifying functions. 4 // Class for intrinsifying functions.
5 5
6 #ifndef VM_INTRINSIFIER_H_ 6 #ifndef VM_INTRINSIFIER_H_
7 #define VM_INTRINSIFIER_H_ 7 #define VM_INTRINSIFIER_H_
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/method_recognizer.h" 10 #include "vm/method_recognizer.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 // Forward declarations. 14 // Forward declarations.
15 class Assembler; 15 class Assembler;
16 class FlowGraphCompiler;
16 class Function; 17 class Function;
18 class TargetEntryInstr;
19 class ParsedFunction;
20 class FlowGraph;
17 21
18 class Intrinsifier : public AllStatic { 22 class Intrinsifier : public AllStatic {
19 public: 23 public:
20 // Try to intrinsify 'function'. Returns true if the function intrinsified 24 static void Intrinsify(const ParsedFunction& parsed_function,
21 // completely and the code does not need to be generated (i.e., no slow 25 FlowGraphCompiler* compiler);
22 // path possible).
23 static void Intrinsify(const Function& function, Assembler* assembler);
24 static void InitializeState(); 26 static void InitializeState();
25 27
28 static bool GraphIntrinsify(const ParsedFunction& parsed_function,
29 FlowGraphCompiler* compiler);
30
31 static intptr_t ParameterSlotFromSp();
32
26 private: 33 private:
27 static bool CanIntrinsify(const Function& function); 34 static bool CanIntrinsify(const Function& function);
28 35
29 #define DECLARE_FUNCTION(test_class_name, test_function_name, destination, fp) \ 36
30 static void destination(Assembler* assembler); 37 #define DECLARE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \
38 static void enum_name(Assembler* assembler);
31 39
32 ALL_INTRINSICS_LIST(DECLARE_FUNCTION) 40 ALL_INTRINSICS_LIST(DECLARE_FUNCTION)
33 41
34 #undef DECLARE_FUNCTION 42 #undef DECLARE_FUNCTION
43
44 #define DECLARE_FUNCTION(test_class_name, test_function_name, enum_name, fp) \
45 static bool Build_##enum_name(FlowGraph* flow_graph);
46
47 GRAPH_INTRINSICS_LIST(DECLARE_FUNCTION)
48
49 #undef DECLARE_FUNCTION
35 }; 50 };
36 51
37 } // namespace dart 52 } // namespace dart
38 53
39 #endif // VM_INTRINSIFIER_H_ 54 #endif // VM_INTRINSIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698