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
3// BSD-style license that can be found in the LICENSE file.
4// Class for intrinsifying functions.
5
6#ifndef RUNTIME_VM_COMPILER_INTRINSIFIER_H_
7#define RUNTIME_VM_COMPILER_INTRINSIFIER_H_
8
9#if defined(DART_PRECOMPILED_RUNTIME)
10#error "AOT runtime should not use compiler sources (including header files)"
11#endif // defined(DART_PRECOMPILED_RUNTIME)
12
13#include "vm/allocation.h"
14#include "vm/compiler/asm_intrinsifier.h"
15#include "vm/compiler/graph_intrinsifier.h"
16#include "vm/compiler/method_recognizer.h"
17
18namespace dart {
19
20// Forward declarations.
21class FlowGraphCompiler;
22class Function;
23class ParsedFunction;
24
25namespace compiler {
26class Assembler;
27class Label;
28
29class Intrinsifier : public AllStatic {
30 public:
31 static bool Intrinsify(const ParsedFunction& parsed_function,
32 FlowGraphCompiler* compiler);
33
34 static void InitializeState();
35
36 private:
37 friend class GraphIntrinsifier; // For CanIntrinsifyFieldAccessor.
38 static bool CanIntrinsify(const Function& function);
39 static bool CanIntrinsifyFieldAccessor(const Function& function);
40};
41
42} // namespace compiler
43} // namespace dart
44
45#endif // RUNTIME_VM_COMPILER_INTRINSIFIER_H_
46