| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 HValue* hydrogen_value() const { return hydrogen_value_; } | 277 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 278 | 278 |
| 279 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 279 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 280 | 280 |
| 281 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 281 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 282 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 282 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 283 | 283 |
| 284 // Interface to the register allocator and iterators. | 284 // Interface to the register allocator and iterators. |
| 285 bool ClobbersTemps() const { return IsCall(); } | 285 bool ClobbersTemps() const { return IsCall(); } |
| 286 bool ClobbersRegisters() const { return IsCall(); } | 286 bool ClobbersRegisters() const { return IsCall(); } |
| 287 bool ClobbersDoubleRegisters() const { return IsCall(); } | 287 virtual bool ClobbersDoubleRegisters() const { return IsCall(); } |
| 288 bool IsMarkedAsCall() const { return IsCall(); } | 288 bool IsMarkedAsCall() const { return IsCall(); } |
| 289 | 289 |
| 290 virtual bool HasResult() const = 0; | 290 virtual bool HasResult() const = 0; |
| 291 virtual LOperand* result() const = 0; | 291 virtual LOperand* result() const = 0; |
| 292 | 292 |
| 293 virtual int InputCount() = 0; | 293 virtual int InputCount() = 0; |
| 294 virtual LOperand* InputAt(int i) = 0; | 294 virtual LOperand* InputAt(int i) = 0; |
| 295 virtual int TempCount() = 0; | 295 virtual int TempCount() = 0; |
| 296 virtual LOperand* TempAt(int i) = 0; | 296 virtual LOperand* TempAt(int i) = 0; |
| 297 | 297 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 public: | 486 public: |
| 487 explicit LDummyUse(LOperand* value) { | 487 explicit LDummyUse(LOperand* value) { |
| 488 inputs_[0] = value; | 488 inputs_[0] = value; |
| 489 } | 489 } |
| 490 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") | 490 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") |
| 491 }; | 491 }; |
| 492 | 492 |
| 493 | 493 |
| 494 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 494 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 495 public: | 495 public: |
| 496 explicit LGoto(int block_id) : block_id_(block_id) { } | 496 explicit LGoto(HBasicBlock* block) : block_(block) { } |
| 497 | 497 |
| 498 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 498 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
| 499 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 499 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 500 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 500 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 501 virtual bool IsControl() const V8_OVERRIDE { return true; } | 501 virtual bool IsControl() const V8_OVERRIDE { return true; } |
| 502 | 502 |
| 503 int block_id() const { return block_id_; } | 503 int block_id() const { return block_->block_id(); } |
| 504 | 504 |
| 505 private: | 505 private: |
| 506 int block_id_; | 506 HBasicBlock* block_; |
| 507 }; | 507 }; |
| 508 | 508 |
| 509 | 509 |
| 510 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 510 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 511 public: | 511 public: |
| 512 LLazyBailout() : gap_instructions_size_(0) { } | 512 LLazyBailout() : gap_instructions_size_(0) { } |
| 513 | 513 |
| 514 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 514 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 515 | 515 |
| 516 void set_gap_instructions_size(int gap_instructions_size) { | 516 void set_gap_instructions_size(int gap_instructions_size) { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 | 916 |
| 917 int arity() const { return hydrogen()->argument_count() - 1; } | 917 int arity() const { return hydrogen()->argument_count() - 1; } |
| 918 }; | 918 }; |
| 919 | 919 |
| 920 | 920 |
| 921 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 921 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
| 922 public: | 922 public: |
| 923 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 923 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
| 924 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 924 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
| 925 | 925 |
| 926 virtual bool ClobbersDoubleRegisters() const V8_OVERRIDE { |
| 927 return save_doubles() == kDontSaveFPRegs; |
| 928 } |
| 929 |
| 926 const Runtime::Function* function() const { return hydrogen()->function(); } | 930 const Runtime::Function* function() const { return hydrogen()->function(); } |
| 927 int arity() const { return hydrogen()->argument_count(); } | 931 int arity() const { return hydrogen()->argument_count(); } |
| 932 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
| 928 }; | 933 }; |
| 929 | 934 |
| 930 | 935 |
| 931 class LCallStub V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 936 class LCallStub V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
| 932 public: | 937 public: |
| 933 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 938 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 934 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 939 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 935 | 940 |
| 936 TranscendentalCache::Type transcendental_type() { | 941 TranscendentalCache::Type transcendental_type() { |
| 937 return hydrogen()->transcendental_type(); | 942 return hydrogen()->transcendental_type(); |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 }; | 2796 }; |
| 2792 | 2797 |
| 2793 | 2798 |
| 2794 class LChunkBuilder; | 2799 class LChunkBuilder; |
| 2795 class LPlatformChunk V8_FINAL : public LChunk { | 2800 class LPlatformChunk V8_FINAL : public LChunk { |
| 2796 public: | 2801 public: |
| 2797 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2802 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
| 2798 : LChunk(info, graph) { } | 2803 : LChunk(info, graph) { } |
| 2799 | 2804 |
| 2800 int GetNextSpillIndex(); | 2805 int GetNextSpillIndex(); |
| 2801 LOperand* GetNextSpillSlot(bool is_double); | 2806 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 2802 }; | 2807 }; |
| 2803 | 2808 |
| 2804 | 2809 |
| 2805 class LChunkBuilder V8_FINAL BASE_EMBEDDED { | 2810 class LChunkBuilder V8_FINAL BASE_EMBEDDED { |
| 2806 public: | 2811 public: |
| 2807 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2812 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2808 : chunk_(NULL), | 2813 : chunk_(NULL), |
| 2809 info_(info), | 2814 info_(info), |
| 2810 graph_(graph), | 2815 graph_(graph), |
| 2811 zone_(graph->zone()), | 2816 zone_(graph->zone()), |
| 2812 status_(UNUSED), | 2817 status_(UNUSED), |
| 2813 current_instruction_(NULL), | 2818 current_instruction_(NULL), |
| 2814 current_block_(NULL), | 2819 current_block_(NULL), |
| 2815 argument_count_(0), | 2820 argument_count_(0), |
| 2816 allocator_(allocator), | 2821 allocator_(allocator), |
| 2817 position_(RelocInfo::kNoPosition), | 2822 position_(RelocInfo::kNoPosition), |
| 2818 instruction_pending_deoptimization_environment_(NULL), | 2823 instruction_pending_deoptimization_environment_(NULL), |
| 2819 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2824 pending_deoptimization_ast_id_(BailoutId::None()) { } |
| 2820 | 2825 |
| 2821 // Build the sequence for the graph. | 2826 // Build the sequence for the graph. |
| 2822 LPlatformChunk* Build(); | 2827 LPlatformChunk* Build(); |
| 2823 | 2828 |
| 2829 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
| 2830 |
| 2824 // Declare methods that deal with the individual node types. | 2831 // Declare methods that deal with the individual node types. |
| 2825 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2832 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2826 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2833 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2827 #undef DECLARE_DO | 2834 #undef DECLARE_DO |
| 2828 | 2835 |
| 2829 static bool HasMagicNumberForDivision(int32_t divisor); | 2836 static bool HasMagicNumberForDivision(int32_t divisor); |
| 2830 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); | 2837 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); |
| 2831 | 2838 |
| 2832 private: | 2839 private: |
| 2833 enum Status { | 2840 enum Status { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2962 | 2969 |
| 2963 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2970 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2964 }; | 2971 }; |
| 2965 | 2972 |
| 2966 #undef DECLARE_HYDROGEN_ACCESSOR | 2973 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2967 #undef DECLARE_CONCRETE_INSTRUCTION | 2974 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2968 | 2975 |
| 2969 } } // namespace v8::internal | 2976 } } // namespace v8::internal |
| 2970 | 2977 |
| 2971 #endif // V8_A64_LITHIUM_A64_H_ | 2978 #endif // V8_A64_LITHIUM_A64_H_ |
| OLD | NEW |