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

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

Issue 196383025: Merged r19798, r19896 into 3.23 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.23
Patch Set: Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.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 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 3639 matching lines...) Expand 10 before | Expand all | Expand 10 after
3650 if (!has_double_value_ && !has_external_reference_value_) { 3650 if (!has_double_value_ && !has_external_reference_value_) {
3651 ASSERT(!object_.handle().is_null()); 3651 ASSERT(!object_.handle().is_null());
3652 object_ = Unique<Object>(object_.handle()); 3652 object_ = Unique<Object>(object_.handle());
3653 } 3653 }
3654 } 3654 }
3655 3655
3656 Unique<Object> GetUnique() const { 3656 Unique<Object> GetUnique() const {
3657 return object_; 3657 return object_;
3658 } 3658 }
3659 3659
3660 #ifdef DEBUG
3661 virtual void Verify() V8_OVERRIDE { }
3662 #endif
3663
3664 DECLARE_CONCRETE_INSTRUCTION(Constant)
3665
3666 protected:
3667 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
3668
3669 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 3660 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
3670 HConstant* other_constant = HConstant::cast(other); 3661 HConstant* other_constant = HConstant::cast(other);
3671 if (has_int32_value_) { 3662 if (has_int32_value_) {
3672 return other_constant->has_int32_value_ && 3663 return other_constant->has_int32_value_ &&
3673 int32_value_ == other_constant->int32_value_; 3664 int32_value_ == other_constant->int32_value_;
3674 } else if (has_double_value_) { 3665 } else if (has_double_value_) {
3675 return other_constant->has_double_value_ && 3666 return other_constant->has_double_value_ &&
3676 BitCast<int64_t>(double_value_) == 3667 BitCast<int64_t>(double_value_) ==
3677 BitCast<int64_t>(other_constant->double_value_); 3668 BitCast<int64_t>(other_constant->double_value_);
3678 } else if (has_external_reference_value_) { 3669 } else if (has_external_reference_value_) {
3679 return other_constant->has_external_reference_value_ && 3670 return other_constant->has_external_reference_value_ &&
3680 external_reference_value_ == 3671 external_reference_value_ ==
3681 other_constant->external_reference_value_; 3672 other_constant->external_reference_value_;
3682 } else { 3673 } else {
3683 if (other_constant->has_int32_value_ || 3674 if (other_constant->has_int32_value_ ||
3684 other_constant->has_double_value_ || 3675 other_constant->has_double_value_ ||
3685 other_constant->has_external_reference_value_) { 3676 other_constant->has_external_reference_value_) {
3686 return false; 3677 return false;
3687 } 3678 }
3688 ASSERT(!object_.handle().is_null()); 3679 ASSERT(!object_.handle().is_null());
3689 return other_constant->object_ == object_; 3680 return other_constant->object_ == object_;
3690 } 3681 }
3691 } 3682 }
3692 3683
3684 #ifdef DEBUG
3685 virtual void Verify() V8_OVERRIDE { }
3686 #endif
3687
3688 DECLARE_CONCRETE_INSTRUCTION(Constant)
3689
3690 protected:
3691 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
3692
3693 private: 3693 private:
3694 friend class HGraph; 3694 friend class HGraph;
3695 HConstant(Handle<Object> handle, Representation r = Representation::None()); 3695 HConstant(Handle<Object> handle, Representation r = Representation::None());
3696 HConstant(int32_t value, 3696 HConstant(int32_t value,
3697 Representation r = Representation::None(), 3697 Representation r = Representation::None(),
3698 bool is_not_in_new_space = true, 3698 bool is_not_in_new_space = true,
3699 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); 3699 Unique<Object> optional = Unique<Object>(Handle<Object>::null()));
3700 HConstant(double value, 3700 HConstant(double value,
3701 Representation r = Representation::None(), 3701 Representation r = Representation::None(),
3702 bool is_not_in_new_space = true, 3702 bool is_not_in_new_space = true,
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
4328 4328
4329 private: 4329 private:
4330 explicit HCompareMinusZeroAndBranch(HValue* value) 4330 explicit HCompareMinusZeroAndBranch(HValue* value)
4331 : HUnaryControlInstruction(value, NULL, NULL) { 4331 : HUnaryControlInstruction(value, NULL, NULL) {
4332 } 4332 }
4333 }; 4333 };
4334 4334
4335 4335
4336 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> { 4336 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> {
4337 public: 4337 public:
4338 HCompareObjectEqAndBranch(HValue* left,
4339 HValue* right,
4340 HBasicBlock* true_target = NULL,
4341 HBasicBlock* false_target = NULL) {
4342 // TODO(danno): make this private when the IfBuilder properly constructs
4343 // control flow instructions.
4344 ASSERT(!left->IsConstant() ||
4345 (!HConstant::cast(left)->HasInteger32Value() ||
4346 HConstant::cast(left)->HasSmiValue()));
4347 ASSERT(!right->IsConstant() ||
4348 (!HConstant::cast(right)->HasInteger32Value() ||
4349 HConstant::cast(right)->HasSmiValue()));
4350 SetOperandAt(0, left);
4351 SetOperandAt(1, right);
4352 SetSuccessorAt(0, true_target);
4353 SetSuccessorAt(1, false_target);
4354 }
4355
4356 DECLARE_INSTRUCTION_FACTORY_P2(HCompareObjectEqAndBranch, HValue*, HValue*); 4338 DECLARE_INSTRUCTION_FACTORY_P2(HCompareObjectEqAndBranch, HValue*, HValue*);
4357 DECLARE_INSTRUCTION_FACTORY_P4(HCompareObjectEqAndBranch, HValue*, HValue*, 4339 DECLARE_INSTRUCTION_FACTORY_P4(HCompareObjectEqAndBranch, HValue*, HValue*,
4358 HBasicBlock*, HBasicBlock*); 4340 HBasicBlock*, HBasicBlock*);
4359 4341
4360 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; 4342 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;
4361 4343
4362 HValue* left() { return OperandAt(0); } 4344 HValue* left() { return OperandAt(0); }
4363 HValue* right() { return OperandAt(1); } 4345 HValue* right() { return OperandAt(1); }
4364 4346
4365 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 4347 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4366 4348
4367 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4349 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4368 return Representation::Tagged(); 4350 return Representation::Tagged();
4369 } 4351 }
4370 4352
4371 virtual Representation observed_input_representation(int index) V8_OVERRIDE { 4353 virtual Representation observed_input_representation(int index) V8_OVERRIDE {
4372 return Representation::Tagged(); 4354 return Representation::Tagged();
4373 } 4355 }
4374 4356
4375 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch) 4357 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch)
4358
4359 private:
4360 HCompareObjectEqAndBranch(HValue* left,
4361 HValue* right,
4362 HBasicBlock* true_target = NULL,
4363 HBasicBlock* false_target = NULL) {
4364 ASSERT(!left->IsConstant() ||
4365 (!HConstant::cast(left)->HasInteger32Value() ||
4366 HConstant::cast(left)->HasSmiValue()));
4367 ASSERT(!right->IsConstant() ||
4368 (!HConstant::cast(right)->HasInteger32Value() ||
4369 HConstant::cast(right)->HasSmiValue()));
4370 SetOperandAt(0, left);
4371 SetOperandAt(1, right);
4372 SetSuccessorAt(0, true_target);
4373 SetSuccessorAt(1, false_target);
4374 }
4376 }; 4375 };
4377 4376
4378 4377
4379 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction { 4378 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction {
4380 public: 4379 public:
4381 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*); 4380 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*);
4382 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*, 4381 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*,
4383 HBasicBlock*, HBasicBlock*); 4382 HBasicBlock*, HBasicBlock*);
4384 4383
4385 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4384 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
(...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
7489 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7488 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7490 }; 7489 };
7491 7490
7492 7491
7493 #undef DECLARE_INSTRUCTION 7492 #undef DECLARE_INSTRUCTION
7494 #undef DECLARE_CONCRETE_INSTRUCTION 7493 #undef DECLARE_CONCRETE_INSTRUCTION
7495 7494
7496 } } // namespace v8::internal 7495 } } // namespace v8::internal
7497 7496
7498 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7497 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698