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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // ------------------------------------------------------------------------- | 146 // ------------------------------------------------------------------------- |
147 // Arguments allocation mode | 147 // Arguments allocation mode |
148 | 148 |
149 enum ArgumentsAllocationMode { | 149 enum ArgumentsAllocationMode { |
150 NO_ARGUMENTS_ALLOCATION, | 150 NO_ARGUMENTS_ALLOCATION, |
151 EAGER_ARGUMENTS_ALLOCATION, | 151 EAGER_ARGUMENTS_ALLOCATION, |
152 LAZY_ARGUMENTS_ALLOCATION | 152 LAZY_ARGUMENTS_ALLOCATION |
153 }; | 153 }; |
154 | 154 |
155 | 155 |
| 156 // Different nop operations are used by the code generator to detect certain |
| 157 // states of the generated code. |
| 158 enum NopMarkerTypes { |
| 159 NON_MARKING_NOP = 0, |
| 160 NAMED_PROPERTY_LOAD_INLINED |
| 161 }; |
| 162 |
| 163 |
156 // ------------------------------------------------------------------------- | 164 // ------------------------------------------------------------------------- |
157 // CodeGenerator | 165 // CodeGenerator |
158 | 166 |
159 class CodeGenerator: public AstVisitor { | 167 class CodeGenerator: public AstVisitor { |
160 public: | 168 public: |
161 // Takes a function literal, generates code for it. This function should only | 169 // Takes a function literal, generates code for it. This function should only |
162 // be called by compiler.cc. | 170 // be called by compiler.cc. |
163 static Handle<Code> MakeCode(CompilationInfo* info); | 171 static Handle<Code> MakeCode(CompilationInfo* info); |
164 | 172 |
165 // Printing of AST, etc. as requested by flags. | 173 // Printing of AST, etc. as requested by flags. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 JumpTarget* false_target, | 306 JumpTarget* false_target, |
299 bool force_control); | 307 bool force_control); |
300 | 308 |
301 // Read a value from a slot and leave it on top of the expression stack. | 309 // Read a value from a slot and leave it on top of the expression stack. |
302 void LoadFromSlot(Slot* slot, TypeofState typeof_state); | 310 void LoadFromSlot(Slot* slot, TypeofState typeof_state); |
303 void LoadFromSlotCheckForArguments(Slot* slot, TypeofState state); | 311 void LoadFromSlotCheckForArguments(Slot* slot, TypeofState state); |
304 // Store the value on top of the stack to a slot. | 312 // Store the value on top of the stack to a slot. |
305 void StoreToSlot(Slot* slot, InitState init_state); | 313 void StoreToSlot(Slot* slot, InitState init_state); |
306 | 314 |
307 // Load a named property, leaving it in r0. The receiver is passed on the | 315 // Load a named property, leaving it in r0. The receiver is passed on the |
308 // stack, and remain there. | 316 // stack, and remains there. |
309 void EmitNamedLoad(Handle<String> name, bool is_contextual); | 317 void EmitNamedLoad(Handle<String> name, bool is_contextual); |
310 | 318 |
311 // Load a keyed property, leaving it in r0. The receiver and key are | 319 // Load a keyed property, leaving it in r0. The receiver and key are |
312 // passed on the stack, and remain there. | 320 // passed on the stack, and remain there. |
313 void EmitKeyedLoad(bool is_global); | 321 void EmitKeyedLoad(bool is_global); |
314 | 322 |
315 void LoadFromGlobalSlotCheckExtensions(Slot* slot, | 323 void LoadFromGlobalSlotCheckExtensions(Slot* slot, |
316 TypeofState typeof_state, | 324 TypeofState typeof_state, |
317 Register tmp, | 325 Register tmp, |
318 Register tmp2, | 326 Register tmp2, |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 void Print() { | 854 void Print() { |
847 PrintF("NumberToStringStub\n"); | 855 PrintF("NumberToStringStub\n"); |
848 } | 856 } |
849 #endif | 857 #endif |
850 }; | 858 }; |
851 | 859 |
852 | 860 |
853 } } // namespace v8::internal | 861 } } // namespace v8::internal |
854 | 862 |
855 #endif // V8_ARM_CODEGEN_ARM_H_ | 863 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |