| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 V(FunctionLiteral) \ | 98 V(FunctionLiteral) \ |
| 99 V(GetCachedArrayIndex) \ | 99 V(GetCachedArrayIndex) \ |
| 100 V(GlobalObject) \ | 100 V(GlobalObject) \ |
| 101 V(GlobalReceiver) \ | 101 V(GlobalReceiver) \ |
| 102 V(Goto) \ | 102 V(Goto) \ |
| 103 V(HasCachedArrayIndexAndBranch) \ | 103 V(HasCachedArrayIndexAndBranch) \ |
| 104 V(HasInstanceTypeAndBranch) \ | 104 V(HasInstanceTypeAndBranch) \ |
| 105 V(InnerAllocatedObject) \ | 105 V(InnerAllocatedObject) \ |
| 106 V(InstanceOf) \ | 106 V(InstanceOf) \ |
| 107 V(InstanceOfKnownGlobal) \ | 107 V(InstanceOfKnownGlobal) \ |
| 108 V(InstanceSize) \ | |
| 109 V(InstructionGap) \ | 108 V(InstructionGap) \ |
| 110 V(Integer32ToDouble) \ | 109 V(Integer32ToDouble) \ |
| 111 V(Integer32ToSmi) \ | 110 V(Integer32ToSmi) \ |
| 112 V(InvokeFunction) \ | 111 V(InvokeFunction) \ |
| 113 V(IsConstructCallAndBranch) \ | 112 V(IsConstructCallAndBranch) \ |
| 114 V(IsObjectAndBranch) \ | 113 V(IsObjectAndBranch) \ |
| 115 V(IsStringAndBranch) \ | 114 V(IsStringAndBranch) \ |
| 116 V(IsSmiAndBranch) \ | 115 V(IsSmiAndBranch) \ |
| 117 V(IsUndetectableAndBranch) \ | 116 V(IsUndetectableAndBranch) \ |
| 118 V(Label) \ | 117 V(Label) \ |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return H##type::cast(hydrogen_value()); \ | 205 return H##type::cast(hydrogen_value()); \ |
| 207 } | 206 } |
| 208 | 207 |
| 209 | 208 |
| 210 class LInstruction : public ZoneObject { | 209 class LInstruction : public ZoneObject { |
| 211 public: | 210 public: |
| 212 LInstruction() | 211 LInstruction() |
| 213 : environment_(NULL), | 212 : environment_(NULL), |
| 214 hydrogen_value_(NULL), | 213 hydrogen_value_(NULL), |
| 215 bit_field_(IsCallBits::encode(false)) { | 214 bit_field_(IsCallBits::encode(false)) { |
| 216 set_position(RelocInfo::kNoPosition); | |
| 217 } | 215 } |
| 218 | 216 |
| 219 virtual ~LInstruction() {} | 217 virtual ~LInstruction() {} |
| 220 | 218 |
| 221 virtual void CompileToNative(LCodeGen* generator) = 0; | 219 virtual void CompileToNative(LCodeGen* generator) = 0; |
| 222 virtual const char* Mnemonic() const = 0; | 220 virtual const char* Mnemonic() const = 0; |
| 223 virtual void PrintTo(StringStream* stream); | 221 virtual void PrintTo(StringStream* stream); |
| 224 virtual void PrintDataTo(StringStream* stream); | 222 virtual void PrintDataTo(StringStream* stream); |
| 225 virtual void PrintOutputOperandTo(StringStream* stream); | 223 virtual void PrintOutputOperandTo(StringStream* stream); |
| 226 | 224 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 247 virtual bool IsControl() const { return false; } | 245 virtual bool IsControl() const { return false; } |
| 248 | 246 |
| 249 void set_environment(LEnvironment* env) { environment_ = env; } | 247 void set_environment(LEnvironment* env) { environment_ = env; } |
| 250 LEnvironment* environment() const { return environment_; } | 248 LEnvironment* environment() const { return environment_; } |
| 251 bool HasEnvironment() const { return environment_ != NULL; } | 249 bool HasEnvironment() const { return environment_ != NULL; } |
| 252 | 250 |
| 253 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 251 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 254 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 252 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 255 bool HasPointerMap() const { return pointer_map_.is_set(); } | 253 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 256 | 254 |
| 257 // The 31 bits PositionBits is used to store the int position value. And the | |
| 258 // position value may be RelocInfo::kNoPosition (-1). The accessor always | |
| 259 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0 | |
| 260 // and can fit into the 31 bits PositionBits. | |
| 261 void set_position(int pos) { | |
| 262 bit_field_ = PositionBits::update(bit_field_, pos + 1); | |
| 263 } | |
| 264 int position() { return PositionBits::decode(bit_field_) - 1; } | |
| 265 | |
| 266 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 255 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 267 HValue* hydrogen_value() const { return hydrogen_value_; } | 256 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 268 | 257 |
| 269 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 258 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 270 | 259 |
| 271 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 260 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 272 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 261 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 273 | 262 |
| 274 // Interface to the register allocator and iterators. | 263 // Interface to the register allocator and iterators. |
| 275 bool ClobbersTemps() const { return IsCall(); } | 264 bool ClobbersTemps() const { return IsCall(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 295 // Iterator interface. | 284 // Iterator interface. |
| 296 friend class InputIterator; | 285 friend class InputIterator; |
| 297 virtual int InputCount() = 0; | 286 virtual int InputCount() = 0; |
| 298 virtual LOperand* InputAt(int i) = 0; | 287 virtual LOperand* InputAt(int i) = 0; |
| 299 | 288 |
| 300 friend class TempIterator; | 289 friend class TempIterator; |
| 301 virtual int TempCount() = 0; | 290 virtual int TempCount() = 0; |
| 302 virtual LOperand* TempAt(int i) = 0; | 291 virtual LOperand* TempAt(int i) = 0; |
| 303 | 292 |
| 304 class IsCallBits: public BitField<bool, 0, 1> {}; | 293 class IsCallBits: public BitField<bool, 0, 1> {}; |
| 305 class PositionBits: public BitField<int, 1, 31> {}; | |
| 306 | 294 |
| 307 LEnvironment* environment_; | 295 LEnvironment* environment_; |
| 308 SetOncePointer<LPointerMap> pointer_map_; | 296 SetOncePointer<LPointerMap> pointer_map_; |
| 309 HValue* hydrogen_value_; | 297 HValue* hydrogen_value_; |
| 310 int bit_field_; | 298 int bit_field_; |
| 311 }; | 299 }; |
| 312 | 300 |
| 313 | 301 |
| 314 // R = number of result operands (0 or 1). | 302 // R = number of result operands (0 or 1). |
| 315 // I = number of input operands. | 303 // I = number of input operands. |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 virtual void SetDeferredLazyDeoptimizationEnvironment( | 1124 virtual void SetDeferredLazyDeoptimizationEnvironment( |
| 1137 LEnvironment* env) V8_OVERRIDE { | 1125 LEnvironment* env) V8_OVERRIDE { |
| 1138 lazy_deopt_env_ = env; | 1126 lazy_deopt_env_ = env; |
| 1139 } | 1127 } |
| 1140 | 1128 |
| 1141 private: | 1129 private: |
| 1142 LEnvironment* lazy_deopt_env_; | 1130 LEnvironment* lazy_deopt_env_; |
| 1143 }; | 1131 }; |
| 1144 | 1132 |
| 1145 | 1133 |
| 1146 class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
| 1147 public: | |
| 1148 explicit LInstanceSize(LOperand* object) { | |
| 1149 inputs_[0] = object; | |
| 1150 } | |
| 1151 | |
| 1152 LOperand* object() { return inputs_[0]; } | |
| 1153 | |
| 1154 DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size") | |
| 1155 DECLARE_HYDROGEN_ACCESSOR(InstanceSize) | |
| 1156 }; | |
| 1157 | |
| 1158 | |
| 1159 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { | 1134 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { |
| 1160 public: | 1135 public: |
| 1161 LBoundsCheck(LOperand* index, LOperand* length) { | 1136 LBoundsCheck(LOperand* index, LOperand* length) { |
| 1162 inputs_[0] = index; | 1137 inputs_[0] = index; |
| 1163 inputs_[1] = length; | 1138 inputs_[1] = length; |
| 1164 } | 1139 } |
| 1165 | 1140 |
| 1166 LOperand* index() { return inputs_[0]; } | 1141 LOperand* index() { return inputs_[0]; } |
| 1167 LOperand* length() { return inputs_[1]; } | 1142 LOperand* length() { return inputs_[1]; } |
| 1168 | 1143 |
| (...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2884 | 2859 |
| 2885 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2860 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2886 }; | 2861 }; |
| 2887 | 2862 |
| 2888 #undef DECLARE_HYDROGEN_ACCESSOR | 2863 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2889 #undef DECLARE_CONCRETE_INSTRUCTION | 2864 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2890 | 2865 |
| 2891 } } // namespace v8::internal | 2866 } } // namespace v8::internal |
| 2892 | 2867 |
| 2893 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2868 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
| OLD | NEW |