| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 V(FunctionLiteral) \ | 100 V(FunctionLiteral) \ |
| 101 V(GetCachedArrayIndex) \ | 101 V(GetCachedArrayIndex) \ |
| 102 V(GlobalObject) \ | 102 V(GlobalObject) \ |
| 103 V(GlobalReceiver) \ | 103 V(GlobalReceiver) \ |
| 104 V(Goto) \ | 104 V(Goto) \ |
| 105 V(HasCachedArrayIndexAndBranch) \ | 105 V(HasCachedArrayIndexAndBranch) \ |
| 106 V(HasInstanceTypeAndBranch) \ | 106 V(HasInstanceTypeAndBranch) \ |
| 107 V(InnerAllocatedObject) \ | 107 V(InnerAllocatedObject) \ |
| 108 V(InstanceOf) \ | 108 V(InstanceOf) \ |
| 109 V(InstanceOfKnownGlobal) \ | 109 V(InstanceOfKnownGlobal) \ |
| 110 V(InstanceSize) \ | |
| 111 V(InstructionGap) \ | 110 V(InstructionGap) \ |
| 112 V(Integer32ToDouble) \ | 111 V(Integer32ToDouble) \ |
| 113 V(Integer32ToSmi) \ | 112 V(Integer32ToSmi) \ |
| 114 V(InvokeFunction) \ | 113 V(InvokeFunction) \ |
| 115 V(IsConstructCallAndBranch) \ | 114 V(IsConstructCallAndBranch) \ |
| 116 V(IsObjectAndBranch) \ | 115 V(IsObjectAndBranch) \ |
| 117 V(IsSmiAndBranch) \ | 116 V(IsSmiAndBranch) \ |
| 118 V(IsStringAndBranch) \ | 117 V(IsStringAndBranch) \ |
| 119 V(IsUndetectableAndBranch) \ | 118 V(IsUndetectableAndBranch) \ |
| 120 V(Label) \ | 119 V(Label) \ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 V(TaggedToI) \ | 184 V(TaggedToI) \ |
| 186 V(ThisFunction) \ | 185 V(ThisFunction) \ |
| 187 V(Throw) \ | 186 V(Throw) \ |
| 188 V(ToFastProperties) \ | 187 V(ToFastProperties) \ |
| 189 V(TransitionElementsKind) \ | 188 V(TransitionElementsKind) \ |
| 190 V(TrapAllocationMemento) \ | 189 V(TrapAllocationMemento) \ |
| 191 V(TruncateDoubleToIntOrSmi) \ | 190 V(TruncateDoubleToIntOrSmi) \ |
| 192 V(Typeof) \ | 191 V(Typeof) \ |
| 193 V(TypeofIsAndBranch) \ | 192 V(TypeofIsAndBranch) \ |
| 194 V(Uint32ToDouble) \ | 193 V(Uint32ToDouble) \ |
| 194 V(Uint32ToSmi) \ |
| 195 V(UnknownOSRValue) \ | 195 V(UnknownOSRValue) \ |
| 196 V(ValueOf) \ | 196 V(ValueOf) \ |
| 197 V(WrapReceiver) | 197 V(WrapReceiver) |
| 198 | 198 |
| 199 | 199 |
| 200 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 200 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 201 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 201 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
| 202 return LInstruction::k##type; \ | 202 return LInstruction::k##type; \ |
| 203 } \ | 203 } \ |
| 204 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 204 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 215 H##type* hydrogen() const { \ | 215 H##type* hydrogen() const { \ |
| 216 return H##type::cast(this->hydrogen_value()); \ | 216 return H##type::cast(this->hydrogen_value()); \ |
| 217 } | 217 } |
| 218 | 218 |
| 219 | 219 |
| 220 class LInstruction : public ZoneObject { | 220 class LInstruction : public ZoneObject { |
| 221 public: | 221 public: |
| 222 LInstruction() | 222 LInstruction() |
| 223 : environment_(NULL), | 223 : environment_(NULL), |
| 224 hydrogen_value_(NULL), | 224 hydrogen_value_(NULL), |
| 225 bit_field_(IsCallBits::encode(false)) { | 225 bit_field_(IsCallBits::encode(false)) { } |
| 226 set_position(RelocInfo::kNoPosition); | |
| 227 } | |
| 228 | 226 |
| 229 virtual ~LInstruction() { } | 227 virtual ~LInstruction() { } |
| 230 | 228 |
| 231 virtual void CompileToNative(LCodeGen* generator) = 0; | 229 virtual void CompileToNative(LCodeGen* generator) = 0; |
| 232 virtual const char* Mnemonic() const = 0; | 230 virtual const char* Mnemonic() const = 0; |
| 233 virtual void PrintTo(StringStream* stream); | 231 virtual void PrintTo(StringStream* stream); |
| 234 virtual void PrintDataTo(StringStream* stream); | 232 virtual void PrintDataTo(StringStream* stream); |
| 235 virtual void PrintOutputOperandTo(StringStream* stream); | 233 virtual void PrintOutputOperandTo(StringStream* stream); |
| 236 | 234 |
| 237 enum Opcode { | 235 enum Opcode { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 257 virtual bool IsControl() const { return false; } | 255 virtual bool IsControl() const { return false; } |
| 258 | 256 |
| 259 void set_environment(LEnvironment* env) { environment_ = env; } | 257 void set_environment(LEnvironment* env) { environment_ = env; } |
| 260 LEnvironment* environment() const { return environment_; } | 258 LEnvironment* environment() const { return environment_; } |
| 261 bool HasEnvironment() const { return environment_ != NULL; } | 259 bool HasEnvironment() const { return environment_ != NULL; } |
| 262 | 260 |
| 263 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 261 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 264 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 262 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 265 bool HasPointerMap() const { return pointer_map_.is_set(); } | 263 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 266 | 264 |
| 267 // The 31 bits PositionBits is used to store the int position value. And the | |
| 268 // position value may be RelocInfo::kNoPosition (-1). The accessor always | |
| 269 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0 | |
| 270 // and can fit into the 31 bits PositionBits. | |
| 271 void set_position(int32_t pos) { | |
| 272 bit_field_ = PositionBits::update(bit_field_, pos + 1); | |
| 273 } | |
| 274 int32_t position() { return PositionBits::decode(bit_field_) - 1; } | |
| 275 | |
| 276 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 265 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 277 HValue* hydrogen_value() const { return hydrogen_value_; } | 266 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 278 | 267 |
| 279 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 268 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 280 | 269 |
| 281 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 270 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 282 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 271 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 283 | 272 |
| 284 // Interface to the register allocator and iterators. | 273 // Interface to the register allocator and iterators. |
| 285 bool ClobbersTemps() const { return IsCall(); } | 274 bool ClobbersTemps() const { return IsCall(); } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 299 LOperand* Output() { return HasResult() ? result() : NULL; } | 288 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 300 | 289 |
| 301 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 290 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 302 | 291 |
| 303 #ifdef DEBUG | 292 #ifdef DEBUG |
| 304 void VerifyCall(); | 293 void VerifyCall(); |
| 305 #endif | 294 #endif |
| 306 | 295 |
| 307 private: | 296 private: |
| 308 class IsCallBits: public BitField<bool, 0, 1> {}; | 297 class IsCallBits: public BitField<bool, 0, 1> {}; |
| 309 class PositionBits: public BitField<int, 1, 31> {}; | |
| 310 | 298 |
| 311 LEnvironment* environment_; | 299 LEnvironment* environment_; |
| 312 SetOncePointer<LPointerMap> pointer_map_; | 300 SetOncePointer<LPointerMap> pointer_map_; |
| 313 HValue* hydrogen_value_; | 301 HValue* hydrogen_value_; |
| 314 int32_t bit_field_; | 302 int32_t bit_field_; |
| 315 }; | 303 }; |
| 316 | 304 |
| 317 | 305 |
| 318 // R = number of result operands (0 or 1). | 306 // R = number of result operands (0 or 1). |
| 319 // I = number of input operands. | 307 // I = number of input operands. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 LParallelMove* GetParallelMove(InnerPosition pos) { | 425 LParallelMove* GetParallelMove(InnerPosition pos) { |
| 438 return parallel_moves_[pos]; | 426 return parallel_moves_[pos]; |
| 439 } | 427 } |
| 440 | 428 |
| 441 private: | 429 private: |
| 442 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 430 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 443 HBasicBlock* block_; | 431 HBasicBlock* block_; |
| 444 }; | 432 }; |
| 445 | 433 |
| 446 | 434 |
| 447 class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
| 448 public: | |
| 449 explicit LInstanceSize(LOperand* object) { | |
| 450 inputs_[0] = object; | |
| 451 } | |
| 452 | |
| 453 LOperand* object() { return inputs_[0]; } | |
| 454 | |
| 455 DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size") | |
| 456 DECLARE_HYDROGEN_ACCESSOR(InstanceSize) | |
| 457 }; | |
| 458 | |
| 459 | |
| 460 class LInstructionGap V8_FINAL : public LGap { | 435 class LInstructionGap V8_FINAL : public LGap { |
| 461 public: | 436 public: |
| 462 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 437 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 463 | 438 |
| 464 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 439 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
| 465 return !IsRedundant(); | 440 return !IsRedundant(); |
| 466 } | 441 } |
| 467 | 442 |
| 468 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 443 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 469 }; | 444 }; |
| (...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 explicit LUint32ToDouble(LOperand* value) { | 2703 explicit LUint32ToDouble(LOperand* value) { |
| 2729 inputs_[0] = value; | 2704 inputs_[0] = value; |
| 2730 } | 2705 } |
| 2731 | 2706 |
| 2732 LOperand* value() { return inputs_[0]; } | 2707 LOperand* value() { return inputs_[0]; } |
| 2733 | 2708 |
| 2734 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 2709 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 2735 }; | 2710 }; |
| 2736 | 2711 |
| 2737 | 2712 |
| 2713 class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2714 public: |
| 2715 explicit LUint32ToSmi(LOperand* value) { |
| 2716 inputs_[0] = value; |
| 2717 } |
| 2718 |
| 2719 LOperand* value() { return inputs_[0]; } |
| 2720 |
| 2721 DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi") |
| 2722 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2723 }; |
| 2724 |
| 2725 |
| 2738 class LValueOf V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2726 class LValueOf V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2739 public: | 2727 public: |
| 2740 LValueOf(LOperand* value, LOperand* temp) { | 2728 LValueOf(LOperand* value, LOperand* temp) { |
| 2741 inputs_[0] = value; | 2729 inputs_[0] = value; |
| 2742 temps_[0] = temp; | 2730 temps_[0] = temp; |
| 2743 } | 2731 } |
| 2744 | 2732 |
| 2745 LOperand* value() { return inputs_[0]; } | 2733 LOperand* value() { return inputs_[0]; } |
| 2746 LOperand* temp() { return temps_[0]; } | 2734 LOperand* temp() { return temps_[0]; } |
| 2747 | 2735 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 | 2957 |
| 2970 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2958 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2971 }; | 2959 }; |
| 2972 | 2960 |
| 2973 #undef DECLARE_HYDROGEN_ACCESSOR | 2961 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2974 #undef DECLARE_CONCRETE_INSTRUCTION | 2962 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2975 | 2963 |
| 2976 } } // namespace v8::internal | 2964 } } // namespace v8::internal |
| 2977 | 2965 |
| 2978 #endif // V8_A64_LITHIUM_A64_H_ | 2966 #endif // V8_A64_LITHIUM_A64_H_ |
| OLD | NEW |