| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 HValue* hydrogen_value() const { return hydrogen_value_; } | 270 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 271 | 271 |
| 272 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 272 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 273 | 273 |
| 274 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 274 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 275 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 275 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 276 | 276 |
| 277 // Interface to the register allocator and iterators. | 277 // Interface to the register allocator and iterators. |
| 278 bool ClobbersTemps() const { return IsCall(); } | 278 bool ClobbersTemps() const { return IsCall(); } |
| 279 bool ClobbersRegisters() const { return IsCall(); } | 279 bool ClobbersRegisters() const { return IsCall(); } |
| 280 bool ClobbersDoubleRegisters() const { return IsCall(); } | 280 virtual bool ClobbersDoubleRegisters() const { return IsCall(); } |
| 281 | 281 |
| 282 // Interface to the register allocator and iterators. | 282 // Interface to the register allocator and iterators. |
| 283 bool IsMarkedAsCall() const { return IsCall(); } | 283 bool IsMarkedAsCall() const { return IsCall(); } |
| 284 | 284 |
| 285 virtual bool HasResult() const = 0; | 285 virtual bool HasResult() const = 0; |
| 286 virtual LOperand* result() const = 0; | 286 virtual LOperand* result() const = 0; |
| 287 | 287 |
| 288 LOperand* FirstInput() { return InputAt(0); } | 288 LOperand* FirstInput() { return InputAt(0); } |
| 289 LOperand* Output() { return HasResult() ? result() : NULL; } | 289 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 290 | 290 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 397 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
| 398 return !IsRedundant(); | 398 return !IsRedundant(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 401 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 | 404 |
| 405 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 405 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 406 public: | 406 public: |
| 407 explicit LGoto(int block_id) : block_id_(block_id) { } | 407 explicit LGoto(HBasicBlock* block) : block_(block) { } |
| 408 | 408 |
| 409 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 409 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
| 410 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 410 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 411 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 411 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 412 virtual bool IsControl() const V8_OVERRIDE { return true; } | 412 virtual bool IsControl() const V8_OVERRIDE { return true; } |
| 413 | 413 |
| 414 int block_id() const { return block_id_; } | 414 int block_id() const { return block_->block_id(); } |
| 415 | 415 |
| 416 private: | 416 private: |
| 417 int block_id_; | 417 HBasicBlock* block_; |
| 418 }; | 418 }; |
| 419 | 419 |
| 420 | 420 |
| 421 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 421 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 422 public: | 422 public: |
| 423 LLazyBailout() : gap_instructions_size_(0) { } | 423 LLazyBailout() : gap_instructions_size_(0) { } |
| 424 | 424 |
| 425 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 425 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 426 | 426 |
| 427 void set_gap_instructions_size(int gap_instructions_size) { | 427 void set_gap_instructions_size(int gap_instructions_size) { |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2045 public: | 2045 public: |
| 2046 explicit LCallRuntime(LOperand* context) { | 2046 explicit LCallRuntime(LOperand* context) { |
| 2047 inputs_[0] = context; | 2047 inputs_[0] = context; |
| 2048 } | 2048 } |
| 2049 | 2049 |
| 2050 LOperand* context() { return inputs_[0]; } | 2050 LOperand* context() { return inputs_[0]; } |
| 2051 | 2051 |
| 2052 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 2052 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
| 2053 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 2053 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
| 2054 | 2054 |
| 2055 virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE { |
| 2056 return save_doubles() == kDontSaveFPRegs; |
| 2057 } |
| 2058 |
| 2055 const Runtime::Function* function() const { return hydrogen()->function(); } | 2059 const Runtime::Function* function() const { return hydrogen()->function(); } |
| 2056 int arity() const { return hydrogen()->argument_count(); } | 2060 int arity() const { return hydrogen()->argument_count(); } |
| 2061 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
| 2057 }; | 2062 }; |
| 2058 | 2063 |
| 2059 | 2064 |
| 2060 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2065 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2061 public: | 2066 public: |
| 2062 explicit LInteger32ToDouble(LOperand* value) { | 2067 explicit LInteger32ToDouble(LOperand* value) { |
| 2063 inputs_[0] = value; | 2068 inputs_[0] = value; |
| 2064 } | 2069 } |
| 2065 | 2070 |
| 2066 LOperand* value() { return inputs_[0]; } | 2071 LOperand* value() { return inputs_[0]; } |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2721 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2726 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| 2722 }; | 2727 }; |
| 2723 | 2728 |
| 2724 | 2729 |
| 2725 class LChunkBuilder; | 2730 class LChunkBuilder; |
| 2726 class LPlatformChunk V8_FINAL : public LChunk { | 2731 class LPlatformChunk V8_FINAL : public LChunk { |
| 2727 public: | 2732 public: |
| 2728 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2733 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
| 2729 : LChunk(info, graph) { } | 2734 : LChunk(info, graph) { } |
| 2730 | 2735 |
| 2731 int GetNextSpillIndex(bool is_double); | 2736 int GetNextSpillIndex(RegisterKind kind); |
| 2732 LOperand* GetNextSpillSlot(bool is_double); | 2737 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 2733 }; | 2738 }; |
| 2734 | 2739 |
| 2735 | 2740 |
| 2736 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2741 class LChunkBuilder V8_FINAL BASE_EMBEDDED { |
| 2737 public: | 2742 public: |
| 2738 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2743 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2739 : chunk_(NULL), | 2744 : chunk_(NULL), |
| 2740 info_(info), | 2745 info_(info), |
| 2741 graph_(graph), | 2746 graph_(graph), |
| 2742 zone_(graph->zone()), | 2747 zone_(graph->zone()), |
| 2743 status_(UNUSED), | 2748 status_(UNUSED), |
| 2744 current_instruction_(NULL), | 2749 current_instruction_(NULL), |
| 2745 current_block_(NULL), | 2750 current_block_(NULL), |
| 2746 next_block_(NULL), | 2751 next_block_(NULL), |
| 2747 argument_count_(0), | 2752 argument_count_(0), |
| 2748 allocator_(allocator), | 2753 allocator_(allocator), |
| 2749 position_(RelocInfo::kNoPosition), | 2754 position_(RelocInfo::kNoPosition), |
| 2750 instruction_pending_deoptimization_environment_(NULL), | 2755 instruction_pending_deoptimization_environment_(NULL), |
| 2751 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2756 pending_deoptimization_ast_id_(BailoutId::None()) { } |
| 2752 | 2757 |
| 2753 // Build the sequence for the graph. | 2758 // Build the sequence for the graph. |
| 2754 LPlatformChunk* Build(); | 2759 LPlatformChunk* Build(); |
| 2755 | 2760 |
| 2761 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
| 2762 |
| 2756 // Declare methods that deal with the individual node types. | 2763 // Declare methods that deal with the individual node types. |
| 2757 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2764 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2758 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2765 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2759 #undef DECLARE_DO | 2766 #undef DECLARE_DO |
| 2760 | 2767 |
| 2761 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2768 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
| 2762 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); | 2769 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); |
| 2763 LInstruction* DoRSub(HSub* instr); | 2770 LInstruction* DoRSub(HSub* instr); |
| 2764 | 2771 |
| 2765 static bool HasMagicNumberForDivisor(int32_t divisor); | 2772 static bool HasMagicNumberForDivisor(int32_t divisor); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2904 | 2911 |
| 2905 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2912 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2906 }; | 2913 }; |
| 2907 | 2914 |
| 2908 #undef DECLARE_HYDROGEN_ACCESSOR | 2915 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2909 #undef DECLARE_CONCRETE_INSTRUCTION | 2916 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2910 | 2917 |
| 2911 } } // namespace v8::internal | 2918 } } // namespace v8::internal |
| 2912 | 2919 |
| 2913 #endif // V8_ARM_LITHIUM_ARM_H_ | 2920 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |