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 | 4 |
5 #ifndef VM_COMPILER_H_ | 5 #ifndef VM_COMPILER_H_ |
6 #define VM_COMPILER_H_ | 6 #define VM_COMPILER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Extracts function and field symbols from the class and populates | 33 // Extracts function and field symbols from the class and populates |
34 // the class. | 34 // the class. |
35 // | 35 // |
36 // Returns Error::null() if there is no compilation error. | 36 // Returns Error::null() if there is no compilation error. |
37 static RawError* CompileClass(const Class& cls); | 37 static RawError* CompileClass(const Class& cls); |
38 | 38 |
39 // Generates code for given function and sets its code field. | 39 // Generates code for given function and sets its code field. |
40 // | 40 // |
41 // Returns Error::null() if there is no compilation error. | 41 // Returns Error::null() if there is no compilation error. |
42 static RawError* CompileFunction(const Function& function); | 42 static RawError* CompileFunction(Isolate* isolate, const Function& function); |
43 | 43 |
44 // Generates optimized code for function. | 44 // Generates optimized code for function. |
45 // | 45 // |
46 // Returns Error::null() if there is no compilation error. | 46 // Returns Error::null() if there is no compilation error. |
47 static RawError* CompileOptimizedFunction( | 47 static RawError* CompileOptimizedFunction( |
| 48 Isolate* isolate, |
48 const Function& function, | 49 const Function& function, |
49 intptr_t osr_id = Isolate::kNoDeoptId); | 50 intptr_t osr_id = Isolate::kNoDeoptId); |
50 | 51 |
51 // Generates code for given parsed function (without parsing it again) and | 52 // Generates code for given parsed function (without parsing it again) and |
52 // sets its code field. | 53 // sets its code field. |
53 // | 54 // |
54 // Returns Error::null() if there is no compilation error. | 55 // Returns Error::null() if there is no compilation error. |
55 static RawError* CompileParsedFunction(ParsedFunction* parsed_function); | 56 static RawError* CompileParsedFunction(ParsedFunction* parsed_function); |
56 | 57 |
57 // Generates and executes code for a given code fragment, e.g. a | 58 // Generates and executes code for a given code fragment, e.g. a |
58 // compile time constant expression. Returns the result returned | 59 // compile time constant expression. Returns the result returned |
59 // by the fragment. | 60 // by the fragment. |
60 // | 61 // |
61 // The return value is either a RawInstance on success or a RawError | 62 // The return value is either a RawInstance on success or a RawError |
62 // on compilation failure. | 63 // on compilation failure. |
63 static RawObject* ExecuteOnce(SequenceNode* fragment); | 64 static RawObject* ExecuteOnce(SequenceNode* fragment); |
64 | 65 |
65 // Eagerly compiles all functions in a class. | 66 // Eagerly compiles all functions in a class. |
66 // | 67 // |
67 // Returns Error::null() if there is no compilation error. | 68 // Returns Error::null() if there is no compilation error. |
68 static RawError* CompileAllFunctions(const Class& cls); | 69 static RawError* CompileAllFunctions(const Class& cls); |
69 }; | 70 }; |
70 | 71 |
71 } // namespace dart | 72 } // namespace dart |
72 | 73 |
73 #endif // VM_COMPILER_H_ | 74 #endif // VM_COMPILER_H_ |
OLD | NEW |