OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 25 matching lines...) Expand all Loading... |
36 #include "scopes.h" | 36 #include "scopes.h" |
37 #include "v8utils.h" | 37 #include "v8utils.h" |
38 #include "x64/lithium-gap-resolver-x64.h" | 38 #include "x64/lithium-gap-resolver-x64.h" |
39 | 39 |
40 namespace v8 { | 40 namespace v8 { |
41 namespace internal { | 41 namespace internal { |
42 | 42 |
43 // Forward declarations. | 43 // Forward declarations. |
44 class LDeferredCode; | 44 class LDeferredCode; |
45 class SafepointGenerator; | 45 class SafepointGenerator; |
| 46 class LithiumSmiInstructionWrapper; |
46 | 47 |
47 class LCodeGen BASE_EMBEDDED { | 48 class LCodeGen BASE_EMBEDDED { |
48 public: | 49 public: |
49 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 50 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
50 : zone_(info->zone()), | 51 : zone_(info->zone()), |
51 chunk_(static_cast<LPlatformChunk*>(chunk)), | 52 chunk_(static_cast<LPlatformChunk*>(chunk)), |
52 masm_(assembler), | 53 masm_(assembler), |
53 info_(info), | 54 info_(info), |
54 current_block_(-1), | 55 current_block_(-1), |
55 current_instruction_(-1), | 56 current_instruction_(-1), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // chunk contains constructs we cannot handle. Returns true if the | 116 // chunk contains constructs we cannot handle. Returns true if the |
116 // code generation attempt succeeded. | 117 // code generation attempt succeeded. |
117 bool GenerateCode(); | 118 bool GenerateCode(); |
118 | 119 |
119 // Finish the code by setting stack height, safepoint, and bailout | 120 // Finish the code by setting stack height, safepoint, and bailout |
120 // information on it. | 121 // information on it. |
121 void FinishCode(Handle<Code> code); | 122 void FinishCode(Handle<Code> code); |
122 | 123 |
123 // Deferred code support. | 124 // Deferred code support. |
124 void DoDeferredNumberTagD(LNumberTagD* instr); | 125 void DoDeferredNumberTagD(LNumberTagD* instr); |
| 126 void DoDeferredNumberTagI(LNumberTagI* instr); |
125 void DoDeferredNumberTagU(LNumberTagU* instr); | 127 void DoDeferredNumberTagU(LNumberTagU* instr); |
126 void DoDeferredTaggedToI(LTaggedToI* instr); | 128 void DoDeferredTaggedToI(LTaggedToI* instr); |
127 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr); | 129 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr); |
128 void DoDeferredStackCheck(LStackCheck* instr); | 130 void DoDeferredStackCheck(LStackCheck* instr); |
129 void DoDeferredRandom(LRandom* instr); | 131 void DoDeferredRandom(LRandom* instr); |
130 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 132 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
131 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 133 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
132 void DoDeferredAllocate(LAllocate* instr); | 134 void DoDeferredAllocate(LAllocate* instr); |
133 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 135 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
134 Label* map_check); | 136 Label* map_check); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 Register ToRegister(int index) const; | 263 Register ToRegister(int index) const; |
262 XMMRegister ToDoubleRegister(int index) const; | 264 XMMRegister ToDoubleRegister(int index) const; |
263 Operand BuildFastArrayOperand( | 265 Operand BuildFastArrayOperand( |
264 LOperand* elements_pointer, | 266 LOperand* elements_pointer, |
265 LOperand* key, | 267 LOperand* key, |
266 ElementsKind elements_kind, | 268 ElementsKind elements_kind, |
267 uint32_t offset, | 269 uint32_t offset, |
268 uint32_t additional_index = 0); | 270 uint32_t additional_index = 0); |
269 | 271 |
270 void EmitIntegerMathAbs(LMathAbs* instr); | 272 void EmitIntegerMathAbs(LMathAbs* instr); |
271 void EmitInteger64MathAbs(LMathAbs* instr); | 273 void EmitSmiMathAbs(LMathAbs* instr); |
272 | 274 |
273 // Support for recording safepoint and position information. | 275 // Support for recording safepoint and position information. |
274 void RecordSafepoint(LPointerMap* pointers, | 276 void RecordSafepoint(LPointerMap* pointers, |
275 Safepoint::Kind kind, | 277 Safepoint::Kind kind, |
276 int arguments, | 278 int arguments, |
277 Safepoint::DeoptMode mode); | 279 Safepoint::DeoptMode mode); |
278 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 280 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
279 void RecordSafepoint(Safepoint::DeoptMode mode); | 281 void RecordSafepoint(Safepoint::DeoptMode mode); |
280 void RecordSafepointWithRegisters(LPointerMap* pointers, | 282 void RecordSafepointWithRegisters(LPointerMap* pointers, |
281 int arguments, | 283 int arguments, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | 401 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; |
400 } | 402 } |
401 | 403 |
402 private: | 404 private: |
403 LCodeGen* codegen_; | 405 LCodeGen* codegen_; |
404 }; | 406 }; |
405 | 407 |
406 friend class LDeferredCode; | 408 friend class LDeferredCode; |
407 friend class LEnvironment; | 409 friend class LEnvironment; |
408 friend class SafepointGenerator; | 410 friend class SafepointGenerator; |
| 411 friend class LithiumSmiInstructionWrapper; |
409 DISALLOW_COPY_AND_ASSIGN(LCodeGen); | 412 DISALLOW_COPY_AND_ASSIGN(LCodeGen); |
410 }; | 413 }; |
411 | 414 |
412 | 415 |
413 class LDeferredCode: public ZoneObject { | 416 class LDeferredCode: public ZoneObject { |
414 public: | 417 public: |
415 explicit LDeferredCode(LCodeGen* codegen) | 418 explicit LDeferredCode(LCodeGen* codegen) |
416 : codegen_(codegen), | 419 : codegen_(codegen), |
417 external_exit_(NULL), | 420 external_exit_(NULL), |
418 instruction_index_(codegen->current_instruction_) { | 421 instruction_index_(codegen->current_instruction_) { |
(...skipping 17 matching lines...) Expand all Loading... |
436 LCodeGen* codegen_; | 439 LCodeGen* codegen_; |
437 Label entry_; | 440 Label entry_; |
438 Label exit_; | 441 Label exit_; |
439 Label* external_exit_; | 442 Label* external_exit_; |
440 int instruction_index_; | 443 int instruction_index_; |
441 }; | 444 }; |
442 | 445 |
443 } } // namespace v8::internal | 446 } } // namespace v8::internal |
444 | 447 |
445 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 448 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
OLD | NEW |