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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "allocation.h" | 33 #include "allocation.h" |
34 #include "code-stubs.h" | 34 #include "code-stubs.h" |
35 #include "data-flow.h" | 35 #include "data-flow.h" |
36 #include "small-pointer-list.h" | 36 #include "small-pointer-list.h" |
37 #include "string-stream.h" | 37 #include "string-stream.h" |
38 #include "v8conversions.h" | 38 #include "v8conversions.h" |
39 #include "v8utils.h" | 39 #include "v8utils.h" |
40 #include "zone.h" | 40 #include "zone.h" |
41 | 41 |
| 42 |
42 namespace v8 { | 43 namespace v8 { |
43 namespace internal { | 44 namespace internal { |
44 | 45 |
45 // Forward declarations. | 46 // Forward declarations. |
46 class HBasicBlock; | 47 class HBasicBlock; |
47 class HEnvironment; | 48 class HEnvironment; |
48 class HInferRepresentation; | 49 class HInferRepresentation; |
49 class HInstruction; | 50 class HInstruction; |
50 class HLoopInformation; | 51 class HLoopInformation; |
51 class HValue; | 52 class HValue; |
(...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3043 | 3044 |
3044 private: | 3045 private: |
3045 ZoneList<Handle<JSObject> > prototypes_; | 3046 ZoneList<Handle<JSObject> > prototypes_; |
3046 ZoneList<Handle<Map> > maps_; | 3047 ZoneList<Handle<Map> > maps_; |
3047 UniqueValueId first_prototype_unique_id_; | 3048 UniqueValueId first_prototype_unique_id_; |
3048 UniqueValueId last_prototype_unique_id_; | 3049 UniqueValueId last_prototype_unique_id_; |
3049 bool can_omit_prototype_maps_; | 3050 bool can_omit_prototype_maps_; |
3050 }; | 3051 }; |
3051 | 3052 |
3052 | 3053 |
| 3054 class InductionVariableData; |
| 3055 |
| 3056 |
| 3057 struct InductionVariableLimitUpdate { |
| 3058 InductionVariableData* updated_variable; |
| 3059 HValue* limit; |
| 3060 bool limit_is_upper; |
| 3061 bool limit_is_included; |
| 3062 |
| 3063 InductionVariableLimitUpdate() |
| 3064 : updated_variable(NULL), limit(NULL), |
| 3065 limit_is_upper(false), limit_is_included(false) {} |
| 3066 }; |
| 3067 |
| 3068 |
| 3069 class HBoundsCheck; |
| 3070 class HPhi; |
| 3071 class HConstant; |
| 3072 class HBitwise; |
| 3073 |
| 3074 |
| 3075 class InductionVariableData : public ZoneObject { |
| 3076 public: |
| 3077 class InductionVariableCheck : public ZoneObject { |
| 3078 public: |
| 3079 HBoundsCheck* check() { return check_; } |
| 3080 InductionVariableCheck* next() { return next_; } |
| 3081 bool HasUpperLimit() { return upper_limit_ >= 0; } |
| 3082 int32_t upper_limit() { |
| 3083 ASSERT(HasUpperLimit()); |
| 3084 return upper_limit_; |
| 3085 } |
| 3086 void set_upper_limit(int32_t upper_limit) { |
| 3087 upper_limit_ = upper_limit; |
| 3088 } |
| 3089 |
| 3090 bool processed() { return processed_; } |
| 3091 void set_processed() { processed_ = true; } |
| 3092 |
| 3093 InductionVariableCheck(HBoundsCheck* check, |
| 3094 InductionVariableCheck* next, |
| 3095 int32_t upper_limit = kNoLimit) |
| 3096 : check_(check), next_(next), upper_limit_(upper_limit), |
| 3097 processed_(false) {} |
| 3098 |
| 3099 private: |
| 3100 HBoundsCheck* check_; |
| 3101 InductionVariableCheck* next_; |
| 3102 int32_t upper_limit_; |
| 3103 bool processed_; |
| 3104 }; |
| 3105 |
| 3106 class ChecksRelatedToLength : public ZoneObject { |
| 3107 public: |
| 3108 HValue* length() { return length_; } |
| 3109 ChecksRelatedToLength* next() { return next_; } |
| 3110 InductionVariableCheck* checks() { return checks_; } |
| 3111 |
| 3112 void AddCheck(HBoundsCheck* check, int32_t upper_limit = kNoLimit); |
| 3113 void CloseCurrentBlock(); |
| 3114 |
| 3115 ChecksRelatedToLength(HValue* length, ChecksRelatedToLength* next) |
| 3116 : length_(length), next_(next), checks_(NULL), |
| 3117 first_check_in_block_(NULL), |
| 3118 added_index_(NULL), |
| 3119 added_constant_(NULL), |
| 3120 current_and_mask_in_block_(0), |
| 3121 current_or_mask_in_block_(0) {} |
| 3122 |
| 3123 private: |
| 3124 void UseNewIndexInCurrentBlock(Token::Value token, |
| 3125 int32_t mask, |
| 3126 HValue* index_base, |
| 3127 HValue* context); |
| 3128 |
| 3129 HBoundsCheck* first_check_in_block() { return first_check_in_block_; } |
| 3130 HBitwise* added_index() { return added_index_; } |
| 3131 HConstant* added_constant() { return added_constant_; } |
| 3132 int32_t current_and_mask_in_block() { return current_and_mask_in_block_; } |
| 3133 int32_t current_or_mask_in_block() { return current_or_mask_in_block_; } |
| 3134 int32_t current_upper_limit() { return current_upper_limit_; } |
| 3135 |
| 3136 HValue* length_; |
| 3137 ChecksRelatedToLength* next_; |
| 3138 InductionVariableCheck* checks_; |
| 3139 |
| 3140 HBoundsCheck* first_check_in_block_; |
| 3141 HBitwise* added_index_; |
| 3142 HConstant* added_constant_; |
| 3143 int32_t current_and_mask_in_block_; |
| 3144 int32_t current_or_mask_in_block_; |
| 3145 int32_t current_upper_limit_; |
| 3146 }; |
| 3147 |
| 3148 static const int32_t kNoLimit = -1; |
| 3149 |
| 3150 static InductionVariableData* ExaminePhi(HPhi* phi); |
| 3151 static bool ComputeInductionVariableLimit( |
| 3152 HBasicBlock* block, |
| 3153 InductionVariableLimitUpdate* additional_limit); |
| 3154 |
| 3155 struct BitwiseDecompositionResult { |
| 3156 HValue* base; |
| 3157 int32_t and_mask; |
| 3158 int32_t or_mask; |
| 3159 HValue* context; |
| 3160 }; |
| 3161 static void DecomposeBitwise(HValue* value, |
| 3162 BitwiseDecompositionResult* result); |
| 3163 |
| 3164 void AddCheck(HBoundsCheck* check, int32_t upper_limit = kNoLimit); |
| 3165 |
| 3166 bool CheckIfBranchIsLoopGuard(HBasicBlock* in_branch, |
| 3167 HBasicBlock* out_branch); |
| 3168 |
| 3169 void UpdateAdditionalLimit(InductionVariableLimitUpdate* update) { |
| 3170 ASSERT(update->updated_variable == this); |
| 3171 if (update->limit_is_upper) { |
| 3172 swap(&additional_upper_limit_, &update->limit); |
| 3173 swap(&additional_upper_limit_is_included_, &update->limit_is_included); |
| 3174 } else { |
| 3175 swap(&additional_lower_limit_, &update->limit); |
| 3176 swap(&additional_lower_limit_is_included_, &update->limit_is_included); |
| 3177 } |
| 3178 } |
| 3179 |
| 3180 HPhi* phi() { return phi_; } |
| 3181 HValue* base() { return base_; } |
| 3182 int32_t increment() { return increment_; } |
| 3183 HValue* limit() { return limit_; } |
| 3184 bool limit_included() { return limit_included_; } |
| 3185 HBasicBlock* limit_validity() { return limit_validity_; } |
| 3186 HBasicBlock* induction_exit_block() { return induction_exit_block_; } |
| 3187 HBasicBlock* induction_exit_target() { return induction_exit_target_; } |
| 3188 ChecksRelatedToLength* checks() { return checks_; } |
| 3189 HValue* additional_upper_limit() { return additional_upper_limit_; } |
| 3190 bool additional_upper_limit_is_included() { |
| 3191 return additional_upper_limit_is_included_; |
| 3192 } |
| 3193 HValue* additional_lower_limit() { return additional_lower_limit_; } |
| 3194 bool additional_lower_limit_is_included() { |
| 3195 return additional_lower_limit_is_included_; |
| 3196 } |
| 3197 |
| 3198 bool lower_limit_is_non_negative_constant() { |
| 3199 if (base()->IsInteger32Constant() && base()->GetInteger32Constant() >= 0) { |
| 3200 return true; |
| 3201 } |
| 3202 if (additional_lower_limit() != NULL && |
| 3203 additional_lower_limit()->IsInteger32Constant() && |
| 3204 additional_lower_limit()->GetInteger32Constant() >= 0) { |
| 3205 // Ignoring the corner case of !additional_lower_limit_is_included() |
| 3206 // is safe, handling it adds unneeded complexity. |
| 3207 return true; |
| 3208 } |
| 3209 return false; |
| 3210 } |
| 3211 |
| 3212 int32_t ComputeUpperLimit(int32_t and_mask, int32_t or_mask) { |
| 3213 // Should be Smi::kMaxValue but it must fit 32 bits; lower is safe anyway. |
| 3214 const int32_t MAX_LIMIT = 1 << 30; |
| 3215 |
| 3216 int32_t result = MAX_LIMIT; |
| 3217 |
| 3218 if (limit() != NULL && |
| 3219 limit()->IsInteger32Constant()) { |
| 3220 int32_t limit_value = limit()->GetInteger32Constant(); |
| 3221 if (!limit_included()) { |
| 3222 limit_value--; |
| 3223 } |
| 3224 if (limit_value < result) result = limit_value; |
| 3225 } |
| 3226 |
| 3227 if (additional_upper_limit() != NULL && |
| 3228 additional_upper_limit()->IsInteger32Constant()) { |
| 3229 int32_t limit_value = additional_upper_limit()->GetInteger32Constant(); |
| 3230 if (!additional_upper_limit_is_included()) { |
| 3231 limit_value--; |
| 3232 } |
| 3233 if (limit_value < result) result = limit_value; |
| 3234 } |
| 3235 |
| 3236 if (and_mask > 0 && and_mask < MAX_LIMIT) { |
| 3237 if (and_mask < result) result = and_mask; |
| 3238 return result; |
| 3239 } |
| 3240 |
| 3241 // Add the effect of the or_mask. |
| 3242 result |= or_mask; |
| 3243 |
| 3244 if (result >= MAX_LIMIT) { |
| 3245 result = kNoLimit; |
| 3246 } |
| 3247 return result; |
| 3248 } |
| 3249 |
| 3250 private: |
| 3251 template <class T> void swap(T* a, T* b) { |
| 3252 T c(*a); |
| 3253 *a = *b; |
| 3254 *b = c; |
| 3255 } |
| 3256 |
| 3257 InductionVariableData(HPhi* phi, HValue* base, int32_t increment) |
| 3258 : phi_(phi), base_(IgnoreOsrValue(base)), increment_(increment), |
| 3259 limit_(NULL), limit_included_(false), limit_validity_(NULL), |
| 3260 induction_exit_block_(NULL), induction_exit_target_(NULL), |
| 3261 checks_(NULL), |
| 3262 additional_upper_limit_(NULL), |
| 3263 additional_upper_limit_is_included_(false), |
| 3264 additional_lower_limit_(NULL), |
| 3265 additional_lower_limit_is_included_(false) {} |
| 3266 |
| 3267 static int32_t ComputeIncrement(HPhi* phi, HValue* phi_operand); |
| 3268 |
| 3269 static HValue* IgnoreOsrValue(HValue* v); |
| 3270 static InductionVariableData* GetInductionVariableData(HValue* v); |
| 3271 bool TokenCanRepresentLoopGuard(Token::Value token); |
| 3272 |
| 3273 HPhi* phi_; |
| 3274 HValue* base_; |
| 3275 int32_t increment_; |
| 3276 HValue* limit_; |
| 3277 bool limit_included_; |
| 3278 HBasicBlock* limit_validity_; |
| 3279 HBasicBlock* induction_exit_block_; |
| 3280 HBasicBlock* induction_exit_target_; |
| 3281 ChecksRelatedToLength* checks_; |
| 3282 HValue* additional_upper_limit_; |
| 3283 bool additional_upper_limit_is_included_; |
| 3284 HValue* additional_lower_limit_; |
| 3285 bool additional_lower_limit_is_included_; |
| 3286 }; |
| 3287 |
| 3288 |
3053 class HPhi: public HValue { | 3289 class HPhi: public HValue { |
3054 public: | 3290 public: |
3055 HPhi(int merged_index, Zone* zone) | 3291 HPhi(int merged_index, Zone* zone) |
3056 : inputs_(2, zone), | 3292 : inputs_(2, zone), |
3057 merged_index_(merged_index), | 3293 merged_index_(merged_index), |
3058 phi_id_(-1) { | 3294 phi_id_(-1), |
| 3295 induction_variable_data_(NULL) { |
3059 for (int i = 0; i < Representation::kNumRepresentations; i++) { | 3296 for (int i = 0; i < Representation::kNumRepresentations; i++) { |
3060 non_phi_uses_[i] = 0; | 3297 non_phi_uses_[i] = 0; |
3061 indirect_uses_[i] = 0; | 3298 indirect_uses_[i] = 0; |
3062 } | 3299 } |
3063 ASSERT(merged_index >= 0); | 3300 ASSERT(merged_index >= 0); |
3064 SetFlag(kFlexibleRepresentation); | 3301 SetFlag(kFlexibleRepresentation); |
3065 SetFlag(kAllowUndefinedAsNaN); | 3302 SetFlag(kAllowUndefinedAsNaN); |
3066 } | 3303 } |
3067 | 3304 |
3068 virtual Representation RepresentationFromInputs(); | 3305 virtual Representation RepresentationFromInputs(); |
(...skipping 10 matching lines...) Expand all Loading... |
3079 virtual int OperandCount() { return inputs_.length(); } | 3316 virtual int OperandCount() { return inputs_.length(); } |
3080 virtual HValue* OperandAt(int index) const { return inputs_[index]; } | 3317 virtual HValue* OperandAt(int index) const { return inputs_[index]; } |
3081 HValue* GetRedundantReplacement(); | 3318 HValue* GetRedundantReplacement(); |
3082 void AddInput(HValue* value); | 3319 void AddInput(HValue* value); |
3083 bool HasRealUses(); | 3320 bool HasRealUses(); |
3084 | 3321 |
3085 bool IsReceiver() const { return merged_index_ == 0; } | 3322 bool IsReceiver() const { return merged_index_ == 0; } |
3086 | 3323 |
3087 int merged_index() const { return merged_index_; } | 3324 int merged_index() const { return merged_index_; } |
3088 | 3325 |
| 3326 InductionVariableData* induction_variable_data() { |
| 3327 return induction_variable_data_; |
| 3328 } |
| 3329 bool IsInductionVariable() { |
| 3330 return induction_variable_data_ != NULL; |
| 3331 } |
| 3332 bool IsLimitedInductionVariable() { |
| 3333 return IsInductionVariable() && |
| 3334 induction_variable_data_->limit() != NULL; |
| 3335 } |
| 3336 void DetectInductionVariable() { |
| 3337 ASSERT(induction_variable_data_ == NULL); |
| 3338 induction_variable_data_ = InductionVariableData::ExaminePhi(this); |
| 3339 } |
| 3340 |
3089 virtual void AddInformativeDefinitions(); | 3341 virtual void AddInformativeDefinitions(); |
3090 | 3342 |
3091 virtual void PrintTo(StringStream* stream); | 3343 virtual void PrintTo(StringStream* stream); |
3092 | 3344 |
3093 #ifdef DEBUG | 3345 #ifdef DEBUG |
3094 virtual void Verify(); | 3346 virtual void Verify(); |
3095 #endif | 3347 #endif |
3096 | 3348 |
3097 void InitRealUses(int id); | 3349 void InitRealUses(int id); |
3098 void AddNonPhiUsesFrom(HPhi* other); | 3350 void AddNonPhiUsesFrom(HPhi* other); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3146 int offset = 0, | 3398 int offset = 0, |
3147 int scale = 0); | 3399 int scale = 0); |
3148 | 3400 |
3149 private: | 3401 private: |
3150 ZoneList<HValue*> inputs_; | 3402 ZoneList<HValue*> inputs_; |
3151 int merged_index_; | 3403 int merged_index_; |
3152 | 3404 |
3153 int non_phi_uses_[Representation::kNumRepresentations]; | 3405 int non_phi_uses_[Representation::kNumRepresentations]; |
3154 int indirect_uses_[Representation::kNumRepresentations]; | 3406 int indirect_uses_[Representation::kNumRepresentations]; |
3155 int phi_id_; | 3407 int phi_id_; |
| 3408 InductionVariableData* induction_variable_data_; |
3156 }; | 3409 }; |
3157 | 3410 |
3158 | 3411 |
3159 class HInductionVariableAnnotation : public HUnaryOperation { | 3412 class HInductionVariableAnnotation : public HUnaryOperation { |
3160 public: | 3413 public: |
3161 static HInductionVariableAnnotation* AddToGraph(HPhi* phi, | 3414 static HInductionVariableAnnotation* AddToGraph(HPhi* phi, |
3162 NumericRelation relation, | 3415 NumericRelation relation, |
3163 int operand_index); | 3416 int operand_index); |
3164 | 3417 |
3165 NumericRelation relation() { return relation_; } | 3418 NumericRelation relation() { return relation_; } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 | 3906 |
3654 class HBoundsCheck: public HTemplateInstruction<2> { | 3907 class HBoundsCheck: public HTemplateInstruction<2> { |
3655 public: | 3908 public: |
3656 // Normally HBoundsCheck should be created using the | 3909 // Normally HBoundsCheck should be created using the |
3657 // HGraphBuilder::AddBoundsCheck() helper. | 3910 // HGraphBuilder::AddBoundsCheck() helper. |
3658 // However when building stubs, where we know that the arguments are Int32, | 3911 // However when building stubs, where we know that the arguments are Int32, |
3659 // it makes sense to invoke this constructor directly. | 3912 // it makes sense to invoke this constructor directly. |
3660 HBoundsCheck(HValue* index, HValue* length) | 3913 HBoundsCheck(HValue* index, HValue* length) |
3661 : skip_check_(false), | 3914 : skip_check_(false), |
3662 base_(NULL), offset_(0), scale_(0), | 3915 base_(NULL), offset_(0), scale_(0), |
3663 responsibility_direction_(DIRECTION_NONE) { | 3916 responsibility_direction_(DIRECTION_NONE), |
| 3917 allow_equality_(false) { |
3664 SetOperandAt(0, index); | 3918 SetOperandAt(0, index); |
3665 SetOperandAt(1, length); | 3919 SetOperandAt(1, length); |
3666 SetFlag(kFlexibleRepresentation); | 3920 SetFlag(kFlexibleRepresentation); |
3667 SetFlag(kUseGVN); | 3921 SetFlag(kUseGVN); |
3668 } | 3922 } |
3669 | 3923 |
3670 bool skip_check() { return skip_check_; } | 3924 bool skip_check() const { return skip_check_; } |
3671 void set_skip_check(bool skip_check) { skip_check_ = skip_check; } | 3925 void set_skip_check() { skip_check_ = true; } |
3672 HValue* base() { return base_; } | 3926 HValue* base() { return base_; } |
3673 int offset() { return offset_; } | 3927 int offset() { return offset_; } |
3674 int scale() { return scale_; } | 3928 int scale() { return scale_; } |
3675 bool index_can_increase() { | 3929 bool index_can_increase() { |
3676 return (responsibility_direction_ & DIRECTION_LOWER) == 0; | 3930 return (responsibility_direction_ & DIRECTION_LOWER) == 0; |
3677 } | 3931 } |
3678 bool index_can_decrease() { | 3932 bool index_can_decrease() { |
3679 return (responsibility_direction_ & DIRECTION_UPPER) == 0; | 3933 return (responsibility_direction_ & DIRECTION_UPPER) == 0; |
3680 } | 3934 } |
3681 | 3935 |
(...skipping 11 matching lines...) Expand all Loading... |
3693 base_ = index(); | 3947 base_ = index(); |
3694 offset_ = 0; | 3948 offset_ = 0; |
3695 scale_ = 0; | 3949 scale_ = 0; |
3696 return false; | 3950 return false; |
3697 } | 3951 } |
3698 } | 3952 } |
3699 | 3953 |
3700 virtual Representation RequiredInputRepresentation(int arg_index) { | 3954 virtual Representation RequiredInputRepresentation(int arg_index) { |
3701 return representation(); | 3955 return representation(); |
3702 } | 3956 } |
| 3957 virtual bool IsDeletable() const { |
| 3958 return skip_check() && !FLAG_debug_code; |
| 3959 } |
3703 | 3960 |
3704 virtual bool IsRelationTrueInternal(NumericRelation relation, | 3961 virtual bool IsRelationTrueInternal(NumericRelation relation, |
3705 HValue* related_value, | 3962 HValue* related_value, |
3706 int offset = 0, | 3963 int offset = 0, |
3707 int scale = 0); | 3964 int scale = 0); |
3708 | 3965 |
3709 virtual void PrintDataTo(StringStream* stream); | 3966 virtual void PrintDataTo(StringStream* stream); |
3710 virtual void InferRepresentation(HInferRepresentation* h_infer); | 3967 virtual void InferRepresentation(HInferRepresentation* h_infer); |
3711 | 3968 |
3712 HValue* index() { return OperandAt(0); } | 3969 HValue* index() { return OperandAt(0); } |
3713 HValue* length() { return OperandAt(1); } | 3970 HValue* length() { return OperandAt(1); } |
| 3971 bool allow_equality() { return allow_equality_; } |
| 3972 void set_allow_equality(bool v) { allow_equality_ = v; } |
3714 | 3973 |
3715 virtual int RedefinedOperandIndex() { return 0; } | 3974 virtual int RedefinedOperandIndex() { return 0; } |
3716 virtual bool IsPurelyInformativeDefinition() { return skip_check(); } | 3975 virtual bool IsPurelyInformativeDefinition() { return skip_check(); } |
3717 virtual void AddInformativeDefinitions(); | 3976 virtual void AddInformativeDefinitions(); |
3718 | 3977 |
3719 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck) | 3978 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck) |
3720 | 3979 |
3721 protected: | 3980 protected: |
3722 friend class HBoundsCheckBaseIndexInformation; | 3981 friend class HBoundsCheckBaseIndexInformation; |
3723 | 3982 |
3724 virtual void SetResponsibilityForRange(RangeGuaranteeDirection direction) { | 3983 virtual void SetResponsibilityForRange(RangeGuaranteeDirection direction) { |
3725 responsibility_direction_ = static_cast<RangeGuaranteeDirection>( | 3984 responsibility_direction_ = static_cast<RangeGuaranteeDirection>( |
3726 responsibility_direction_ | direction); | 3985 responsibility_direction_ | direction); |
3727 } | 3986 } |
3728 | 3987 |
3729 virtual bool DataEquals(HValue* other) { return true; } | 3988 virtual bool DataEquals(HValue* other) { return true; } |
3730 virtual void TryGuaranteeRangeChanging(RangeEvaluationContext* context); | 3989 virtual void TryGuaranteeRangeChanging(RangeEvaluationContext* context); |
3731 bool skip_check_; | 3990 bool skip_check_; |
3732 HValue* base_; | 3991 HValue* base_; |
3733 int offset_; | 3992 int offset_; |
3734 int scale_; | 3993 int scale_; |
3735 RangeGuaranteeDirection responsibility_direction_; | 3994 RangeGuaranteeDirection responsibility_direction_; |
| 3995 bool allow_equality_; |
3736 }; | 3996 }; |
3737 | 3997 |
3738 | 3998 |
3739 class HBoundsCheckBaseIndexInformation: public HTemplateInstruction<2> { | 3999 class HBoundsCheckBaseIndexInformation: public HTemplateInstruction<2> { |
3740 public: | 4000 public: |
3741 explicit HBoundsCheckBaseIndexInformation(HBoundsCheck* check) { | 4001 explicit HBoundsCheckBaseIndexInformation(HBoundsCheck* check) { |
3742 DecompositionResult decomposition; | 4002 DecompositionResult decomposition; |
3743 if (check->index()->TryDecompose(&decomposition)) { | 4003 if (check->index()->TryDecompose(&decomposition)) { |
3744 SetOperandAt(0, decomposition.base()); | 4004 SetOperandAt(0, decomposition.base()); |
3745 SetOperandAt(1, check); | 4005 SetOperandAt(1, check); |
(...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6601 virtual HType CalculateInferredType() { | 6861 virtual HType CalculateInferredType() { |
6602 return HType::Tagged(); | 6862 return HType::Tagged(); |
6603 } | 6863 } |
6604 | 6864 |
6605 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 6865 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
6606 | 6866 |
6607 private: | 6867 private: |
6608 virtual bool IsDeletable() const { return true; } | 6868 virtual bool IsDeletable() const { return true; } |
6609 }; | 6869 }; |
6610 | 6870 |
6611 | |
6612 #undef DECLARE_INSTRUCTION | 6871 #undef DECLARE_INSTRUCTION |
6613 #undef DECLARE_CONCRETE_INSTRUCTION | 6872 #undef DECLARE_CONCRETE_INSTRUCTION |
6614 | 6873 |
6615 } } // namespace v8::internal | 6874 } } // namespace v8::internal |
6616 | 6875 |
6617 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6876 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |