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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 791 |
795 FullCodeGenerator* codegen_; | 792 FullCodeGenerator* codegen_; |
796 Scope* saved_scope_; | 793 Scope* saved_scope_; |
797 BailoutId exit_id_; | 794 BailoutId exit_id_; |
798 bool needs_block_context_; | 795 bool needs_block_context_; |
799 }; | 796 }; |
800 | 797 |
801 MacroAssembler* masm_; | 798 MacroAssembler* masm_; |
802 CompilationInfo* info_; | 799 CompilationInfo* info_; |
803 Isolate* isolate_; | 800 Isolate* isolate_; |
804 LazyCompilationMode compilation_mode_; | |
805 Zone* zone_; | 801 Zone* zone_; |
806 Scope* scope_; | 802 Scope* scope_; |
807 Label return_label_; | 803 Label return_label_; |
808 NestedStatement* nesting_stack_; | 804 NestedStatement* nesting_stack_; |
809 int loop_depth_; | 805 int loop_depth_; |
810 int operand_stack_depth_; | 806 int operand_stack_depth_; |
811 ZoneList<Handle<Object> >* globals_; | 807 ZoneList<Handle<Object> >* globals_; |
812 const ExpressionContext* context_; | 808 const ExpressionContext* context_; |
813 ZoneList<BailoutEntry> bailout_entries_; | 809 ZoneList<BailoutEntry> bailout_entries_; |
814 ZoneList<BackEdgeEntry> back_edges_; | 810 ZoneList<BackEdgeEntry> back_edges_; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 Address start_; | 888 Address start_; |
893 Address instruction_start_; | 889 Address instruction_start_; |
894 uint32_t length_; | 890 uint32_t length_; |
895 }; | 891 }; |
896 | 892 |
897 | 893 |
898 } // namespace internal | 894 } // namespace internal |
899 } // namespace v8 | 895 } // namespace v8 |
900 | 896 |
901 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 897 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |