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