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 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 return (slot_index() == b->slot_index()); | 3470 return (slot_index() == b->slot_index()); |
3471 } | 3471 } |
3472 | 3472 |
3473 private: | 3473 private: |
3474 int slot_index_; | 3474 int slot_index_; |
3475 }; | 3475 }; |
3476 | 3476 |
3477 | 3477 |
3478 class HStoreContextSlot: public HTemplateInstruction<2> { | 3478 class HStoreContextSlot: public HTemplateInstruction<2> { |
3479 public: | 3479 public: |
| 3480 enum Check { |
| 3481 kEmpty, |
| 3482 kIsHoleCheck |
| 3483 }; |
| 3484 |
3480 HStoreContextSlot(HValue* context, int slot_index, HValue* value) | 3485 HStoreContextSlot(HValue* context, int slot_index, HValue* value) |
3481 : slot_index_(slot_index) { | 3486 : slot_index_(slot_index), check_(kEmpty) { |
3482 SetOperandAt(0, context); | 3487 SetOperandAt(0, context); |
3483 SetOperandAt(1, value); | 3488 SetOperandAt(1, value); |
3484 SetFlag(kChangesContextSlots); | 3489 SetFlag(kChangesContextSlots); |
3485 } | 3490 } |
3486 | 3491 |
| 3492 void ForceIsHoleCheck() { |
| 3493 check_ = kIsHoleCheck; |
| 3494 } |
| 3495 |
3487 HValue* context() { return OperandAt(0); } | 3496 HValue* context() { return OperandAt(0); } |
3488 HValue* value() { return OperandAt(1); } | 3497 HValue* value() { return OperandAt(1); } |
3489 int slot_index() const { return slot_index_; } | 3498 int slot_index() const { return slot_index_; } |
| 3499 bool needs_is_hole_check() const { return check_ == kIsHoleCheck; } |
3490 | 3500 |
3491 bool NeedsWriteBarrier() { | 3501 bool NeedsWriteBarrier() { |
3492 return StoringValueNeedsWriteBarrier(value()); | 3502 return StoringValueNeedsWriteBarrier(value()); |
3493 } | 3503 } |
3494 | 3504 |
3495 virtual Representation RequiredInputRepresentation(int index) { | 3505 virtual Representation RequiredInputRepresentation(int index) { |
3496 return Representation::Tagged(); | 3506 return Representation::Tagged(); |
3497 } | 3507 } |
3498 | 3508 |
3499 virtual void PrintDataTo(StringStream* stream); | 3509 virtual void PrintDataTo(StringStream* stream); |
3500 | 3510 |
3501 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot) | 3511 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot) |
3502 | 3512 |
3503 private: | 3513 private: |
3504 int slot_index_; | 3514 int slot_index_; |
| 3515 Check check_; |
3505 }; | 3516 }; |
3506 | 3517 |
3507 | 3518 |
3508 class HLoadNamedField: public HUnaryOperation { | 3519 class HLoadNamedField: public HUnaryOperation { |
3509 public: | 3520 public: |
3510 HLoadNamedField(HValue* object, bool is_in_object, int offset) | 3521 HLoadNamedField(HValue* object, bool is_in_object, int offset) |
3511 : HUnaryOperation(object), | 3522 : HUnaryOperation(object), |
3512 is_in_object_(is_in_object), | 3523 is_in_object_(is_in_object), |
3513 offset_(offset) { | 3524 offset_(offset) { |
3514 set_representation(Representation::Tagged()); | 3525 set_representation(Representation::Tagged()); |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 | 4440 |
4430 DECLARE_CONCRETE_INSTRUCTION(In) | 4441 DECLARE_CONCRETE_INSTRUCTION(In) |
4431 }; | 4442 }; |
4432 | 4443 |
4433 #undef DECLARE_INSTRUCTION | 4444 #undef DECLARE_INSTRUCTION |
4434 #undef DECLARE_CONCRETE_INSTRUCTION | 4445 #undef DECLARE_CONCRETE_INSTRUCTION |
4435 | 4446 |
4436 } } // namespace v8::internal | 4447 } } // namespace v8::internal |
4437 | 4448 |
4438 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4449 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |