Chromium Code Reviews| 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" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 // Forward declarations. | 14 // Forward declarations. |
| 15 class Class; | 15 class Class; |
| 16 class Function; | 16 class Function; |
| 17 class Library; | 17 class Library; |
| 18 class ParsedFunction; | 18 class ParsedFunction; |
| 19 class RawInstance; | 19 class RawInstance; |
| 20 class Script; | 20 class Script; |
| 21 class SequenceNode; | 21 class SequenceNode; |
| 22 | 22 |
| 23 DECLARE_RUNTIME_ENTRY(CompileFunction); | 23 DECLARE_RUNTIME_ENTRY(CompileFunction); |
| 24 | 24 |
| 25 class Compiler : public AllStatic { | 25 class Compiler : public AllStatic { |
| 26 public: | 26 public: |
| 27 // Extracts class, interface, function symbols from the script and populates | 27 // Extracts class symbols from the script and populates |
| 28 // the symbol tables and the class dictionary of the library. | 28 // the symbol tables and the class dictionary of the library. |
| 29 // | 29 // |
| 30 // Returns Error::null() if there is no compilation error. | 30 // Returns Error::null() if there is no compilation error. |
| 31 static RawError* Compile(const Library& library, const Script& script); | 31 static RawError* Compile(const Library& library, const Script& script); |
| 32 | 32 |
| 33 // Extracts function and field symbols from the class and populates | |
| 34 // the symbol tables and the class dictionary of the library. | |
|
Ivan Posva
2013/05/23 05:10:37
This comment is somewhat confusing. Wasn't the cla
siva
2013/05/23 20:19:46
Changed as discussed offline.
On 2013/05/23 05:10
| |
| 35 // | |
| 36 // Returns Error::null() if there is no compilation error. | |
| 37 static RawError* CompileClass(const Class& cls); | |
| 38 | |
| 39 | |
| 33 // Generates code for given function and sets its code field. | 40 // Generates code for given function and sets its code field. |
| 34 // | 41 // |
| 35 // Returns Error::null() if there is no compilation error. | 42 // Returns Error::null() if there is no compilation error. |
| 36 static RawError* CompileFunction(const Function& function); | 43 static RawError* CompileFunction(const Function& function); |
| 37 | 44 |
| 38 // Generates optimized code for function. | 45 // Generates optimized code for function. |
| 39 // | 46 // |
| 40 // Returns Error::null() if there is no compilation error. | 47 // Returns Error::null() if there is no compilation error. |
| 41 static RawError* CompileOptimizedFunction(const Function& function); | 48 static RawError* CompileOptimizedFunction(const Function& function); |
| 42 | 49 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 56 | 63 |
| 57 // Eagerly compiles all functions in a class. | 64 // Eagerly compiles all functions in a class. |
| 58 // | 65 // |
| 59 // Returns Error::null() if there is no compilation error. | 66 // Returns Error::null() if there is no compilation error. |
| 60 static RawError* CompileAllFunctions(const Class& cls); | 67 static RawError* CompileAllFunctions(const Class& cls); |
| 61 }; | 68 }; |
| 62 | 69 |
| 63 } // namespace dart | 70 } // namespace dart |
| 64 | 71 |
| 65 #endif // VM_COMPILER_H_ | 72 #endif // VM_COMPILER_H_ |
| OLD | NEW |