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

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

Issue 199093003: Merged r19798, r19896 into 3.24 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.24
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 3473 matching lines...) Expand 10 before | Expand all | Expand 10 after
3484 if (!has_double_value_ && !has_external_reference_value_) { 3484 if (!has_double_value_ && !has_external_reference_value_) {
3485 ASSERT(!object_.handle().is_null()); 3485 ASSERT(!object_.handle().is_null());
3486 object_ = Unique<Object>(object_.handle()); 3486 object_ = Unique<Object>(object_.handle());
3487 } 3487 }
3488 } 3488 }
3489 3489
3490 Unique<Object> GetUnique() const { 3490 Unique<Object> GetUnique() const {
3491 return object_; 3491 return object_;
3492 } 3492 }
3493 3493
3494 #ifdef DEBUG
3495 virtual void Verify() V8_OVERRIDE { }
3496 #endif
3497
3498 DECLARE_CONCRETE_INSTRUCTION(Constant)
3499
3500 protected:
3501 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
3502
3503 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 3494 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
3504 HConstant* other_constant = HConstant::cast(other); 3495 HConstant* other_constant = HConstant::cast(other);
3505 if (has_int32_value_) { 3496 if (has_int32_value_) {
3506 return other_constant->has_int32_value_ && 3497 return other_constant->has_int32_value_ &&
3507 int32_value_ == other_constant->int32_value_; 3498 int32_value_ == other_constant->int32_value_;
3508 } else if (has_double_value_) { 3499 } else if (has_double_value_) {
3509 return other_constant->has_double_value_ && 3500 return other_constant->has_double_value_ &&
3510 BitCast<int64_t>(double_value_) == 3501 BitCast<int64_t>(double_value_) ==
3511 BitCast<int64_t>(other_constant->double_value_); 3502 BitCast<int64_t>(other_constant->double_value_);
3512 } else if (has_external_reference_value_) { 3503 } else if (has_external_reference_value_) {
3513 return other_constant->has_external_reference_value_ && 3504 return other_constant->has_external_reference_value_ &&
3514 external_reference_value_ == 3505 external_reference_value_ ==
3515 other_constant->external_reference_value_; 3506 other_constant->external_reference_value_;
3516 } else { 3507 } else {
3517 if (other_constant->has_int32_value_ || 3508 if (other_constant->has_int32_value_ ||
3518 other_constant->has_double_value_ || 3509 other_constant->has_double_value_ ||
3519 other_constant->has_external_reference_value_) { 3510 other_constant->has_external_reference_value_) {
3520 return false; 3511 return false;
3521 } 3512 }
3522 ASSERT(!object_.handle().is_null()); 3513 ASSERT(!object_.handle().is_null());
3523 return other_constant->object_ == object_; 3514 return other_constant->object_ == object_;
3524 } 3515 }
3525 } 3516 }
3526 3517
3518 #ifdef DEBUG
3519 virtual void Verify() V8_OVERRIDE { }
3520 #endif
3521
3522 DECLARE_CONCRETE_INSTRUCTION(Constant)
3523
3524 protected:
3525 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
3526
3527 private: 3527 private:
3528 friend class HGraph; 3528 friend class HGraph;
3529 HConstant(Handle<Object> handle, Representation r = Representation::None()); 3529 HConstant(Handle<Object> handle, Representation r = Representation::None());
3530 HConstant(int32_t value, 3530 HConstant(int32_t value,
3531 Representation r = Representation::None(), 3531 Representation r = Representation::None(),
3532 bool is_not_in_new_space = true, 3532 bool is_not_in_new_space = true,
3533 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); 3533 Unique<Object> optional = Unique<Object>(Handle<Object>::null()));
3534 HConstant(double value, 3534 HConstant(double value,
3535 Representation r = Representation::None(), 3535 Representation r = Representation::None(),
3536 bool is_not_in_new_space = true, 3536 bool is_not_in_new_space = true,
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
4177 4177
4178 private: 4178 private:
4179 explicit HCompareMinusZeroAndBranch(HValue* value) 4179 explicit HCompareMinusZeroAndBranch(HValue* value)
4180 : HUnaryControlInstruction(value, NULL, NULL) { 4180 : HUnaryControlInstruction(value, NULL, NULL) {
4181 } 4181 }
4182 }; 4182 };
4183 4183
4184 4184
4185 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> { 4185 class HCompareObjectEqAndBranch : public HTemplateControlInstruction<2, 2> {
4186 public: 4186 public:
4187 HCompareObjectEqAndBranch(HValue* left,
4188 HValue* right,
4189 HBasicBlock* true_target = NULL,
4190 HBasicBlock* false_target = NULL) {
4191 // TODO(danno): make this private when the IfBuilder properly constructs
4192 // control flow instructions.
4193 ASSERT(!left->IsConstant() ||
4194 (!HConstant::cast(left)->HasInteger32Value() ||
4195 HConstant::cast(left)->HasSmiValue()));
4196 ASSERT(!right->IsConstant() ||
4197 (!HConstant::cast(right)->HasInteger32Value() ||
4198 HConstant::cast(right)->HasSmiValue()));
4199 SetOperandAt(0, left);
4200 SetOperandAt(1, right);
4201 SetSuccessorAt(0, true_target);
4202 SetSuccessorAt(1, false_target);
4203 }
4204
4205 DECLARE_INSTRUCTION_FACTORY_P2(HCompareObjectEqAndBranch, HValue*, HValue*); 4187 DECLARE_INSTRUCTION_FACTORY_P2(HCompareObjectEqAndBranch, HValue*, HValue*);
4206 DECLARE_INSTRUCTION_FACTORY_P4(HCompareObjectEqAndBranch, HValue*, HValue*, 4188 DECLARE_INSTRUCTION_FACTORY_P4(HCompareObjectEqAndBranch, HValue*, HValue*,
4207 HBasicBlock*, HBasicBlock*); 4189 HBasicBlock*, HBasicBlock*);
4208 4190
4209 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; 4191 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE;
4210 4192
4211 HValue* left() { return OperandAt(0); } 4193 HValue* left() { return OperandAt(0); }
4212 HValue* right() { return OperandAt(1); } 4194 HValue* right() { return OperandAt(1); }
4213 4195
4214 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 4196 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
4215 4197
4216 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4198 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
4217 return Representation::Tagged(); 4199 return Representation::Tagged();
4218 } 4200 }
4219 4201
4220 virtual Representation observed_input_representation(int index) V8_OVERRIDE { 4202 virtual Representation observed_input_representation(int index) V8_OVERRIDE {
4221 return Representation::Tagged(); 4203 return Representation::Tagged();
4222 } 4204 }
4223 4205
4224 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch) 4206 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch)
4207
4208 private:
4209 HCompareObjectEqAndBranch(HValue* left,
4210 HValue* right,
4211 HBasicBlock* true_target = NULL,
4212 HBasicBlock* false_target = NULL) {
4213 ASSERT(!left->IsConstant() ||
4214 (!HConstant::cast(left)->HasInteger32Value() ||
4215 HConstant::cast(left)->HasSmiValue()));
4216 ASSERT(!right->IsConstant() ||
4217 (!HConstant::cast(right)->HasInteger32Value() ||
4218 HConstant::cast(right)->HasSmiValue()));
4219 SetOperandAt(0, left);
4220 SetOperandAt(1, right);
4221 SetSuccessorAt(0, true_target);
4222 SetSuccessorAt(1, false_target);
4223 }
4225 }; 4224 };
4226 4225
4227 4226
4228 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction { 4227 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction {
4229 public: 4228 public:
4230 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*); 4229 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*);
4231 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*, 4230 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*,
4232 HBasicBlock*, HBasicBlock*); 4231 HBasicBlock*, HBasicBlock*);
4233 4232
4234 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 4233 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
(...skipping 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after
7426 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7425 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7427 }; 7426 };
7428 7427
7429 7428
7430 #undef DECLARE_INSTRUCTION 7429 #undef DECLARE_INSTRUCTION
7431 #undef DECLARE_CONCRETE_INSTRUCTION 7430 #undef DECLARE_CONCRETE_INSTRUCTION
7432 7431
7433 } } // namespace v8::internal 7432 } } // namespace v8::internal
7434 7433
7435 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7434 #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