| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 V(RSubI) \ | 177 V(RSubI) \ |
| 179 V(TaggedToI) \ | 178 V(TaggedToI) \ |
| 180 V(ThisFunction) \ | 179 V(ThisFunction) \ |
| 181 V(Throw) \ | 180 V(Throw) \ |
| 182 V(ToFastProperties) \ | 181 V(ToFastProperties) \ |
| 183 V(TransitionElementsKind) \ | 182 V(TransitionElementsKind) \ |
| 184 V(TrapAllocationMemento) \ | 183 V(TrapAllocationMemento) \ |
| 185 V(Typeof) \ | 184 V(Typeof) \ |
| 186 V(TypeofIsAndBranch) \ | 185 V(TypeofIsAndBranch) \ |
| 187 V(Uint32ToDouble) \ | 186 V(Uint32ToDouble) \ |
| 187 V(Uint32ToSmi) \ |
| 188 V(UnknownOSRValue) \ | 188 V(UnknownOSRValue) \ |
| 189 V(ValueOf) \ | 189 V(ValueOf) \ |
| 190 V(WrapReceiver) | 190 V(WrapReceiver) |
| 191 | 191 |
| 192 | 192 |
| 193 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 193 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 194 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 194 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
| 195 return LInstruction::k##type; \ | 195 return LInstruction::k##type; \ |
| 196 } \ | 196 } \ |
| 197 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 197 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 209 return H##type::cast(hydrogen_value()); \ | 209 return H##type::cast(hydrogen_value()); \ |
| 210 } | 210 } |
| 211 | 211 |
| 212 | 212 |
| 213 class LInstruction : public ZoneObject { | 213 class LInstruction : public ZoneObject { |
| 214 public: | 214 public: |
| 215 LInstruction() | 215 LInstruction() |
| 216 : environment_(NULL), | 216 : environment_(NULL), |
| 217 hydrogen_value_(NULL), | 217 hydrogen_value_(NULL), |
| 218 bit_field_(IsCallBits::encode(false)) { | 218 bit_field_(IsCallBits::encode(false)) { |
| 219 set_position(RelocInfo::kNoPosition); | |
| 220 } | 219 } |
| 221 | 220 |
| 222 virtual ~LInstruction() {} | 221 virtual ~LInstruction() {} |
| 223 | 222 |
| 224 virtual void CompileToNative(LCodeGen* generator) = 0; | 223 virtual void CompileToNative(LCodeGen* generator) = 0; |
| 225 virtual const char* Mnemonic() const = 0; | 224 virtual const char* Mnemonic() const = 0; |
| 226 virtual void PrintTo(StringStream* stream); | 225 virtual void PrintTo(StringStream* stream); |
| 227 virtual void PrintDataTo(StringStream* stream); | 226 virtual void PrintDataTo(StringStream* stream); |
| 228 virtual void PrintOutputOperandTo(StringStream* stream); | 227 virtual void PrintOutputOperandTo(StringStream* stream); |
| 229 | 228 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 250 virtual bool IsControl() const { return false; } | 249 virtual bool IsControl() const { return false; } |
| 251 | 250 |
| 252 void set_environment(LEnvironment* env) { environment_ = env; } | 251 void set_environment(LEnvironment* env) { environment_ = env; } |
| 253 LEnvironment* environment() const { return environment_; } | 252 LEnvironment* environment() const { return environment_; } |
| 254 bool HasEnvironment() const { return environment_ != NULL; } | 253 bool HasEnvironment() const { return environment_ != NULL; } |
| 255 | 254 |
| 256 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 255 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 257 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 256 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 258 bool HasPointerMap() const { return pointer_map_.is_set(); } | 257 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 259 | 258 |
| 260 // The 31 bits PositionBits is used to store the int position value. And the | |
| 261 // position value may be RelocInfo::kNoPosition (-1). The accessor always | |
| 262 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0 | |
| 263 // and can fit into the 31 bits PositionBits. | |
| 264 void set_position(int pos) { | |
| 265 bit_field_ = PositionBits::update(bit_field_, pos + 1); | |
| 266 } | |
| 267 int position() { return PositionBits::decode(bit_field_) - 1; } | |
| 268 | |
| 269 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 259 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 270 HValue* hydrogen_value() const { return hydrogen_value_; } | 260 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 271 | 261 |
| 272 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 262 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 273 | 263 |
| 274 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 264 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 275 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 265 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 276 | 266 |
| 277 // Interface to the register allocator and iterators. | 267 // Interface to the register allocator and iterators. |
| 278 bool ClobbersTemps() const { return IsCall(); } | 268 bool ClobbersTemps() const { return IsCall(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 298 // Iterator support. | 288 // Iterator support. |
| 299 friend class InputIterator; | 289 friend class InputIterator; |
| 300 virtual int InputCount() = 0; | 290 virtual int InputCount() = 0; |
| 301 virtual LOperand* InputAt(int i) = 0; | 291 virtual LOperand* InputAt(int i) = 0; |
| 302 | 292 |
| 303 friend class TempIterator; | 293 friend class TempIterator; |
| 304 virtual int TempCount() = 0; | 294 virtual int TempCount() = 0; |
| 305 virtual LOperand* TempAt(int i) = 0; | 295 virtual LOperand* TempAt(int i) = 0; |
| 306 | 296 |
| 307 class IsCallBits: public BitField<bool, 0, 1> {}; | 297 class IsCallBits: public BitField<bool, 0, 1> {}; |
| 308 class PositionBits: public BitField<int, 1, 31> {}; | |
| 309 | 298 |
| 310 LEnvironment* environment_; | 299 LEnvironment* environment_; |
| 311 SetOncePointer<LPointerMap> pointer_map_; | 300 SetOncePointer<LPointerMap> pointer_map_; |
| 312 HValue* hydrogen_value_; | 301 HValue* hydrogen_value_; |
| 313 int bit_field_; | 302 int bit_field_; |
| 314 }; | 303 }; |
| 315 | 304 |
| 316 | 305 |
| 317 // R = number of result operands (0 or 1). | 306 // R = number of result operands (0 or 1). |
| 318 // I = number of input operands. | 307 // I = number of input operands. |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 virtual void SetDeferredLazyDeoptimizationEnvironment( | 1130 virtual void SetDeferredLazyDeoptimizationEnvironment( |
| 1142 LEnvironment* env) V8_OVERRIDE { | 1131 LEnvironment* env) V8_OVERRIDE { |
| 1143 lazy_deopt_env_ = env; | 1132 lazy_deopt_env_ = env; |
| 1144 } | 1133 } |
| 1145 | 1134 |
| 1146 private: | 1135 private: |
| 1147 LEnvironment* lazy_deopt_env_; | 1136 LEnvironment* lazy_deopt_env_; |
| 1148 }; | 1137 }; |
| 1149 | 1138 |
| 1150 | 1139 |
| 1151 class LInstanceSize V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
| 1152 public: | |
| 1153 explicit LInstanceSize(LOperand* object) { | |
| 1154 inputs_[0] = object; | |
| 1155 } | |
| 1156 | |
| 1157 LOperand* object() { return inputs_[0]; } | |
| 1158 | |
| 1159 DECLARE_CONCRETE_INSTRUCTION(InstanceSize, "instance-size") | |
| 1160 DECLARE_HYDROGEN_ACCESSOR(InstanceSize) | |
| 1161 }; | |
| 1162 | |
| 1163 | |
| 1164 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { | 1140 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { |
| 1165 public: | 1141 public: |
| 1166 LBoundsCheck(LOperand* index, LOperand* length) { | 1142 LBoundsCheck(LOperand* index, LOperand* length) { |
| 1167 inputs_[0] = index; | 1143 inputs_[0] = index; |
| 1168 inputs_[1] = length; | 1144 inputs_[1] = length; |
| 1169 } | 1145 } |
| 1170 | 1146 |
| 1171 LOperand* index() { return inputs_[0]; } | 1147 LOperand* index() { return inputs_[0]; } |
| 1172 LOperand* length() { return inputs_[1]; } | 1148 LOperand* length() { return inputs_[1]; } |
| 1173 | 1149 |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 explicit LUint32ToDouble(LOperand* value) { | 2068 explicit LUint32ToDouble(LOperand* value) { |
| 2093 inputs_[0] = value; | 2069 inputs_[0] = value; |
| 2094 } | 2070 } |
| 2095 | 2071 |
| 2096 LOperand* value() { return inputs_[0]; } | 2072 LOperand* value() { return inputs_[0]; } |
| 2097 | 2073 |
| 2098 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 2074 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 2099 }; | 2075 }; |
| 2100 | 2076 |
| 2101 | 2077 |
| 2078 class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2079 public: |
| 2080 explicit LUint32ToSmi(LOperand* value) { |
| 2081 inputs_[0] = value; |
| 2082 } |
| 2083 |
| 2084 LOperand* value() { return inputs_[0]; } |
| 2085 |
| 2086 DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi") |
| 2087 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2088 }; |
| 2089 |
| 2090 |
| 2102 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2091 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2103 public: | 2092 public: |
| 2104 explicit LNumberTagI(LOperand* value) { | 2093 explicit LNumberTagI(LOperand* value) { |
| 2105 inputs_[0] = value; | 2094 inputs_[0] = value; |
| 2106 } | 2095 } |
| 2107 | 2096 |
| 2108 LOperand* value() { return inputs_[0]; } | 2097 LOperand* value() { return inputs_[0]; } |
| 2109 | 2098 |
| 2110 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 2099 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
| 2111 }; | 2100 }; |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2911 | 2900 |
| 2912 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2901 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2913 }; | 2902 }; |
| 2914 | 2903 |
| 2915 #undef DECLARE_HYDROGEN_ACCESSOR | 2904 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2916 #undef DECLARE_CONCRETE_INSTRUCTION | 2905 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2917 | 2906 |
| 2918 } } // namespace v8::internal | 2907 } } // namespace v8::internal |
| 2919 | 2908 |
| 2920 #endif // V8_ARM_LITHIUM_ARM_H_ | 2909 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |