OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 14 matching lines...) Expand all Loading... | |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_FAST_CODEGEN_IA32_H_ | 28 #ifndef V8_FAST_CODEGEN_IA32_H_ |
29 #define V8_FAST_CODEGEN_IA32_H_ | 29 #define V8_FAST_CODEGEN_IA32_H_ |
30 | 30 |
31 #include "v8.h" | 31 #include "v8.h" |
32 | 32 |
33 #include "ast.h" | 33 #include "ast.h" |
34 #include "compiler.h" | 34 #include "compiler.h" |
35 #include "list.h" | |
fschneider
2010/02/19 14:47:14
list.h should be already included from compiler.h,
| |
35 | 36 |
36 namespace v8 { | 37 namespace v8 { |
37 namespace internal { | 38 namespace internal { |
38 | 39 |
39 class FastCodeGenSyntaxChecker: public AstVisitor { | 40 class FastCodeGenSyntaxChecker: public AstVisitor { |
40 public: | 41 public: |
41 explicit FastCodeGenSyntaxChecker() | 42 explicit FastCodeGenSyntaxChecker() |
42 : info_(NULL), has_supported_syntax_(true) { | 43 : info_(NULL), has_supported_syntax_(true) { |
43 } | 44 } |
44 | 45 |
(...skipping 14 matching lines...) Expand all Loading... | |
59 CompilationInfo* info_; | 60 CompilationInfo* info_; |
60 bool has_supported_syntax_; | 61 bool has_supported_syntax_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); | 63 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); |
63 }; | 64 }; |
64 | 65 |
65 | 66 |
66 class FastCodeGenerator: public AstVisitor { | 67 class FastCodeGenerator: public AstVisitor { |
67 public: | 68 public: |
68 explicit FastCodeGenerator(MacroAssembler* masm) | 69 explicit FastCodeGenerator(MacroAssembler* masm) |
69 : masm_(masm), info_(NULL), destination_(no_reg), smi_bits_(0) { | 70 : masm_(masm), |
71 info_(NULL), | |
72 destination_(no_reg), | |
73 smi_bits_(0) { | |
70 } | 74 } |
71 | 75 |
72 static Handle<Code> MakeCode(CompilationInfo* info); | 76 static Handle<Code> MakeCode(CompilationInfo* info); |
73 | 77 |
74 void Generate(CompilationInfo* compilation_info); | 78 void Generate(CompilationInfo* compilation_info); |
75 | 79 |
76 private: | 80 private: |
77 MacroAssembler* masm() { return masm_; } | 81 MacroAssembler* masm() { return masm_; } |
78 CompilationInfo* info() { return info_; } | 82 CompilationInfo* info() { return info_; } |
79 Label* bailout() { return &bailout_; } | |
80 | 83 |
81 Register destination() { return destination_; } | 84 Register destination() { return destination_; } |
82 void set_destination(Register reg) { destination_ = reg; } | 85 void set_destination(Register reg) { destination_ = reg; } |
83 | 86 |
84 FunctionLiteral* function() { return info_->function(); } | 87 FunctionLiteral* function() { return info_->function(); } |
85 Scope* scope() { return info_->scope(); } | 88 Scope* scope() { return info_->scope(); } |
86 | 89 |
87 // Platform-specific fixed registers, all guaranteed distinct. | 90 // Platform-specific fixed registers, all guaranteed distinct. |
88 Register accumulator0(); | 91 Register accumulator0(); |
89 Register accumulator1(); | 92 Register accumulator1(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // left in the destination register. | 138 // left in the destination register. |
136 void EmitThisPropertyLoad(Handle<String> name); | 139 void EmitThisPropertyLoad(Handle<String> name); |
137 | 140 |
138 // Emit a bitwise or operation. The left operand is in accumulator1 and | 141 // Emit a bitwise or operation. The left operand is in accumulator1 and |
139 // the right is in accumulator0. The result should be left in the | 142 // the right is in accumulator0. The result should be left in the |
140 // destination register. | 143 // destination register. |
141 void EmitBitOr(); | 144 void EmitBitOr(); |
142 | 145 |
143 MacroAssembler* masm_; | 146 MacroAssembler* masm_; |
144 CompilationInfo* info_; | 147 CompilationInfo* info_; |
145 Label bailout_; | 148 |
146 Register destination_; | 149 Register destination_; |
147 uint32_t smi_bits_; | 150 uint32_t smi_bits_; |
148 | 151 |
149 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); | 152 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); |
150 }; | 153 }; |
151 | 154 |
152 | 155 |
153 } } // namespace v8::internal | 156 } } // namespace v8::internal |
154 | 157 |
155 #endif // V8_FAST_CODEGEN_IA32_H_ | 158 #endif // V8_FAST_CODEGEN_IA32_H_ |
OLD | NEW |