OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
11 #include "src/ast/scopes.h" | 11 #include "src/ast/scopes.h" |
12 #include "src/bit-vector.h" | 12 #include "src/bit-vector.h" |
13 #include "src/code-factory.h" | 13 #include "src/code-factory.h" |
14 #include "src/code-stubs.h" | 14 #include "src/code-stubs.h" |
15 #include "src/codegen.h" | 15 #include "src/codegen.h" |
16 #include "src/deoptimizer.h" | 16 #include "src/deoptimizer.h" |
17 #include "src/globals.h" | 17 #include "src/globals.h" |
18 #include "src/objects.h" | 18 #include "src/objects.h" |
19 | 19 |
20 namespace v8 { | 20 namespace v8 { |
21 namespace internal { | 21 namespace internal { |
22 | 22 |
23 // Forward declarations. | 23 // Forward declarations. |
24 class CompilationInfo; | 24 class CompilationInfo; |
25 class CompilationJob; | 25 class CompilationJob; |
26 class JumpPatchSite; | 26 class JumpPatchSite; |
27 class Scope; | 27 class Scope; |
28 enum class LazyCompilationMode; | |
29 | 28 |
30 // ----------------------------------------------------------------------------- | 29 // ----------------------------------------------------------------------------- |
31 // Full code generator. | 30 // Full code generator. |
32 | 31 |
33 class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { | 32 class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { |
34 public: | 33 public: |
35 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info, | 34 FullCodeGenerator(MacroAssembler* masm, CompilationInfo* info, |
36 uintptr_t stack_limit, LazyCompilationMode mode); | 35 uintptr_t stack_limit); |
37 | 36 |
38 void Initialize(uintptr_t stack_limit); | 37 void Initialize(uintptr_t stack_limit); |
39 | 38 |
40 static CompilationJob* NewCompilationJob(CompilationInfo* info, | 39 static CompilationJob* NewCompilationJob(CompilationInfo* info); |
41 LazyCompilationMode mode); | |
42 | 40 |
43 static bool MakeCode(CompilationInfo* info, uintptr_t stack_limit, | 41 static bool MakeCode(CompilationInfo* info, uintptr_t stack_limit); |
44 LazyCompilationMode mode); | |
45 static bool MakeCode(CompilationInfo* info); | 42 static bool MakeCode(CompilationInfo* info); |
46 | 43 |
47 // Encode bailout state and pc-offset as a BitField<type, start, size>. | 44 // Encode bailout state and pc-offset as a BitField<type, start, size>. |
48 // Only use 30 bits because we encode the result as a smi. | 45 // Only use 30 bits because we encode the result as a smi. |
49 class BailoutStateField : public BitField<Deoptimizer::BailoutState, 0, 1> {}; | 46 class BailoutStateField : public BitField<Deoptimizer::BailoutState, 0, 1> {}; |
50 class PcField : public BitField<unsigned, 1, 30 - 1> {}; | 47 class PcField : public BitField<unsigned, 1, 30 - 1> {}; |
51 | 48 |
52 static const int kMaxBackEdgeWeight = 127; | 49 static const int kMaxBackEdgeWeight = 127; |
53 | 50 |
54 // Platform-specific code size multiplier. | 51 // Platform-specific code size multiplier. |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 | 796 |
800 FullCodeGenerator* codegen_; | 797 FullCodeGenerator* codegen_; |
801 Scope* saved_scope_; | 798 Scope* saved_scope_; |
802 BailoutId exit_id_; | 799 BailoutId exit_id_; |
803 bool needs_block_context_; | 800 bool needs_block_context_; |
804 }; | 801 }; |
805 | 802 |
806 MacroAssembler* masm_; | 803 MacroAssembler* masm_; |
807 CompilationInfo* info_; | 804 CompilationInfo* info_; |
808 Isolate* isolate_; | 805 Isolate* isolate_; |
809 LazyCompilationMode compilation_mode_; | |
810 Zone* zone_; | 806 Zone* zone_; |
811 Scope* scope_; | 807 Scope* scope_; |
812 Label return_label_; | 808 Label return_label_; |
813 NestedStatement* nesting_stack_; | 809 NestedStatement* nesting_stack_; |
814 int loop_depth_; | 810 int loop_depth_; |
815 int operand_stack_depth_; | 811 int operand_stack_depth_; |
816 ZoneList<Handle<Object> >* globals_; | 812 ZoneList<Handle<Object> >* globals_; |
817 const ExpressionContext* context_; | 813 const ExpressionContext* context_; |
818 ZoneList<BailoutEntry> bailout_entries_; | 814 ZoneList<BailoutEntry> bailout_entries_; |
819 ZoneList<BackEdgeEntry> back_edges_; | 815 ZoneList<BackEdgeEntry> back_edges_; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 Address start_; | 893 Address start_; |
898 Address instruction_start_; | 894 Address instruction_start_; |
899 uint32_t length_; | 895 uint32_t length_; |
900 }; | 896 }; |
901 | 897 |
902 | 898 |
903 } // namespace internal | 899 } // namespace internal |
904 } // namespace v8 | 900 } // namespace v8 |
905 | 901 |
906 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 902 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |