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_IA32_LITHIUM_IA32_H_ | 5 #ifndef V8_IA32_LITHIUM_IA32_H_ |
6 #define V8_IA32_LITHIUM_IA32_H_ | 6 #define V8_IA32_LITHIUM_IA32_H_ |
7 | 7 |
8 #include "hydrogen.h" | 8 #include "hydrogen.h" |
9 #include "lithium-allocator.h" | 9 #include "lithium-allocator.h" |
10 #include "lithium.h" | 10 #include "lithium.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 HValue* hydrogen_value() const { return hydrogen_value_; } | 231 HValue* hydrogen_value() const { return hydrogen_value_; } |
232 | 232 |
233 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 233 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
234 | 234 |
235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
236 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 236 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
237 | 237 |
238 // Interface to the register allocator and iterators. | 238 // Interface to the register allocator and iterators. |
239 bool ClobbersTemps() const { return IsCall(); } | 239 bool ClobbersTemps() const { return IsCall(); } |
240 bool ClobbersRegisters() const { return IsCall(); } | 240 bool ClobbersRegisters() const { return IsCall(); } |
241 virtual bool ClobbersDoubleRegisters() const { | 241 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
242 return IsCall() || | 242 return IsCall() || |
243 // We only have rudimentary X87Stack tracking, thus in general | 243 // We only have rudimentary X87Stack tracking, thus in general |
244 // cannot handle phi-nodes. | 244 // cannot handle phi-nodes. |
245 (!CpuFeatures::IsSafeForSnapshot(SSE2) && IsControl()); | 245 (!CpuFeatures::IsSafeForSnapshot(isolate, SSE2) && IsControl()); |
246 } | 246 } |
247 | 247 |
248 virtual bool HasResult() const = 0; | 248 virtual bool HasResult() const = 0; |
249 virtual LOperand* result() const = 0; | 249 virtual LOperand* result() const = 0; |
250 | 250 |
251 bool HasDoubleRegisterResult(); | 251 bool HasDoubleRegisterResult(); |
252 bool HasDoubleRegisterInput(); | 252 bool HasDoubleRegisterInput(); |
253 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); | 253 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); |
254 | 254 |
255 LOperand* FirstInput() { return InputAt(0); } | 255 LOperand* FirstInput() { return InputAt(0); } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 370 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
371 return !IsRedundant(); | 371 return !IsRedundant(); |
372 } | 372 } |
373 | 373 |
374 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 374 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
375 }; | 375 }; |
376 | 376 |
377 | 377 |
378 class LClobberDoubles V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 378 class LClobberDoubles V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
379 public: | 379 public: |
380 LClobberDoubles() { ASSERT(!CpuFeatures::IsSafeForSnapshot(SSE2)); } | 380 explicit LClobberDoubles(Isolate* isolate) { |
| 381 ASSERT(!CpuFeatures::IsSafeForSnapshot(isolate, SSE2)); |
| 382 } |
381 | 383 |
382 virtual bool ClobbersDoubleRegisters() const { return true; } | 384 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
| 385 return true; |
| 386 } |
383 | 387 |
384 DECLARE_CONCRETE_INSTRUCTION(ClobberDoubles, "clobber-d") | 388 DECLARE_CONCRETE_INSTRUCTION(ClobberDoubles, "clobber-d") |
385 }; | 389 }; |
386 | 390 |
387 | 391 |
388 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 392 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
389 public: | 393 public: |
390 explicit LGoto(HBasicBlock* block) : block_(block) { } | 394 explicit LGoto(HBasicBlock* block) : block_(block) { } |
391 | 395 |
392 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 396 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
393 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 397 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
394 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 398 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
395 virtual bool IsControl() const V8_OVERRIDE { return true; } | 399 virtual bool IsControl() const V8_OVERRIDE { return true; } |
396 | 400 |
397 int block_id() const { return block_->block_id(); } | 401 int block_id() const { return block_->block_id(); } |
398 virtual bool ClobbersDoubleRegisters() const { return false; } | 402 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
| 403 return false; |
| 404 } |
399 | 405 |
400 bool jumps_to_join() const { return block_->predecessors()->length() > 1; } | 406 bool jumps_to_join() const { return block_->predecessors()->length() > 1; } |
401 | 407 |
402 private: | 408 private: |
403 HBasicBlock* block_; | 409 HBasicBlock* block_; |
404 }; | 410 }; |
405 | 411 |
406 | 412 |
407 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 413 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
408 public: | 414 public: |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 public: | 1987 public: |
1982 explicit LCallRuntime(LOperand* context) { | 1988 explicit LCallRuntime(LOperand* context) { |
1983 inputs_[0] = context; | 1989 inputs_[0] = context; |
1984 } | 1990 } |
1985 | 1991 |
1986 LOperand* context() { return inputs_[0]; } | 1992 LOperand* context() { return inputs_[0]; } |
1987 | 1993 |
1988 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1994 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1989 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1995 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1990 | 1996 |
1991 virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE { | 1997 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
1992 return save_doubles() == kDontSaveFPRegs; | 1998 return save_doubles() == kDontSaveFPRegs; |
1993 } | 1999 } |
1994 | 2000 |
1995 const Runtime::Function* function() const { return hydrogen()->function(); } | 2001 const Runtime::Function* function() const { return hydrogen()->function(); } |
1996 int arity() const { return hydrogen()->argument_count(); } | 2002 int arity() const { return hydrogen()->argument_count(); } |
1997 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } | 2003 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
1998 }; | 2004 }; |
1999 | 2005 |
2000 | 2006 |
2001 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2007 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2718 : LChunkBuilderBase(graph->zone()), | 2724 : LChunkBuilderBase(graph->zone()), |
2719 chunk_(NULL), | 2725 chunk_(NULL), |
2720 info_(info), | 2726 info_(info), |
2721 graph_(graph), | 2727 graph_(graph), |
2722 status_(UNUSED), | 2728 status_(UNUSED), |
2723 current_instruction_(NULL), | 2729 current_instruction_(NULL), |
2724 current_block_(NULL), | 2730 current_block_(NULL), |
2725 next_block_(NULL), | 2731 next_block_(NULL), |
2726 allocator_(allocator) { } | 2732 allocator_(allocator) { } |
2727 | 2733 |
| 2734 Isolate* isolate() const { return graph_->isolate(); } |
| 2735 |
2728 // Build the sequence for the graph. | 2736 // Build the sequence for the graph. |
2729 LPlatformChunk* Build(); | 2737 LPlatformChunk* Build(); |
2730 | 2738 |
2731 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2739 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
2732 | 2740 |
2733 // Declare methods that deal with the individual node types. | 2741 // Declare methods that deal with the individual node types. |
2734 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2742 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2735 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2743 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2736 #undef DECLARE_DO | 2744 #undef DECLARE_DO |
2737 | 2745 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 | 2887 |
2880 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2888 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2881 }; | 2889 }; |
2882 | 2890 |
2883 #undef DECLARE_HYDROGEN_ACCESSOR | 2891 #undef DECLARE_HYDROGEN_ACCESSOR |
2884 #undef DECLARE_CONCRETE_INSTRUCTION | 2892 #undef DECLARE_CONCRETE_INSTRUCTION |
2885 | 2893 |
2886 } } // namespace v8::internal | 2894 } } // namespace v8::internal |
2887 | 2895 |
2888 #endif // V8_IA32_LITHIUM_IA32_H_ | 2896 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |