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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 Range(int32_t lower, int32_t upper) | 230 Range(int32_t lower, int32_t upper) |
231 : lower_(lower), | 231 : lower_(lower), |
232 upper_(upper), | 232 upper_(upper), |
233 next_(NULL), | 233 next_(NULL), |
234 can_be_minus_zero_(false) { } | 234 can_be_minus_zero_(false) { } |
235 | 235 |
236 int32_t upper() const { return upper_; } | 236 int32_t upper() const { return upper_; } |
237 int32_t lower() const { return lower_; } | 237 int32_t lower() const { return lower_; } |
238 Range* next() const { return next_; } | 238 Range* next() const { return next_; } |
239 Range* CopyClearLower() const { return new Range(kMinInt, upper_); } | 239 Range* CopyClearLower(Zone* zone) const { |
240 Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); } | 240 return new(zone) Range(kMinInt, upper_); |
241 Range* Copy() const { | 241 } |
242 Range* result = new Range(lower_, upper_); | 242 Range* CopyClearUpper(Zone* zone) const { |
| 243 return new(zone) Range(lower_, kMaxInt); |
| 244 } |
| 245 Range* Copy(Zone* zone) const { |
| 246 Range* result = new(zone) Range(lower_, upper_); |
243 result->set_can_be_minus_zero(CanBeMinusZero()); | 247 result->set_can_be_minus_zero(CanBeMinusZero()); |
244 return result; | 248 return result; |
245 } | 249 } |
246 int32_t Mask() const; | 250 int32_t Mask() const; |
247 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; } | 251 void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; } |
248 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; } | 252 bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; } |
249 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; } | 253 bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; } |
250 bool CanBeNegative() const { return lower_ < 0; } | 254 bool CanBeNegative() const { return lower_ < 0; } |
251 bool Includes(int value) const { return lower_ <= value && upper_ >= value; } | 255 bool Includes(int value) const { return lower_ <= value && upper_ >= value; } |
252 bool IsMostGeneric() const { | 256 bool IsMostGeneric() const { |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 680 |
677 GVNFlagSet ObservableChangesFlags() const { | 681 GVNFlagSet ObservableChangesFlags() const { |
678 GVNFlagSet result = gvn_flags_; | 682 GVNFlagSet result = gvn_flags_; |
679 result.Intersect(AllChangesFlagSet()); | 683 result.Intersect(AllChangesFlagSet()); |
680 result.Intersect(AllObservableSideEffectsFlagSet()); | 684 result.Intersect(AllObservableSideEffectsFlagSet()); |
681 return result; | 685 return result; |
682 } | 686 } |
683 | 687 |
684 Range* range() const { return range_; } | 688 Range* range() const { return range_; } |
685 bool HasRange() const { return range_ != NULL; } | 689 bool HasRange() const { return range_ != NULL; } |
686 void AddNewRange(Range* r); | 690 void AddNewRange(Range* r, Zone* zone); |
687 void RemoveLastAddedRange(); | 691 void RemoveLastAddedRange(); |
688 void ComputeInitialRange(); | 692 void ComputeInitialRange(Zone* zone); |
689 | 693 |
690 // Representation helpers. | 694 // Representation helpers. |
691 virtual Representation RequiredInputRepresentation(int index) = 0; | 695 virtual Representation RequiredInputRepresentation(int index) = 0; |
692 | 696 |
693 virtual Representation InferredRepresentation() { | 697 virtual Representation InferredRepresentation() { |
694 return representation(); | 698 return representation(); |
695 } | 699 } |
696 | 700 |
697 // This gives the instruction an opportunity to replace itself with an | 701 // This gives the instruction an opportunity to replace itself with an |
698 // instruction that does the same in some better way. To replace an | 702 // instruction that does the same in some better way. To replace an |
(...skipping 24 matching lines...) Expand all Loading... |
723 #endif | 727 #endif |
724 | 728 |
725 protected: | 729 protected: |
726 // This function must be overridden for instructions with flag kUseGVN, to | 730 // This function must be overridden for instructions with flag kUseGVN, to |
727 // compare the non-Operand parts of the instruction. | 731 // compare the non-Operand parts of the instruction. |
728 virtual bool DataEquals(HValue* other) { | 732 virtual bool DataEquals(HValue* other) { |
729 UNREACHABLE(); | 733 UNREACHABLE(); |
730 return false; | 734 return false; |
731 } | 735 } |
732 virtual void RepresentationChanged(Representation to) { } | 736 virtual void RepresentationChanged(Representation to) { } |
733 virtual Range* InferRange(); | 737 virtual Range* InferRange(Zone* zone); |
734 virtual void DeleteFromGraph() = 0; | 738 virtual void DeleteFromGraph() = 0; |
735 virtual void InternalSetOperandAt(int index, HValue* value) = 0; | 739 virtual void InternalSetOperandAt(int index, HValue* value) = 0; |
736 void clear_block() { | 740 void clear_block() { |
737 ASSERT(block_ != NULL); | 741 ASSERT(block_ != NULL); |
738 block_ = NULL; | 742 block_ = NULL; |
739 } | 743 } |
740 | 744 |
741 void set_representation(Representation r) { | 745 void set_representation(Representation r) { |
742 // Representation is set-once. | 746 // Representation is set-once. |
743 ASSERT(representation_.IsNone() && !r.IsNone()); | 747 ASSERT(representation_.IsNone() && !r.IsNone()); |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 bool deoptimize_on_undefined() const { | 1205 bool deoptimize_on_undefined() const { |
1202 return CheckFlag(kDeoptimizeOnUndefined); | 1206 return CheckFlag(kDeoptimizeOnUndefined); |
1203 } | 1207 } |
1204 bool deoptimize_on_minus_zero() const { | 1208 bool deoptimize_on_minus_zero() const { |
1205 return CheckFlag(kBailoutOnMinusZero); | 1209 return CheckFlag(kBailoutOnMinusZero); |
1206 } | 1210 } |
1207 virtual Representation RequiredInputRepresentation(int index) { | 1211 virtual Representation RequiredInputRepresentation(int index) { |
1208 return from(); | 1212 return from(); |
1209 } | 1213 } |
1210 | 1214 |
1211 virtual Range* InferRange(); | 1215 virtual Range* InferRange(Zone* zone); |
1212 | 1216 |
1213 virtual void PrintDataTo(StringStream* stream); | 1217 virtual void PrintDataTo(StringStream* stream); |
1214 | 1218 |
1215 DECLARE_CONCRETE_INSTRUCTION(Change) | 1219 DECLARE_CONCRETE_INSTRUCTION(Change) |
1216 | 1220 |
1217 protected: | 1221 protected: |
1218 virtual bool DataEquals(HValue* other) { return true; } | 1222 virtual bool DataEquals(HValue* other) { return true; } |
1219 }; | 1223 }; |
1220 | 1224 |
1221 | 1225 |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 if (value->representation().IsDouble()) double_occurred = true; | 2296 if (value->representation().IsDouble()) double_occurred = true; |
2293 if (value->representation().IsInteger32()) int32_occurred = true; | 2297 if (value->representation().IsInteger32()) int32_occurred = true; |
2294 if (value->representation().IsTagged()) return Representation::Tagged(); | 2298 if (value->representation().IsTagged()) return Representation::Tagged(); |
2295 } | 2299 } |
2296 | 2300 |
2297 if (double_occurred) return Representation::Double(); | 2301 if (double_occurred) return Representation::Double(); |
2298 if (int32_occurred) return Representation::Integer32(); | 2302 if (int32_occurred) return Representation::Integer32(); |
2299 return Representation::None(); | 2303 return Representation::None(); |
2300 } | 2304 } |
2301 | 2305 |
2302 virtual Range* InferRange(); | 2306 virtual Range* InferRange(Zone* zone); |
2303 virtual Representation RequiredInputRepresentation(int index) { | 2307 virtual Representation RequiredInputRepresentation(int index) { |
2304 return representation(); | 2308 return representation(); |
2305 } | 2309 } |
2306 virtual HType CalculateInferredType(); | 2310 virtual HType CalculateInferredType(); |
2307 virtual int OperandCount() { return inputs_.length(); } | 2311 virtual int OperandCount() { return inputs_.length(); } |
2308 virtual HValue* OperandAt(int index) { return inputs_[index]; } | 2312 virtual HValue* OperandAt(int index) { return inputs_[index]; } |
2309 HValue* GetRedundantReplacement(); | 2313 HValue* GetRedundantReplacement(); |
2310 void AddInput(HValue* value); | 2314 void AddInput(HValue* value); |
2311 bool HasRealUses(); | 2315 bool HasRealUses(); |
2312 | 2316 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 return hash ^ (hash >> kShiftSize); | 2474 return hash ^ (hash >> kShiftSize); |
2471 } | 2475 } |
2472 | 2476 |
2473 #ifdef DEBUG | 2477 #ifdef DEBUG |
2474 virtual void Verify() { } | 2478 virtual void Verify() { } |
2475 #endif | 2479 #endif |
2476 | 2480 |
2477 DECLARE_CONCRETE_INSTRUCTION(Constant) | 2481 DECLARE_CONCRETE_INSTRUCTION(Constant) |
2478 | 2482 |
2479 protected: | 2483 protected: |
2480 virtual Range* InferRange(); | 2484 virtual Range* InferRange(Zone* zone); |
2481 | 2485 |
2482 virtual bool DataEquals(HValue* other) { | 2486 virtual bool DataEquals(HValue* other) { |
2483 HConstant* other_constant = HConstant::cast(other); | 2487 HConstant* other_constant = HConstant::cast(other); |
2484 return handle().is_identical_to(other_constant->handle()); | 2488 return handle().is_identical_to(other_constant->handle()); |
2485 } | 2489 } |
2486 | 2490 |
2487 private: | 2491 private: |
2488 Handle<Object> handle_; | 2492 Handle<Object> handle_; |
2489 | 2493 |
2490 // The following two values represent the int32 and the double value of the | 2494 // The following two values represent the int32 and the double value of the |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 HValue* left, | 3152 HValue* left, |
3149 HValue* right); | 3153 HValue* right); |
3150 | 3154 |
3151 virtual HType CalculateInferredType(); | 3155 virtual HType CalculateInferredType(); |
3152 | 3156 |
3153 DECLARE_CONCRETE_INSTRUCTION(Add) | 3157 DECLARE_CONCRETE_INSTRUCTION(Add) |
3154 | 3158 |
3155 protected: | 3159 protected: |
3156 virtual bool DataEquals(HValue* other) { return true; } | 3160 virtual bool DataEquals(HValue* other) { return true; } |
3157 | 3161 |
3158 virtual Range* InferRange(); | 3162 virtual Range* InferRange(Zone* zone); |
3159 }; | 3163 }; |
3160 | 3164 |
3161 | 3165 |
3162 class HSub: public HArithmeticBinaryOperation { | 3166 class HSub: public HArithmeticBinaryOperation { |
3163 public: | 3167 public: |
3164 HSub(HValue* context, HValue* left, HValue* right) | 3168 HSub(HValue* context, HValue* left, HValue* right) |
3165 : HArithmeticBinaryOperation(context, left, right) { | 3169 : HArithmeticBinaryOperation(context, left, right) { |
3166 SetFlag(kCanOverflow); | 3170 SetFlag(kCanOverflow); |
3167 } | 3171 } |
3168 | 3172 |
3169 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 3173 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
3170 | 3174 |
3171 static HInstruction* NewHSub(Zone* zone, | 3175 static HInstruction* NewHSub(Zone* zone, |
3172 HValue* context, | 3176 HValue* context, |
3173 HValue* left, | 3177 HValue* left, |
3174 HValue* right); | 3178 HValue* right); |
3175 | 3179 |
3176 DECLARE_CONCRETE_INSTRUCTION(Sub) | 3180 DECLARE_CONCRETE_INSTRUCTION(Sub) |
3177 | 3181 |
3178 protected: | 3182 protected: |
3179 virtual bool DataEquals(HValue* other) { return true; } | 3183 virtual bool DataEquals(HValue* other) { return true; } |
3180 | 3184 |
3181 virtual Range* InferRange(); | 3185 virtual Range* InferRange(Zone* zone); |
3182 }; | 3186 }; |
3183 | 3187 |
3184 | 3188 |
3185 class HMul: public HArithmeticBinaryOperation { | 3189 class HMul: public HArithmeticBinaryOperation { |
3186 public: | 3190 public: |
3187 HMul(HValue* context, HValue* left, HValue* right) | 3191 HMul(HValue* context, HValue* left, HValue* right) |
3188 : HArithmeticBinaryOperation(context, left, right) { | 3192 : HArithmeticBinaryOperation(context, left, right) { |
3189 SetFlag(kCanOverflow); | 3193 SetFlag(kCanOverflow); |
3190 } | 3194 } |
3191 | 3195 |
3192 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 3196 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
3193 | 3197 |
3194 // Only commutative if it is certain that not two objects are multiplicated. | 3198 // Only commutative if it is certain that not two objects are multiplicated. |
3195 virtual bool IsCommutative() const { | 3199 virtual bool IsCommutative() const { |
3196 return !representation().IsTagged(); | 3200 return !representation().IsTagged(); |
3197 } | 3201 } |
3198 | 3202 |
3199 static HInstruction* NewHMul(Zone* zone, | 3203 static HInstruction* NewHMul(Zone* zone, |
3200 HValue* context, | 3204 HValue* context, |
3201 HValue* left, | 3205 HValue* left, |
3202 HValue* right); | 3206 HValue* right); |
3203 | 3207 |
3204 DECLARE_CONCRETE_INSTRUCTION(Mul) | 3208 DECLARE_CONCRETE_INSTRUCTION(Mul) |
3205 | 3209 |
3206 protected: | 3210 protected: |
3207 virtual bool DataEquals(HValue* other) { return true; } | 3211 virtual bool DataEquals(HValue* other) { return true; } |
3208 | 3212 |
3209 virtual Range* InferRange(); | 3213 virtual Range* InferRange(Zone* zone); |
3210 }; | 3214 }; |
3211 | 3215 |
3212 | 3216 |
3213 class HMod: public HArithmeticBinaryOperation { | 3217 class HMod: public HArithmeticBinaryOperation { |
3214 public: | 3218 public: |
3215 HMod(HValue* context, HValue* left, HValue* right) | 3219 HMod(HValue* context, HValue* left, HValue* right) |
3216 : HArithmeticBinaryOperation(context, left, right) { | 3220 : HArithmeticBinaryOperation(context, left, right) { |
3217 SetFlag(kCanBeDivByZero); | 3221 SetFlag(kCanBeDivByZero); |
3218 } | 3222 } |
3219 | 3223 |
(...skipping 12 matching lines...) Expand all Loading... |
3232 static HInstruction* NewHMod(Zone* zone, | 3236 static HInstruction* NewHMod(Zone* zone, |
3233 HValue* context, | 3237 HValue* context, |
3234 HValue* left, | 3238 HValue* left, |
3235 HValue* right); | 3239 HValue* right); |
3236 | 3240 |
3237 DECLARE_CONCRETE_INSTRUCTION(Mod) | 3241 DECLARE_CONCRETE_INSTRUCTION(Mod) |
3238 | 3242 |
3239 protected: | 3243 protected: |
3240 virtual bool DataEquals(HValue* other) { return true; } | 3244 virtual bool DataEquals(HValue* other) { return true; } |
3241 | 3245 |
3242 virtual Range* InferRange(); | 3246 virtual Range* InferRange(Zone* zone); |
3243 }; | 3247 }; |
3244 | 3248 |
3245 | 3249 |
3246 class HDiv: public HArithmeticBinaryOperation { | 3250 class HDiv: public HArithmeticBinaryOperation { |
3247 public: | 3251 public: |
3248 HDiv(HValue* context, HValue* left, HValue* right) | 3252 HDiv(HValue* context, HValue* left, HValue* right) |
3249 : HArithmeticBinaryOperation(context, left, right) { | 3253 : HArithmeticBinaryOperation(context, left, right) { |
3250 SetFlag(kCanBeDivByZero); | 3254 SetFlag(kCanBeDivByZero); |
3251 SetFlag(kCanOverflow); | 3255 SetFlag(kCanOverflow); |
3252 } | 3256 } |
3253 | 3257 |
3254 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 3258 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
3255 | 3259 |
3256 | 3260 |
3257 static HInstruction* NewHDiv(Zone* zone, | 3261 static HInstruction* NewHDiv(Zone* zone, |
3258 HValue* context, | 3262 HValue* context, |
3259 HValue* left, | 3263 HValue* left, |
3260 HValue* right); | 3264 HValue* right); |
3261 | 3265 |
3262 DECLARE_CONCRETE_INSTRUCTION(Div) | 3266 DECLARE_CONCRETE_INSTRUCTION(Div) |
3263 | 3267 |
3264 protected: | 3268 protected: |
3265 virtual bool DataEquals(HValue* other) { return true; } | 3269 virtual bool DataEquals(HValue* other) { return true; } |
3266 | 3270 |
3267 virtual Range* InferRange(); | 3271 virtual Range* InferRange(Zone* zone); |
3268 }; | 3272 }; |
3269 | 3273 |
3270 | 3274 |
3271 class HBitwise: public HBitwiseBinaryOperation { | 3275 class HBitwise: public HBitwiseBinaryOperation { |
3272 public: | 3276 public: |
3273 HBitwise(Token::Value op, HValue* context, HValue* left, HValue* right) | 3277 HBitwise(Token::Value op, HValue* context, HValue* left, HValue* right) |
3274 : HBitwiseBinaryOperation(context, left, right), op_(op) { | 3278 : HBitwiseBinaryOperation(context, left, right), op_(op) { |
3275 ASSERT(op == Token::BIT_AND || | 3279 ASSERT(op == Token::BIT_AND || |
3276 op == Token::BIT_OR || | 3280 op == Token::BIT_OR || |
3277 op == Token::BIT_XOR); | 3281 op == Token::BIT_XOR); |
(...skipping 11 matching lines...) Expand all Loading... |
3289 HValue* left, | 3293 HValue* left, |
3290 HValue* right); | 3294 HValue* right); |
3291 | 3295 |
3292 DECLARE_CONCRETE_INSTRUCTION(Bitwise) | 3296 DECLARE_CONCRETE_INSTRUCTION(Bitwise) |
3293 | 3297 |
3294 protected: | 3298 protected: |
3295 virtual bool DataEquals(HValue* other) { | 3299 virtual bool DataEquals(HValue* other) { |
3296 return op() == HBitwise::cast(other)->op(); | 3300 return op() == HBitwise::cast(other)->op(); |
3297 } | 3301 } |
3298 | 3302 |
3299 virtual Range* InferRange(); | 3303 virtual Range* InferRange(Zone* zone); |
3300 | 3304 |
3301 private: | 3305 private: |
3302 Token::Value op_; | 3306 Token::Value op_; |
3303 }; | 3307 }; |
3304 | 3308 |
3305 | 3309 |
3306 class HShl: public HBitwiseBinaryOperation { | 3310 class HShl: public HBitwiseBinaryOperation { |
3307 public: | 3311 public: |
3308 HShl(HValue* context, HValue* left, HValue* right) | 3312 HShl(HValue* context, HValue* left, HValue* right) |
3309 : HBitwiseBinaryOperation(context, left, right) { } | 3313 : HBitwiseBinaryOperation(context, left, right) { } |
3310 | 3314 |
3311 virtual Range* InferRange(); | 3315 virtual Range* InferRange(Zone* zone); |
3312 | 3316 |
3313 static HInstruction* NewHShl(Zone* zone, | 3317 static HInstruction* NewHShl(Zone* zone, |
3314 HValue* context, | 3318 HValue* context, |
3315 HValue* left, | 3319 HValue* left, |
3316 HValue* right); | 3320 HValue* right); |
3317 | 3321 |
3318 DECLARE_CONCRETE_INSTRUCTION(Shl) | 3322 DECLARE_CONCRETE_INSTRUCTION(Shl) |
3319 | 3323 |
3320 protected: | 3324 protected: |
3321 virtual bool DataEquals(HValue* other) { return true; } | 3325 virtual bool DataEquals(HValue* other) { return true; } |
3322 }; | 3326 }; |
3323 | 3327 |
3324 | 3328 |
3325 class HShr: public HBitwiseBinaryOperation { | 3329 class HShr: public HBitwiseBinaryOperation { |
3326 public: | 3330 public: |
3327 HShr(HValue* context, HValue* left, HValue* right) | 3331 HShr(HValue* context, HValue* left, HValue* right) |
3328 : HBitwiseBinaryOperation(context, left, right) { } | 3332 : HBitwiseBinaryOperation(context, left, right) { } |
3329 | 3333 |
3330 virtual Range* InferRange(); | 3334 virtual Range* InferRange(Zone* zone); |
3331 | 3335 |
3332 static HInstruction* NewHShr(Zone* zone, | 3336 static HInstruction* NewHShr(Zone* zone, |
3333 HValue* context, | 3337 HValue* context, |
3334 HValue* left, | 3338 HValue* left, |
3335 HValue* right); | 3339 HValue* right); |
3336 | 3340 |
3337 DECLARE_CONCRETE_INSTRUCTION(Shr) | 3341 DECLARE_CONCRETE_INSTRUCTION(Shr) |
3338 | 3342 |
3339 protected: | 3343 protected: |
3340 virtual bool DataEquals(HValue* other) { return true; } | 3344 virtual bool DataEquals(HValue* other) { return true; } |
3341 }; | 3345 }; |
3342 | 3346 |
3343 | 3347 |
3344 class HSar: public HBitwiseBinaryOperation { | 3348 class HSar: public HBitwiseBinaryOperation { |
3345 public: | 3349 public: |
3346 HSar(HValue* context, HValue* left, HValue* right) | 3350 HSar(HValue* context, HValue* left, HValue* right) |
3347 : HBitwiseBinaryOperation(context, left, right) { } | 3351 : HBitwiseBinaryOperation(context, left, right) { } |
3348 | 3352 |
3349 virtual Range* InferRange(); | 3353 virtual Range* InferRange(Zone* zone); |
3350 | 3354 |
3351 static HInstruction* NewHSar(Zone* zone, | 3355 static HInstruction* NewHSar(Zone* zone, |
3352 HValue* context, | 3356 HValue* context, |
3353 HValue* left, | 3357 HValue* left, |
3354 HValue* right); | 3358 HValue* right); |
3355 | 3359 |
3356 DECLARE_CONCRETE_INSTRUCTION(Sar) | 3360 DECLARE_CONCRETE_INSTRUCTION(Sar) |
3357 | 3361 |
3358 protected: | 3362 protected: |
3359 virtual bool DataEquals(HValue* other) { return true; } | 3363 virtual bool DataEquals(HValue* other) { return true; } |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3929 // for the element load is a naked pointer. | 3933 // for the element load is a naked pointer. |
3930 return index == 0 | 3934 return index == 0 |
3931 ? Representation::External() | 3935 ? Representation::External() |
3932 : Representation::Integer32(); | 3936 : Representation::Integer32(); |
3933 } | 3937 } |
3934 | 3938 |
3935 HValue* external_pointer() { return OperandAt(0); } | 3939 HValue* external_pointer() { return OperandAt(0); } |
3936 HValue* key() { return OperandAt(1); } | 3940 HValue* key() { return OperandAt(1); } |
3937 ElementsKind elements_kind() const { return elements_kind_; } | 3941 ElementsKind elements_kind() const { return elements_kind_; } |
3938 | 3942 |
3939 virtual Range* InferRange(); | 3943 virtual Range* InferRange(Zone* zone); |
3940 | 3944 |
3941 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement) | 3945 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement) |
3942 | 3946 |
3943 protected: | 3947 protected: |
3944 virtual bool DataEquals(HValue* other) { | 3948 virtual bool DataEquals(HValue* other) { |
3945 if (!other->IsLoadKeyedSpecializedArrayElement()) return false; | 3949 if (!other->IsLoadKeyedSpecializedArrayElement()) return false; |
3946 HLoadKeyedSpecializedArrayElement* cast_other = | 3950 HLoadKeyedSpecializedArrayElement* cast_other = |
3947 HLoadKeyedSpecializedArrayElement::cast(other); | 3951 HLoadKeyedSpecializedArrayElement::cast(other); |
3948 return elements_kind_ == cast_other->elements_kind(); | 3952 return elements_kind_ == cast_other->elements_kind(); |
3949 } | 3953 } |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4297 | 4301 |
4298 HValue* context() { return OperandAt(0); } | 4302 HValue* context() { return OperandAt(0); } |
4299 HValue* string() { return OperandAt(1); } | 4303 HValue* string() { return OperandAt(1); } |
4300 HValue* index() { return OperandAt(2); } | 4304 HValue* index() { return OperandAt(2); } |
4301 | 4305 |
4302 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt) | 4306 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt) |
4303 | 4307 |
4304 protected: | 4308 protected: |
4305 virtual bool DataEquals(HValue* other) { return true; } | 4309 virtual bool DataEquals(HValue* other) { return true; } |
4306 | 4310 |
4307 virtual Range* InferRange() { | 4311 virtual Range* InferRange(Zone* zone) { |
4308 return new Range(0, String::kMaxUC16CharCode); | 4312 return new(zone) Range(0, String::kMaxUC16CharCode); |
4309 } | 4313 } |
4310 }; | 4314 }; |
4311 | 4315 |
4312 | 4316 |
4313 class HStringCharFromCode: public HTemplateInstruction<2> { | 4317 class HStringCharFromCode: public HTemplateInstruction<2> { |
4314 public: | 4318 public: |
4315 HStringCharFromCode(HValue* context, HValue* char_code) { | 4319 HStringCharFromCode(HValue* context, HValue* char_code) { |
4316 SetOperandAt(0, context); | 4320 SetOperandAt(0, context); |
4317 SetOperandAt(1, char_code); | 4321 SetOperandAt(1, char_code); |
4318 set_representation(Representation::Tagged()); | 4322 set_representation(Representation::Tagged()); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4350 virtual HType CalculateInferredType() { | 4354 virtual HType CalculateInferredType() { |
4351 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); | 4355 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); |
4352 return HType::Smi(); | 4356 return HType::Smi(); |
4353 } | 4357 } |
4354 | 4358 |
4355 DECLARE_CONCRETE_INSTRUCTION(StringLength) | 4359 DECLARE_CONCRETE_INSTRUCTION(StringLength) |
4356 | 4360 |
4357 protected: | 4361 protected: |
4358 virtual bool DataEquals(HValue* other) { return true; } | 4362 virtual bool DataEquals(HValue* other) { return true; } |
4359 | 4363 |
4360 virtual Range* InferRange() { | 4364 virtual Range* InferRange(Zone* zone) { |
4361 return new Range(0, String::kMaxLength); | 4365 return new(zone) Range(0, String::kMaxLength); |
4362 } | 4366 } |
4363 }; | 4367 }; |
4364 | 4368 |
4365 | 4369 |
4366 class HAllocateObject: public HTemplateInstruction<1> { | 4370 class HAllocateObject: public HTemplateInstruction<1> { |
4367 public: | 4371 public: |
4368 HAllocateObject(HValue* context, Handle<JSFunction> constructor) | 4372 HAllocateObject(HValue* context, Handle<JSFunction> constructor) |
4369 : constructor_(constructor) { | 4373 : constructor_(constructor) { |
4370 SetOperandAt(0, context); | 4374 SetOperandAt(0, context); |
4371 set_representation(Representation::Tagged()); | 4375 set_representation(Representation::Tagged()); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4799 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 4803 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
4800 }; | 4804 }; |
4801 | 4805 |
4802 | 4806 |
4803 #undef DECLARE_INSTRUCTION | 4807 #undef DECLARE_INSTRUCTION |
4804 #undef DECLARE_CONCRETE_INSTRUCTION | 4808 #undef DECLARE_CONCRETE_INSTRUCTION |
4805 | 4809 |
4806 } } // namespace v8::internal | 4810 } } // namespace v8::internal |
4807 | 4811 |
4808 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4812 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |