Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 3420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3431 HInstruction* instruction) { | 3431 HInstruction* instruction) { |
| 3432 return instruction->Prepend(HConstant::New( | 3432 return instruction->Prepend(HConstant::New( |
| 3433 zone, context, value, representation)); | 3433 zone, context, value, representation)); |
| 3434 } | 3434 } |
| 3435 | 3435 |
| 3436 static HConstant* CreateAndInsertBefore(Zone* zone, | 3436 static HConstant* CreateAndInsertBefore(Zone* zone, |
| 3437 Unique<Object> unique, | 3437 Unique<Object> unique, |
| 3438 bool is_not_in_new_space, | 3438 bool is_not_in_new_space, |
| 3439 HInstruction* instruction) { | 3439 HInstruction* instruction) { |
| 3440 return instruction->Prepend(new(zone) HConstant( | 3440 return instruction->Prepend(new(zone) HConstant( |
| 3441 unique, Representation::Tagged(), HType::Tagged(), false, | 3441 unique, Representation::Tagged(), HType::Tagged(), |
| 3442 is_not_in_new_space, false, false)); | 3442 is_not_in_new_space, false, false, kUnknownInstanceType)); |
| 3443 } | 3443 } |
| 3444 | 3444 |
| 3445 Handle<Object> handle(Isolate* isolate) { | 3445 Handle<Object> handle(Isolate* isolate) { |
| 3446 if (object_.handle().is_null()) { | 3446 if (object_.handle().is_null()) { |
| 3447 // Default arguments to is_not_in_new_space depend on this heap number | 3447 // Default arguments to is_not_in_new_space depend on this heap number |
| 3448 // to be tenured so that it's guaranteed not to be located in new space. | 3448 // to be tenured so that it's guaranteed not to be located in new space. |
| 3449 object_ = Unique<Object>::CreateUninitialized( | 3449 object_ = Unique<Object>::CreateUninitialized( |
| 3450 isolate->factory()->NewNumber(double_value_, TENURED)); | 3450 isolate->factory()->NewNumber(double_value_, TENURED)); |
| 3451 } | 3451 } |
| 3452 AllowDeferredHandleDereference smi_check; | 3452 AllowDeferredHandleDereference smi_check; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3467 std::isnan(double_value_)); | 3467 std::isnan(double_value_)); |
| 3468 } | 3468 } |
| 3469 | 3469 |
| 3470 bool NotInNewSpace() const { | 3470 bool NotInNewSpace() const { |
| 3471 return is_not_in_new_space_; | 3471 return is_not_in_new_space_; |
| 3472 } | 3472 } |
| 3473 | 3473 |
| 3474 bool ImmortalImmovable() const; | 3474 bool ImmortalImmovable() const; |
| 3475 | 3475 |
| 3476 bool IsCell() const { | 3476 bool IsCell() const { |
| 3477 return is_cell_; | 3477 return instance_type_ == CELL_TYPE || instance_type_ == PROPERTY_CELL_TYPE; |
| 3478 } | 3478 } |
| 3479 | 3479 |
| 3480 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3480 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 3481 return Representation::None(); | 3481 return Representation::None(); |
| 3482 } | 3482 } |
| 3483 | 3483 |
| 3484 virtual Representation KnownOptimalRepresentation() V8_OVERRIDE { | 3484 virtual Representation KnownOptimalRepresentation() V8_OVERRIDE { |
| 3485 if (HasSmiValue() && SmiValuesAre31Bits()) return Representation::Smi(); | 3485 if (HasSmiValue() && SmiValuesAre31Bits()) return Representation::Smi(); |
| 3486 if (HasInteger32Value()) return Representation::Integer32(); | 3486 if (HasInteger32Value()) return Representation::Integer32(); |
| 3487 if (HasNumberValue()) return Representation::Double(); | 3487 if (HasNumberValue()) return Representation::Double(); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 3515 int32_t NumberValueAsInteger32() const { | 3515 int32_t NumberValueAsInteger32() const { |
| 3516 ASSERT(HasNumberValue()); | 3516 ASSERT(HasNumberValue()); |
| 3517 // Irrespective of whether a numeric HConstant can be safely | 3517 // Irrespective of whether a numeric HConstant can be safely |
| 3518 // represented as an int32, we store the (in some cases lossy) | 3518 // represented as an int32, we store the (in some cases lossy) |
| 3519 // representation of the number in int32_value_. | 3519 // representation of the number in int32_value_. |
| 3520 return int32_value_; | 3520 return int32_value_; |
| 3521 } | 3521 } |
| 3522 bool HasStringValue() const { | 3522 bool HasStringValue() const { |
| 3523 if (has_double_value_ || has_int32_value_) return false; | 3523 if (has_double_value_ || has_int32_value_) return false; |
| 3524 ASSERT(!object_.handle().is_null()); | 3524 ASSERT(!object_.handle().is_null()); |
| 3525 return type_.IsString(); | 3525 return instance_type_ < FIRST_NONSTRING_TYPE; |
| 3526 } | 3526 } |
| 3527 Handle<String> StringValue() const { | 3527 Handle<String> StringValue() const { |
| 3528 ASSERT(HasStringValue()); | 3528 ASSERT(HasStringValue()); |
| 3529 return Handle<String>::cast(object_.handle()); | 3529 return Handle<String>::cast(object_.handle()); |
| 3530 } | 3530 } |
| 3531 bool HasInternalizedStringValue() const { | 3531 bool HasInternalizedStringValue() const { |
| 3532 return HasStringValue() && is_internalized_string_; | 3532 return HasStringValue() && StringShape(instance_type_).IsInternalized(); |
| 3533 } | 3533 } |
| 3534 | 3534 |
| 3535 bool HasExternalReferenceValue() const { | 3535 bool HasExternalReferenceValue() const { |
| 3536 return has_external_reference_value_; | 3536 return has_external_reference_value_; |
| 3537 } | 3537 } |
| 3538 ExternalReference ExternalReferenceValue() const { | 3538 ExternalReference ExternalReferenceValue() const { |
| 3539 return external_reference_value_; | 3539 return external_reference_value_; |
| 3540 } | 3540 } |
| 3541 | 3541 |
| 3542 bool HasBooleanValue() const { return type_.IsBoolean(); } | 3542 bool HasBooleanValue() const { return type_.IsBoolean(); } |
| 3543 bool BooleanValue() const { return boolean_value_; } | 3543 bool BooleanValue() const { return boolean_value_; } |
| 3544 bool IsUndetectable() const { return is_undetectable_; } | |
| 3545 InstanceType GetInstanceType() const { return instance_type_; } | |
| 3544 | 3546 |
| 3545 virtual intptr_t Hashcode() V8_OVERRIDE { | 3547 virtual intptr_t Hashcode() V8_OVERRIDE { |
| 3546 if (has_int32_value_) { | 3548 if (has_int32_value_) { |
| 3547 return static_cast<intptr_t>(int32_value_); | 3549 return static_cast<intptr_t>(int32_value_); |
| 3548 } else if (has_double_value_) { | 3550 } else if (has_double_value_) { |
| 3549 return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); | 3551 return static_cast<intptr_t>(BitCast<int64_t>(double_value_)); |
| 3550 } else if (has_external_reference_value_) { | 3552 } else if (has_external_reference_value_) { |
| 3551 return reinterpret_cast<intptr_t>(external_reference_value_.address()); | 3553 return reinterpret_cast<intptr_t>(external_reference_value_.address()); |
| 3552 } else { | 3554 } else { |
| 3553 ASSERT(!object_.handle().is_null()); | 3555 ASSERT(!object_.handle().is_null()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3606 Representation r = Representation::None(), | 3608 Representation r = Representation::None(), |
| 3607 bool is_not_in_new_space = true, | 3609 bool is_not_in_new_space = true, |
| 3608 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); | 3610 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); |
| 3609 HConstant(double value, | 3611 HConstant(double value, |
| 3610 Representation r = Representation::None(), | 3612 Representation r = Representation::None(), |
| 3611 bool is_not_in_new_space = true, | 3613 bool is_not_in_new_space = true, |
| 3612 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); | 3614 Unique<Object> optional = Unique<Object>(Handle<Object>::null())); |
| 3613 HConstant(Unique<Object> unique, | 3615 HConstant(Unique<Object> unique, |
| 3614 Representation r, | 3616 Representation r, |
| 3615 HType type, | 3617 HType type, |
| 3616 bool is_internalized_string, | |
| 3617 bool is_not_in_new_space, | 3618 bool is_not_in_new_space, |
| 3618 bool is_cell, | 3619 bool boolean_value, |
| 3619 bool boolean_value); | 3620 bool is_undetectable, |
| 3621 InstanceType instance_type); | |
| 3620 | 3622 |
| 3621 explicit HConstant(ExternalReference reference); | 3623 explicit HConstant(ExternalReference reference); |
| 3622 | 3624 |
| 3623 void Initialize(Representation r); | 3625 void Initialize(Representation r); |
| 3624 | 3626 |
| 3625 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 3627 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 3626 | 3628 |
| 3627 // If this is a numerical constant, object_ either points to the | 3629 // If this is a numerical constant, object_ either points to the |
| 3628 // HeapObject the constant originated from or is null. If the | 3630 // HeapObject the constant originated from or is null. If the |
| 3629 // constant is non-numeric, object_ always points to a valid | 3631 // constant is non-numeric, object_ always points to a valid |
| 3630 // constant HeapObject. | 3632 // constant HeapObject. |
| 3631 Unique<Object> object_; | 3633 Unique<Object> object_; |
| 3632 | 3634 |
| 3633 // We store the HConstant in the most specific form safely possible. | 3635 // We store the HConstant in the most specific form safely possible. |
| 3634 // The two flags, has_int32_value_ and has_double_value_ tell us if | 3636 // The two flags, has_int32_value_ and has_double_value_ tell us if |
| 3635 // int32_value_ and double_value_ hold valid, safe representations | 3637 // int32_value_ and double_value_ hold valid, safe representations |
| 3636 // of the constant. has_int32_value_ implies has_double_value_ but | 3638 // of the constant. has_int32_value_ implies has_double_value_ but |
| 3637 // not the converse. | 3639 // not the converse. |
| 3638 bool has_smi_value_ : 1; | 3640 bool has_smi_value_ : 1; |
| 3639 bool has_int32_value_ : 1; | 3641 bool has_int32_value_ : 1; |
| 3640 bool has_double_value_ : 1; | 3642 bool has_double_value_ : 1; |
| 3641 bool has_external_reference_value_ : 1; | 3643 bool has_external_reference_value_ : 1; |
| 3642 bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. | 3644 bool is_internalized_string_ : 1; // TODO(yangguo): make this part of HType. |
|
Jakob Kummerow
2014/03/07 18:32:35
I think we don't need this any more.
| |
| 3643 bool is_not_in_new_space_ : 1; | 3645 bool is_not_in_new_space_ : 1; |
| 3644 bool is_cell_ : 1; | |
| 3645 bool boolean_value_ : 1; | 3646 bool boolean_value_ : 1; |
| 3647 bool is_undetectable_: 1; | |
| 3646 int32_t int32_value_; | 3648 int32_t int32_value_; |
| 3647 double double_value_; | 3649 double double_value_; |
| 3648 ExternalReference external_reference_value_; | 3650 ExternalReference external_reference_value_; |
| 3651 | |
| 3652 static const InstanceType kUnknownInstanceType = FILLER_TYPE; | |
| 3653 InstanceType instance_type_; | |
| 3649 }; | 3654 }; |
| 3650 | 3655 |
| 3651 | 3656 |
| 3652 class HBinaryOperation : public HTemplateInstruction<3> { | 3657 class HBinaryOperation : public HTemplateInstruction<3> { |
| 3653 public: | 3658 public: |
| 3654 HBinaryOperation(HValue* context, HValue* left, HValue* right, | 3659 HBinaryOperation(HValue* context, HValue* left, HValue* right, |
| 3655 HType type = HType::Tagged()) | 3660 HType type = HType::Tagged()) |
| 3656 : HTemplateInstruction<3>(type), | 3661 : HTemplateInstruction<3>(type), |
| 3657 observed_output_representation_(Representation::None()) { | 3662 observed_output_representation_(Representation::None()) { |
| 3658 ASSERT(left != NULL && right != NULL); | 3663 ASSERT(left != NULL && right != NULL); |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4307 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction { | 4312 class HIsObjectAndBranch V8_FINAL : public HUnaryControlInstruction { |
| 4308 public: | 4313 public: |
| 4309 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*); | 4314 DECLARE_INSTRUCTION_FACTORY_P1(HIsObjectAndBranch, HValue*); |
| 4310 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*, | 4315 DECLARE_INSTRUCTION_FACTORY_P3(HIsObjectAndBranch, HValue*, |
| 4311 HBasicBlock*, HBasicBlock*); | 4316 HBasicBlock*, HBasicBlock*); |
| 4312 | 4317 |
| 4313 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4318 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4314 return Representation::Tagged(); | 4319 return Representation::Tagged(); |
| 4315 } | 4320 } |
| 4316 | 4321 |
| 4322 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | |
| 4323 | |
| 4317 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch) | 4324 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch) |
| 4318 | 4325 |
| 4319 private: | 4326 private: |
| 4320 HIsObjectAndBranch(HValue* value, | 4327 HIsObjectAndBranch(HValue* value, |
| 4321 HBasicBlock* true_target = NULL, | 4328 HBasicBlock* true_target = NULL, |
| 4322 HBasicBlock* false_target = NULL) | 4329 HBasicBlock* false_target = NULL) |
| 4323 : HUnaryControlInstruction(value, true_target, false_target) {} | 4330 : HUnaryControlInstruction(value, true_target, false_target) {} |
| 4324 }; | 4331 }; |
| 4325 | 4332 |
| 4326 | 4333 |
| 4327 class HIsStringAndBranch V8_FINAL : public HUnaryControlInstruction { | 4334 class HIsStringAndBranch V8_FINAL : public HUnaryControlInstruction { |
| 4328 public: | 4335 public: |
| 4329 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*); | 4336 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*); |
| 4330 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*, | 4337 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*, |
| 4331 HBasicBlock*, HBasicBlock*); | 4338 HBasicBlock*, HBasicBlock*); |
| 4332 | 4339 |
| 4333 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4340 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4334 return Representation::Tagged(); | 4341 return Representation::Tagged(); |
| 4335 } | 4342 } |
| 4336 | 4343 |
| 4344 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | |
| 4345 | |
| 4337 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) | 4346 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) |
| 4338 | 4347 |
| 4339 protected: | 4348 protected: |
| 4340 virtual int RedefinedOperandIndex() { return 0; } | 4349 virtual int RedefinedOperandIndex() { return 0; } |
| 4341 | 4350 |
| 4342 private: | 4351 private: |
| 4343 HIsStringAndBranch(HValue* value, | 4352 HIsStringAndBranch(HValue* value, |
| 4344 HBasicBlock* true_target = NULL, | 4353 HBasicBlock* true_target = NULL, |
| 4345 HBasicBlock* false_target = NULL) | 4354 HBasicBlock* false_target = NULL) |
| 4346 : HUnaryControlInstruction(value, true_target, false_target) {} | 4355 : HUnaryControlInstruction(value, true_target, false_target) {} |
| 4347 }; | 4356 }; |
| 4348 | 4357 |
| 4349 | 4358 |
| 4350 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { | 4359 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { |
| 4351 public: | 4360 public: |
| 4352 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); | 4361 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); |
| 4353 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, | 4362 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, |
| 4354 HBasicBlock*, HBasicBlock*); | 4363 HBasicBlock*, HBasicBlock*); |
| 4355 | 4364 |
| 4356 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) | 4365 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) |
| 4357 | 4366 |
| 4358 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4367 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4359 return Representation::Tagged(); | 4368 return Representation::Tagged(); |
| 4360 } | 4369 } |
| 4361 | 4370 |
| 4371 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | |
| 4372 | |
| 4362 protected: | 4373 protected: |
| 4363 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | 4374 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| 4364 virtual int RedefinedOperandIndex() { return 0; } | 4375 virtual int RedefinedOperandIndex() { return 0; } |
| 4365 | 4376 |
| 4366 private: | 4377 private: |
| 4367 HIsSmiAndBranch(HValue* value, | 4378 HIsSmiAndBranch(HValue* value, |
| 4368 HBasicBlock* true_target = NULL, | 4379 HBasicBlock* true_target = NULL, |
| 4369 HBasicBlock* false_target = NULL) | 4380 HBasicBlock* false_target = NULL) |
| 4370 : HUnaryControlInstruction(value, true_target, false_target) {} | 4381 : HUnaryControlInstruction(value, true_target, false_target) {} |
| 4371 }; | 4382 }; |
| 4372 | 4383 |
| 4373 | 4384 |
| 4374 class HIsUndetectableAndBranch V8_FINAL : public HUnaryControlInstruction { | 4385 class HIsUndetectableAndBranch V8_FINAL : public HUnaryControlInstruction { |
| 4375 public: | 4386 public: |
| 4376 DECLARE_INSTRUCTION_FACTORY_P1(HIsUndetectableAndBranch, HValue*); | 4387 DECLARE_INSTRUCTION_FACTORY_P1(HIsUndetectableAndBranch, HValue*); |
| 4377 DECLARE_INSTRUCTION_FACTORY_P3(HIsUndetectableAndBranch, HValue*, | 4388 DECLARE_INSTRUCTION_FACTORY_P3(HIsUndetectableAndBranch, HValue*, |
| 4378 HBasicBlock*, HBasicBlock*); | 4389 HBasicBlock*, HBasicBlock*); |
| 4379 | 4390 |
| 4380 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4391 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4381 return Representation::Tagged(); | 4392 return Representation::Tagged(); |
| 4382 } | 4393 } |
| 4383 | 4394 |
| 4395 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | |
| 4396 | |
| 4384 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch) | 4397 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch) |
| 4385 | 4398 |
| 4386 private: | 4399 private: |
| 4387 HIsUndetectableAndBranch(HValue* value, | 4400 HIsUndetectableAndBranch(HValue* value, |
| 4388 HBasicBlock* true_target = NULL, | 4401 HBasicBlock* true_target = NULL, |
| 4389 HBasicBlock* false_target = NULL) | 4402 HBasicBlock* false_target = NULL) |
| 4390 : HUnaryControlInstruction(value, true_target, false_target) {} | 4403 : HUnaryControlInstruction(value, true_target, false_target) {} |
| 4391 }; | 4404 }; |
| 4392 | 4405 |
| 4393 | 4406 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4456 | 4469 |
| 4457 InstanceType from() { return from_; } | 4470 InstanceType from() { return from_; } |
| 4458 InstanceType to() { return to_; } | 4471 InstanceType to() { return to_; } |
| 4459 | 4472 |
| 4460 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 4473 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 4461 | 4474 |
| 4462 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4475 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4463 return Representation::Tagged(); | 4476 return Representation::Tagged(); |
| 4464 } | 4477 } |
| 4465 | 4478 |
| 4479 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | |
| 4480 | |
| 4466 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch) | 4481 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch) |
| 4467 | 4482 |
| 4468 private: | 4483 private: |
| 4469 HHasInstanceTypeAndBranch(HValue* value, InstanceType type) | 4484 HHasInstanceTypeAndBranch(HValue* value, InstanceType type) |
| 4470 : HUnaryControlInstruction(value, NULL, NULL), from_(type), to_(type) { } | 4485 : HUnaryControlInstruction(value, NULL, NULL), from_(type), to_(type) { } |
| 4471 HHasInstanceTypeAndBranch(HValue* value, InstanceType from, InstanceType to) | 4486 HHasInstanceTypeAndBranch(HValue* value, InstanceType from, InstanceType to) |
| 4472 : HUnaryControlInstruction(value, NULL, NULL), from_(from), to_(to) { | 4487 : HUnaryControlInstruction(value, NULL, NULL), from_(from), to_(to) { |
| 4473 ASSERT(to == LAST_TYPE); // Others not implemented yet in backend. | 4488 ASSERT(to == LAST_TYPE); // Others not implemented yet in backend. |
| 4474 } | 4489 } |
| 4475 | 4490 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4537 class_name_(class_name) { } | 4552 class_name_(class_name) { } |
| 4538 | 4553 |
| 4539 Handle<String> class_name_; | 4554 Handle<String> class_name_; |
| 4540 }; | 4555 }; |
| 4541 | 4556 |
| 4542 | 4557 |
| 4543 class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction { | 4558 class HTypeofIsAndBranch V8_FINAL : public HUnaryControlInstruction { |
| 4544 public: | 4559 public: |
| 4545 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); | 4560 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); |
| 4546 | 4561 |
| 4547 Handle<String> type_literal() { return type_literal_; } | 4562 Handle<String> type_literal() { return type_literal_.handle(); } |
| 4548 bool compares_number_type() { return compares_number_type_; } | |
| 4549 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 4563 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 4550 | 4564 |
| 4551 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) | 4565 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) |
| 4552 | 4566 |
| 4553 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4567 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4554 return Representation::None(); | 4568 return Representation::None(); |
| 4555 } | 4569 } |
| 4556 | 4570 |
| 4557 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; | 4571 virtual bool KnownSuccessorBlock(HBasicBlock** block) V8_OVERRIDE; |
| 4558 | 4572 |
| 4573 virtual void FinalizeUniqueness() V8_OVERRIDE { | |
| 4574 type_literal_ = Unique<String>(type_literal_.handle()); | |
| 4575 } | |
| 4576 | |
| 4559 private: | 4577 private: |
| 4560 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal) | 4578 HTypeofIsAndBranch(HValue* value, Handle<String> type_literal) |
| 4561 : HUnaryControlInstruction(value, NULL, NULL), | 4579 : HUnaryControlInstruction(value, NULL, NULL), |
|
Jakob Kummerow
2014/03/07 18:32:35
nit: indentation was correct before
| |
| 4562 type_literal_(type_literal) { | 4580 type_literal_(Unique<String>::CreateUninitialized(type_literal)) { } |
| 4563 Heap* heap = type_literal->GetHeap(); | |
| 4564 compares_number_type_ = type_literal->Equals(heap->number_string()); | |
| 4565 } | |
| 4566 | 4581 |
| 4567 Handle<String> type_literal_; | 4582 Unique<String> type_literal_; |
| 4568 bool compares_number_type_ : 1; | 4583 bool compares_number_type_ : 1; |
|
Jakob Kummerow
2014/03/07 18:32:35
is this still used anywhere?
| |
| 4584 bool is_constant_value_ : 1; | |
| 4585 bool constant_check_success_ : 1; | |
| 4569 }; | 4586 }; |
| 4570 | 4587 |
| 4571 | 4588 |
| 4572 class HInstanceOf V8_FINAL : public HBinaryOperation { | 4589 class HInstanceOf V8_FINAL : public HBinaryOperation { |
| 4573 public: | 4590 public: |
| 4574 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); | 4591 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); |
| 4575 | 4592 |
| 4576 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4593 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 4577 return Representation::Tagged(); | 4594 return Representation::Tagged(); |
| 4578 } | 4595 } |
| (...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7519 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7536 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7520 }; | 7537 }; |
| 7521 | 7538 |
| 7522 | 7539 |
| 7523 #undef DECLARE_INSTRUCTION | 7540 #undef DECLARE_INSTRUCTION |
| 7524 #undef DECLARE_CONCRETE_INSTRUCTION | 7541 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7525 | 7542 |
| 7526 } } // namespace v8::internal | 7543 } } // namespace v8::internal |
| 7527 | 7544 |
| 7528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7545 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |