Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: src/hydrogen-instructions.h

Issue 8857001: [hydrogen] don't bailout assignments to consts (Closed) Base URL: gh:v8/v8@master
Patch Set: [arm] fixed illegal access errorwq Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after
3440 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric) 3440 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric)
3441 3441
3442 private: 3442 private:
3443 Handle<Object> name_; 3443 Handle<Object> name_;
3444 StrictModeFlag strict_mode_flag_; 3444 StrictModeFlag strict_mode_flag_;
3445 }; 3445 };
3446 3446
3447 3447
3448 class HLoadContextSlot: public HUnaryOperation { 3448 class HLoadContextSlot: public HUnaryOperation {
3449 public: 3449 public:
3450 enum Check {
3451 kEmpty,
3452 kIsHoleCheck
fschneider 2011/12/12 09:55:56 Please rebase your change. It seems to conflict wi
3453 };
3454
3450 HLoadContextSlot(HValue* context , int slot_index) 3455 HLoadContextSlot(HValue* context , int slot_index)
3451 : HUnaryOperation(context), slot_index_(slot_index) { 3456 : HUnaryOperation(context), slot_index_(slot_index), check_(kEmpty) {
3452 set_representation(Representation::Tagged()); 3457 set_representation(Representation::Tagged());
3453 SetFlag(kUseGVN); 3458 SetFlag(kUseGVN);
3454 SetFlag(kDependsOnContextSlots); 3459 SetFlag(kDependsOnContextSlots);
3455 } 3460 }
3456 3461
3462 void ForceIsHoleCheck() {
3463 check_ = kIsHoleCheck;
3464 }
3465
3457 int slot_index() const { return slot_index_; } 3466 int slot_index() const { return slot_index_; }
3467 bool RequiresHoleCheck() const { return check_ == kIsHoleCheck; }
3458 3468
3459 virtual Representation RequiredInputRepresentation(int index) { 3469 virtual Representation RequiredInputRepresentation(int index) {
3460 return Representation::Tagged(); 3470 return Representation::Tagged();
3461 } 3471 }
3462 3472
3463 virtual void PrintDataTo(StringStream* stream); 3473 virtual void PrintDataTo(StringStream* stream);
3464 3474
3465 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot) 3475 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot)
3466 3476
3467 protected: 3477 protected:
3468 virtual bool DataEquals(HValue* other) { 3478 virtual bool DataEquals(HValue* other) {
3469 HLoadContextSlot* b = HLoadContextSlot::cast(other); 3479 HLoadContextSlot* b = HLoadContextSlot::cast(other);
3470 return (slot_index() == b->slot_index()); 3480 return (slot_index() == b->slot_index());
3471 } 3481 }
3472 3482
3473 private: 3483 private:
3474 int slot_index_; 3484 int slot_index_;
3485 Check check_;
3475 }; 3486 };
3476 3487
3477 3488
3478 class HStoreContextSlot: public HTemplateInstruction<2> { 3489 class HStoreContextSlot: public HTemplateInstruction<2> {
3479 public: 3490 public:
3491 enum Check {
3492 kEmpty,
3493 kIsHoleCheck
3494 };
3495
3480 HStoreContextSlot(HValue* context, int slot_index, HValue* value) 3496 HStoreContextSlot(HValue* context, int slot_index, HValue* value)
3481 : slot_index_(slot_index) { 3497 : slot_index_(slot_index), check_(kEmpty) {
3482 SetOperandAt(0, context); 3498 SetOperandAt(0, context);
3483 SetOperandAt(1, value); 3499 SetOperandAt(1, value);
3484 SetFlag(kChangesContextSlots); 3500 SetFlag(kChangesContextSlots);
3485 } 3501 }
3486 3502
3503 void ForceIsHoleCheck() {
3504 check_ = kIsHoleCheck;
3505 }
3506
3487 HValue* context() { return OperandAt(0); } 3507 HValue* context() { return OperandAt(0); }
3488 HValue* value() { return OperandAt(1); } 3508 HValue* value() { return OperandAt(1); }
3489 int slot_index() const { return slot_index_; } 3509 int slot_index() const { return slot_index_; }
3510 bool RequiresHoleCheck() const { return check_ == kIsHoleCheck; }
3490 3511
3491 bool NeedsWriteBarrier() { 3512 bool NeedsWriteBarrier() {
3492 return StoringValueNeedsWriteBarrier(value()); 3513 return StoringValueNeedsWriteBarrier(value());
3493 } 3514 }
3494 3515
3495 virtual Representation RequiredInputRepresentation(int index) { 3516 virtual Representation RequiredInputRepresentation(int index) {
3496 return Representation::Tagged(); 3517 return Representation::Tagged();
3497 } 3518 }
3498 3519
3499 virtual void PrintDataTo(StringStream* stream); 3520 virtual void PrintDataTo(StringStream* stream);
3500 3521
3501 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot) 3522 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot)
3502 3523
3503 private: 3524 private:
3504 int slot_index_; 3525 int slot_index_;
3526 Check check_;
3505 }; 3527 };
3506 3528
3507 3529
3508 class HLoadNamedField: public HUnaryOperation { 3530 class HLoadNamedField: public HUnaryOperation {
3509 public: 3531 public:
3510 HLoadNamedField(HValue* object, bool is_in_object, int offset) 3532 HLoadNamedField(HValue* object, bool is_in_object, int offset)
3511 : HUnaryOperation(object), 3533 : HUnaryOperation(object),
3512 is_in_object_(is_in_object), 3534 is_in_object_(is_in_object),
3513 offset_(offset) { 3535 offset_(offset) {
3514 set_representation(Representation::Tagged()); 3536 set_representation(Representation::Tagged());
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
4429 4451
4430 DECLARE_CONCRETE_INSTRUCTION(In) 4452 DECLARE_CONCRETE_INSTRUCTION(In)
4431 }; 4453 };
4432 4454
4433 #undef DECLARE_INSTRUCTION 4455 #undef DECLARE_INSTRUCTION
4434 #undef DECLARE_CONCRETE_INSTRUCTION 4456 #undef DECLARE_CONCRETE_INSTRUCTION
4435 4457
4436 } } // namespace v8::internal 4458 } } // namespace v8::internal
4437 4459
4438 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4460 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698