OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3194 virtual Representation RequiredInputRepresentation(int index) const { | 3194 virtual Representation RequiredInputRepresentation(int index) const { |
3195 return Representation::None(); | 3195 return Representation::None(); |
3196 } | 3196 } |
3197 | 3197 |
3198 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue) | 3198 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue) |
3199 }; | 3199 }; |
3200 | 3200 |
3201 | 3201 |
3202 class HLoadGlobalCell: public HTemplateInstruction<0> { | 3202 class HLoadGlobalCell: public HTemplateInstruction<0> { |
3203 public: | 3203 public: |
3204 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, bool check_hole_value) | 3204 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, PropertyDetails details) |
3205 : cell_(cell), check_hole_value_(check_hole_value) { | 3205 : cell_(cell), details_(details) { |
3206 set_representation(Representation::Tagged()); | 3206 set_representation(Representation::Tagged()); |
3207 SetFlag(kUseGVN); | 3207 SetFlag(kUseGVN); |
3208 SetFlag(kDependsOnGlobalVars); | 3208 SetFlag(kDependsOnGlobalVars); |
3209 } | 3209 } |
3210 | 3210 |
3211 Handle<JSGlobalPropertyCell> cell() const { return cell_; } | 3211 Handle<JSGlobalPropertyCell> cell() const { return cell_; } |
3212 bool check_hole_value() const { return check_hole_value_; } | 3212 bool RequiresHoleCheck(); |
3213 | 3213 |
3214 virtual void PrintDataTo(StringStream* stream); | 3214 virtual void PrintDataTo(StringStream* stream); |
3215 | 3215 |
3216 virtual intptr_t Hashcode() { | 3216 virtual intptr_t Hashcode() { |
3217 ASSERT(!HEAP->allow_allocation(false)); | 3217 ASSERT(!HEAP->allow_allocation(false)); |
3218 return reinterpret_cast<intptr_t>(*cell_); | 3218 return reinterpret_cast<intptr_t>(*cell_); |
3219 } | 3219 } |
3220 | 3220 |
3221 virtual Representation RequiredInputRepresentation(int index) const { | 3221 virtual Representation RequiredInputRepresentation(int index) const { |
3222 return Representation::None(); | 3222 return Representation::None(); |
3223 } | 3223 } |
3224 | 3224 |
3225 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) | 3225 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) |
3226 | 3226 |
3227 protected: | 3227 protected: |
3228 virtual bool DataEquals(HValue* other) { | 3228 virtual bool DataEquals(HValue* other) { |
3229 HLoadGlobalCell* b = HLoadGlobalCell::cast(other); | 3229 HLoadGlobalCell* b = HLoadGlobalCell::cast(other); |
3230 return cell_.is_identical_to(b->cell()); | 3230 return cell_.is_identical_to(b->cell()); |
3231 } | 3231 } |
3232 | 3232 |
3233 private: | 3233 private: |
3234 Handle<JSGlobalPropertyCell> cell_; | 3234 Handle<JSGlobalPropertyCell> cell_; |
3235 bool check_hole_value_; | 3235 PropertyDetails details_; |
3236 }; | 3236 }; |
3237 | 3237 |
3238 | 3238 |
3239 class HLoadGlobalGeneric: public HTemplateInstruction<2> { | 3239 class HLoadGlobalGeneric: public HTemplateInstruction<2> { |
3240 public: | 3240 public: |
3241 HLoadGlobalGeneric(HValue* context, | 3241 HLoadGlobalGeneric(HValue* context, |
3242 HValue* global_object, | 3242 HValue* global_object, |
3243 Handle<Object> name, | 3243 Handle<Object> name, |
3244 bool for_typeof) | 3244 bool for_typeof) |
3245 : name_(name), | 3245 : name_(name), |
(...skipping 20 matching lines...) Expand all Loading... |
3266 private: | 3266 private: |
3267 Handle<Object> name_; | 3267 Handle<Object> name_; |
3268 bool for_typeof_; | 3268 bool for_typeof_; |
3269 }; | 3269 }; |
3270 | 3270 |
3271 | 3271 |
3272 class HStoreGlobalCell: public HUnaryOperation { | 3272 class HStoreGlobalCell: public HUnaryOperation { |
3273 public: | 3273 public: |
3274 HStoreGlobalCell(HValue* value, | 3274 HStoreGlobalCell(HValue* value, |
3275 Handle<JSGlobalPropertyCell> cell, | 3275 Handle<JSGlobalPropertyCell> cell, |
3276 bool check_hole_value) | 3276 PropertyDetails details) |
3277 : HUnaryOperation(value), | 3277 : HUnaryOperation(value), |
3278 cell_(cell), | 3278 cell_(cell), |
3279 check_hole_value_(check_hole_value) { | 3279 details_(details) { |
3280 SetFlag(kChangesGlobalVars); | 3280 SetFlag(kChangesGlobalVars); |
3281 } | 3281 } |
3282 | 3282 |
3283 Handle<JSGlobalPropertyCell> cell() const { return cell_; } | 3283 Handle<JSGlobalPropertyCell> cell() const { return cell_; } |
3284 bool check_hole_value() const { return check_hole_value_; } | 3284 bool RequiresHoleCheck() { |
| 3285 return !details_.IsDontDelete() || details_.IsReadOnly(); |
| 3286 } |
3285 | 3287 |
3286 virtual Representation RequiredInputRepresentation(int index) const { | 3288 virtual Representation RequiredInputRepresentation(int index) const { |
3287 return Representation::Tagged(); | 3289 return Representation::Tagged(); |
3288 } | 3290 } |
3289 virtual void PrintDataTo(StringStream* stream); | 3291 virtual void PrintDataTo(StringStream* stream); |
3290 | 3292 |
3291 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) | 3293 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) |
3292 | 3294 |
3293 private: | 3295 private: |
3294 Handle<JSGlobalPropertyCell> cell_; | 3296 Handle<JSGlobalPropertyCell> cell_; |
3295 bool check_hole_value_; | 3297 PropertyDetails details_; |
3296 }; | 3298 }; |
3297 | 3299 |
3298 | 3300 |
3299 class HStoreGlobalGeneric: public HTemplateInstruction<3> { | 3301 class HStoreGlobalGeneric: public HTemplateInstruction<3> { |
3300 public: | 3302 public: |
3301 HStoreGlobalGeneric(HValue* context, | 3303 HStoreGlobalGeneric(HValue* context, |
3302 HValue* global_object, | 3304 HValue* global_object, |
3303 Handle<Object> name, | 3305 Handle<Object> name, |
3304 HValue* value, | 3306 HValue* value, |
3305 bool strict_mode) | 3307 bool strict_mode) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3536 | 3538 |
3537 virtual Representation RequiredInputRepresentation(int index) const { | 3539 virtual Representation RequiredInputRepresentation(int index) const { |
3538 // The key is supposed to be Integer32. | 3540 // The key is supposed to be Integer32. |
3539 return index == 0 | 3541 return index == 0 |
3540 ? Representation::Tagged() | 3542 ? Representation::Tagged() |
3541 : Representation::Integer32(); | 3543 : Representation::Integer32(); |
3542 } | 3544 } |
3543 | 3545 |
3544 virtual void PrintDataTo(StringStream* stream); | 3546 virtual void PrintDataTo(StringStream* stream); |
3545 | 3547 |
3546 bool RequiresHoleCheck() const; | 3548 bool RequiresHoleCheck(); |
3547 | 3549 |
3548 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement) | 3550 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement) |
3549 | 3551 |
3550 protected: | 3552 protected: |
3551 virtual bool DataEquals(HValue* other) { return true; } | 3553 virtual bool DataEquals(HValue* other) { return true; } |
3552 }; | 3554 }; |
3553 | 3555 |
3554 | 3556 |
3555 class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> { | 3557 class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> { |
3556 public: | 3558 public: |
(...skipping 10 matching lines...) Expand all Loading... |
3567 | 3569 |
3568 virtual Representation RequiredInputRepresentation(int index) const { | 3570 virtual Representation RequiredInputRepresentation(int index) const { |
3569 // The key is supposed to be Integer32. | 3571 // The key is supposed to be Integer32. |
3570 return index == 0 | 3572 return index == 0 |
3571 ? Representation::Tagged() | 3573 ? Representation::Tagged() |
3572 : Representation::Integer32(); | 3574 : Representation::Integer32(); |
3573 } | 3575 } |
3574 | 3576 |
3575 virtual void PrintDataTo(StringStream* stream); | 3577 virtual void PrintDataTo(StringStream* stream); |
3576 | 3578 |
3577 bool RequiresHoleCheck() const; | |
3578 | |
3579 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement) | 3579 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement) |
3580 | 3580 |
3581 protected: | 3581 protected: |
3582 virtual bool DataEquals(HValue* other) { return true; } | 3582 virtual bool DataEquals(HValue* other) { return true; } |
3583 }; | 3583 }; |
3584 | 3584 |
3585 | 3585 |
3586 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> { | 3586 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> { |
3587 public: | 3587 public: |
3588 HLoadKeyedSpecializedArrayElement(HValue* external_elements, | 3588 HLoadKeyedSpecializedArrayElement(HValue* external_elements, |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4242 | 4242 |
4243 DECLARE_CONCRETE_INSTRUCTION(In) | 4243 DECLARE_CONCRETE_INSTRUCTION(In) |
4244 }; | 4244 }; |
4245 | 4245 |
4246 #undef DECLARE_INSTRUCTION | 4246 #undef DECLARE_INSTRUCTION |
4247 #undef DECLARE_CONCRETE_INSTRUCTION | 4247 #undef DECLARE_CONCRETE_INSTRUCTION |
4248 | 4248 |
4249 } } // namespace v8::internal | 4249 } } // namespace v8::internal |
4250 | 4250 |
4251 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4251 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |