| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_LITHIUM_H_ | 5 #ifndef V8_LITHIUM_H_ |
| 6 #define V8_LITHIUM_H_ | 6 #define V8_LITHIUM_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #define LITHIUM_OPERAND_PREDICATE(name, type, number) \ | 41 #define LITHIUM_OPERAND_PREDICATE(name, type, number) \ |
| 42 bool Is##name() const { return kind() == type; } | 42 bool Is##name() const { return kind() == type; } |
| 43 LITHIUM_OPERAND_LIST(LITHIUM_OPERAND_PREDICATE) | 43 LITHIUM_OPERAND_LIST(LITHIUM_OPERAND_PREDICATE) |
| 44 LITHIUM_OPERAND_PREDICATE(Unallocated, UNALLOCATED, 0) | 44 LITHIUM_OPERAND_PREDICATE(Unallocated, UNALLOCATED, 0) |
| 45 LITHIUM_OPERAND_PREDICATE(Ignored, INVALID, 0) | 45 LITHIUM_OPERAND_PREDICATE(Ignored, INVALID, 0) |
| 46 #undef LITHIUM_OPERAND_PREDICATE | 46 #undef LITHIUM_OPERAND_PREDICATE |
| 47 bool Equals(LOperand* other) const { return value_ == other->value_; } | 47 bool Equals(LOperand* other) const { return value_ == other->value_; } |
| 48 | 48 |
| 49 void PrintTo(StringStream* stream); | 49 void PrintTo(StringStream* stream); |
| 50 void ConvertTo(Kind kind, int index) { | 50 void ConvertTo(Kind kind, int index) { |
| 51 if (kind == REGISTER) ASSERT(index >= 0); | 51 if (kind == REGISTER) DCHECK(index >= 0); |
| 52 value_ = KindField::encode(kind); | 52 value_ = KindField::encode(kind); |
| 53 value_ |= index << kKindFieldWidth; | 53 value_ |= index << kKindFieldWidth; |
| 54 ASSERT(this->index() == index); | 54 DCHECK(this->index() == index); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Calls SetUpCache()/TearDownCache() for each subclass. | 57 // Calls SetUpCache()/TearDownCache() for each subclass. |
| 58 static void SetUpCaches(); | 58 static void SetUpCaches(); |
| 59 static void TearDownCaches(); | 59 static void TearDownCaches(); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 static const int kKindFieldWidth = 3; | 62 static const int kKindFieldWidth = 3; |
| 63 class KindField : public BitField<Kind, 0, kKindFieldWidth> { }; | 63 class KindField : public BitField<Kind, 0, kKindFieldWidth> { }; |
| 64 | 64 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 USED_AT_END | 100 USED_AT_END |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 explicit LUnallocated(ExtendedPolicy policy) : LOperand(UNALLOCATED, 0) { | 103 explicit LUnallocated(ExtendedPolicy policy) : LOperand(UNALLOCATED, 0) { |
| 104 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); | 104 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); |
| 105 value_ |= ExtendedPolicyField::encode(policy); | 105 value_ |= ExtendedPolicyField::encode(policy); |
| 106 value_ |= LifetimeField::encode(USED_AT_END); | 106 value_ |= LifetimeField::encode(USED_AT_END); |
| 107 } | 107 } |
| 108 | 108 |
| 109 LUnallocated(BasicPolicy policy, int index) : LOperand(UNALLOCATED, 0) { | 109 LUnallocated(BasicPolicy policy, int index) : LOperand(UNALLOCATED, 0) { |
| 110 ASSERT(policy == FIXED_SLOT); | 110 DCHECK(policy == FIXED_SLOT); |
| 111 value_ |= BasicPolicyField::encode(policy); | 111 value_ |= BasicPolicyField::encode(policy); |
| 112 value_ |= index << FixedSlotIndexField::kShift; | 112 value_ |= index << FixedSlotIndexField::kShift; |
| 113 ASSERT(this->fixed_slot_index() == index); | 113 DCHECK(this->fixed_slot_index() == index); |
| 114 } | 114 } |
| 115 | 115 |
| 116 LUnallocated(ExtendedPolicy policy, int index) : LOperand(UNALLOCATED, 0) { | 116 LUnallocated(ExtendedPolicy policy, int index) : LOperand(UNALLOCATED, 0) { |
| 117 ASSERT(policy == FIXED_REGISTER || policy == FIXED_DOUBLE_REGISTER); | 117 DCHECK(policy == FIXED_REGISTER || policy == FIXED_DOUBLE_REGISTER); |
| 118 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); | 118 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); |
| 119 value_ |= ExtendedPolicyField::encode(policy); | 119 value_ |= ExtendedPolicyField::encode(policy); |
| 120 value_ |= LifetimeField::encode(USED_AT_END); | 120 value_ |= LifetimeField::encode(USED_AT_END); |
| 121 value_ |= FixedRegisterField::encode(index); | 121 value_ |= FixedRegisterField::encode(index); |
| 122 } | 122 } |
| 123 | 123 |
| 124 LUnallocated(ExtendedPolicy policy, Lifetime lifetime) | 124 LUnallocated(ExtendedPolicy policy, Lifetime lifetime) |
| 125 : LOperand(UNALLOCATED, 0) { | 125 : LOperand(UNALLOCATED, 0) { |
| 126 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); | 126 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); |
| 127 value_ |= ExtendedPolicyField::encode(policy); | 127 value_ |= ExtendedPolicyField::encode(policy); |
| 128 value_ |= LifetimeField::encode(lifetime); | 128 value_ |= LifetimeField::encode(lifetime); |
| 129 } | 129 } |
| 130 | 130 |
| 131 LUnallocated* CopyUnconstrained(Zone* zone) { | 131 LUnallocated* CopyUnconstrained(Zone* zone) { |
| 132 LUnallocated* result = new(zone) LUnallocated(ANY); | 132 LUnallocated* result = new(zone) LUnallocated(ANY); |
| 133 result->set_virtual_register(virtual_register()); | 133 result->set_virtual_register(virtual_register()); |
| 134 return result; | 134 return result; |
| 135 } | 135 } |
| 136 | 136 |
| 137 static LUnallocated* cast(LOperand* op) { | 137 static LUnallocated* cast(LOperand* op) { |
| 138 ASSERT(op->IsUnallocated()); | 138 DCHECK(op->IsUnallocated()); |
| 139 return reinterpret_cast<LUnallocated*>(op); | 139 return reinterpret_cast<LUnallocated*>(op); |
| 140 } | 140 } |
| 141 | 141 |
| 142 // The encoding used for LUnallocated operands depends on the policy that is | 142 // The encoding used for LUnallocated operands depends on the policy that is |
| 143 // stored within the operand. The FIXED_SLOT policy uses a compact encoding | 143 // stored within the operand. The FIXED_SLOT policy uses a compact encoding |
| 144 // because it accommodates a larger pay-load. | 144 // because it accommodates a larger pay-load. |
| 145 // | 145 // |
| 146 // For FIXED_SLOT policy: | 146 // For FIXED_SLOT policy: |
| 147 // +------------------------------------------+ | 147 // +------------------------------------------+ |
| 148 // | slot_index | vreg | 0 | 001 | | 148 // | slot_index | vreg | 0 | 001 | |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 extended_policy() == WRITABLE_REGISTER; | 215 extended_policy() == WRITABLE_REGISTER; |
| 216 } | 216 } |
| 217 | 217 |
| 218 // [basic_policy]: Distinguish between FIXED_SLOT and all other policies. | 218 // [basic_policy]: Distinguish between FIXED_SLOT and all other policies. |
| 219 BasicPolicy basic_policy() const { | 219 BasicPolicy basic_policy() const { |
| 220 return BasicPolicyField::decode(value_); | 220 return BasicPolicyField::decode(value_); |
| 221 } | 221 } |
| 222 | 222 |
| 223 // [extended_policy]: Only for non-FIXED_SLOT. The finer-grained policy. | 223 // [extended_policy]: Only for non-FIXED_SLOT. The finer-grained policy. |
| 224 ExtendedPolicy extended_policy() const { | 224 ExtendedPolicy extended_policy() const { |
| 225 ASSERT(basic_policy() == EXTENDED_POLICY); | 225 DCHECK(basic_policy() == EXTENDED_POLICY); |
| 226 return ExtendedPolicyField::decode(value_); | 226 return ExtendedPolicyField::decode(value_); |
| 227 } | 227 } |
| 228 | 228 |
| 229 // [fixed_slot_index]: Only for FIXED_SLOT. | 229 // [fixed_slot_index]: Only for FIXED_SLOT. |
| 230 int fixed_slot_index() const { | 230 int fixed_slot_index() const { |
| 231 ASSERT(HasFixedSlotPolicy()); | 231 DCHECK(HasFixedSlotPolicy()); |
| 232 return static_cast<int>(value_) >> FixedSlotIndexField::kShift; | 232 return static_cast<int>(value_) >> FixedSlotIndexField::kShift; |
| 233 } | 233 } |
| 234 | 234 |
| 235 // [fixed_register_index]: Only for FIXED_REGISTER or FIXED_DOUBLE_REGISTER. | 235 // [fixed_register_index]: Only for FIXED_REGISTER or FIXED_DOUBLE_REGISTER. |
| 236 int fixed_register_index() const { | 236 int fixed_register_index() const { |
| 237 ASSERT(HasFixedRegisterPolicy() || HasFixedDoubleRegisterPolicy()); | 237 DCHECK(HasFixedRegisterPolicy() || HasFixedDoubleRegisterPolicy()); |
| 238 return FixedRegisterField::decode(value_); | 238 return FixedRegisterField::decode(value_); |
| 239 } | 239 } |
| 240 | 240 |
| 241 // [virtual_register]: The virtual register ID for this operand. | 241 // [virtual_register]: The virtual register ID for this operand. |
| 242 int virtual_register() const { | 242 int virtual_register() const { |
| 243 return VirtualRegisterField::decode(value_); | 243 return VirtualRegisterField::decode(value_); |
| 244 } | 244 } |
| 245 void set_virtual_register(unsigned id) { | 245 void set_virtual_register(unsigned id) { |
| 246 value_ = VirtualRegisterField::update(value_, id); | 246 value_ = VirtualRegisterField::update(value_, id); |
| 247 } | 247 } |
| 248 | 248 |
| 249 // [lifetime]: Only for non-FIXED_SLOT. | 249 // [lifetime]: Only for non-FIXED_SLOT. |
| 250 bool IsUsedAtStart() { | 250 bool IsUsedAtStart() { |
| 251 ASSERT(basic_policy() == EXTENDED_POLICY); | 251 DCHECK(basic_policy() == EXTENDED_POLICY); |
| 252 return LifetimeField::decode(value_) == USED_AT_START; | 252 return LifetimeField::decode(value_) == USED_AT_START; |
| 253 } | 253 } |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 | 256 |
| 257 class LMoveOperands V8_FINAL BASE_EMBEDDED { | 257 class LMoveOperands V8_FINAL BASE_EMBEDDED { |
| 258 public: | 258 public: |
| 259 LMoveOperands(LOperand* source, LOperand* destination) | 259 LMoveOperands(LOperand* source, LOperand* destination) |
| 260 : source_(source), destination_(destination) { | 260 : source_(source), destination_(destination) { |
| 261 } | 261 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 284 (destination_ != NULL && destination_->IsConstantOperand()); | 284 (destination_ != NULL && destination_->IsConstantOperand()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 bool IsIgnored() const { | 287 bool IsIgnored() const { |
| 288 return destination_ != NULL && destination_->IsIgnored(); | 288 return destination_ != NULL && destination_->IsIgnored(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 // We clear both operands to indicate move that's been eliminated. | 291 // We clear both operands to indicate move that's been eliminated. |
| 292 void Eliminate() { source_ = destination_ = NULL; } | 292 void Eliminate() { source_ = destination_ = NULL; } |
| 293 bool IsEliminated() const { | 293 bool IsEliminated() const { |
| 294 ASSERT(source_ != NULL || destination_ == NULL); | 294 DCHECK(source_ != NULL || destination_ == NULL); |
| 295 return source_ == NULL; | 295 return source_ == NULL; |
| 296 } | 296 } |
| 297 | 297 |
| 298 private: | 298 private: |
| 299 LOperand* source_; | 299 LOperand* source_; |
| 300 LOperand* destination_; | 300 LOperand* destination_; |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 | 303 |
| 304 template<LOperand::Kind kOperandKind, int kNumCachedOperands> | 304 template<LOperand::Kind kOperandKind, int kNumCachedOperands> |
| 305 class LSubKindOperand V8_FINAL : public LOperand { | 305 class LSubKindOperand V8_FINAL : public LOperand { |
| 306 public: | 306 public: |
| 307 static LSubKindOperand* Create(int index, Zone* zone) { | 307 static LSubKindOperand* Create(int index, Zone* zone) { |
| 308 ASSERT(index >= 0); | 308 DCHECK(index >= 0); |
| 309 if (index < kNumCachedOperands) return &cache[index]; | 309 if (index < kNumCachedOperands) return &cache[index]; |
| 310 return new(zone) LSubKindOperand(index); | 310 return new(zone) LSubKindOperand(index); |
| 311 } | 311 } |
| 312 | 312 |
| 313 static LSubKindOperand* cast(LOperand* op) { | 313 static LSubKindOperand* cast(LOperand* op) { |
| 314 ASSERT(op->kind() == kOperandKind); | 314 DCHECK(op->kind() == kOperandKind); |
| 315 return reinterpret_cast<LSubKindOperand*>(op); | 315 return reinterpret_cast<LSubKindOperand*>(op); |
| 316 } | 316 } |
| 317 | 317 |
| 318 static void SetUpCache(); | 318 static void SetUpCache(); |
| 319 static void TearDownCache(); | 319 static void TearDownCache(); |
| 320 | 320 |
| 321 private: | 321 private: |
| 322 static LSubKindOperand* cache; | 322 static LSubKindOperand* cache; |
| 323 | 323 |
| 324 LSubKindOperand() : LOperand() { } | 324 LSubKindOperand() : LOperand() { } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 const ZoneList<LOperand*>* GetNormalizedOperands() { | 361 const ZoneList<LOperand*>* GetNormalizedOperands() { |
| 362 for (int i = 0; i < untagged_operands_.length(); ++i) { | 362 for (int i = 0; i < untagged_operands_.length(); ++i) { |
| 363 RemovePointer(untagged_operands_[i]); | 363 RemovePointer(untagged_operands_[i]); |
| 364 } | 364 } |
| 365 untagged_operands_.Clear(); | 365 untagged_operands_.Clear(); |
| 366 return &pointer_operands_; | 366 return &pointer_operands_; |
| 367 } | 367 } |
| 368 int lithium_position() const { return lithium_position_; } | 368 int lithium_position() const { return lithium_position_; } |
| 369 | 369 |
| 370 void set_lithium_position(int pos) { | 370 void set_lithium_position(int pos) { |
| 371 ASSERT(lithium_position_ == -1); | 371 DCHECK(lithium_position_ == -1); |
| 372 lithium_position_ = pos; | 372 lithium_position_ = pos; |
| 373 } | 373 } |
| 374 | 374 |
| 375 void RecordPointer(LOperand* op, Zone* zone); | 375 void RecordPointer(LOperand* op, Zone* zone); |
| 376 void RemovePointer(LOperand* op); | 376 void RemovePointer(LOperand* op); |
| 377 void RecordUntagged(LOperand* op, Zone* zone); | 377 void RecordUntagged(LOperand* op, Zone* zone); |
| 378 void PrintTo(StringStream* stream); | 378 void PrintTo(StringStream* stream); |
| 379 | 379 |
| 380 private: | 380 private: |
| 381 ZoneList<LOperand*> pointer_operands_; | 381 ZoneList<LOperand*> pointer_operands_; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 Zone* zone() const { return zone_; } | 428 Zone* zone() const { return zone_; } |
| 429 | 429 |
| 430 bool has_been_used() const { return has_been_used_; } | 430 bool has_been_used() const { return has_been_used_; } |
| 431 void set_has_been_used() { has_been_used_ = true; } | 431 void set_has_been_used() { has_been_used_ = true; } |
| 432 | 432 |
| 433 void AddValue(LOperand* operand, | 433 void AddValue(LOperand* operand, |
| 434 Representation representation, | 434 Representation representation, |
| 435 bool is_uint32) { | 435 bool is_uint32) { |
| 436 values_.Add(operand, zone()); | 436 values_.Add(operand, zone()); |
| 437 if (representation.IsSmiOrTagged()) { | 437 if (representation.IsSmiOrTagged()) { |
| 438 ASSERT(!is_uint32); | 438 DCHECK(!is_uint32); |
| 439 is_tagged_.Add(values_.length() - 1, zone()); | 439 is_tagged_.Add(values_.length() - 1, zone()); |
| 440 } | 440 } |
| 441 | 441 |
| 442 if (is_uint32) { | 442 if (is_uint32) { |
| 443 is_uint32_.Add(values_.length() - 1, zone()); | 443 is_uint32_.Add(values_.length() - 1, zone()); |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 | 446 |
| 447 bool HasTaggedValueAt(int index) const { | 447 bool HasTaggedValueAt(int index) const { |
| 448 return is_tagged_.Contains(index); | 448 return is_tagged_.Contains(index); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 459 object_mapping_.Add(encoded, zone()); | 459 object_mapping_.Add(encoded, zone()); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void AddDuplicateObject(int dupe_of) { | 462 void AddDuplicateObject(int dupe_of) { |
| 463 uint32_t encoded = LengthOrDupeField::encode(dupe_of) | | 463 uint32_t encoded = LengthOrDupeField::encode(dupe_of) | |
| 464 IsDuplicateField::encode(true); | 464 IsDuplicateField::encode(true); |
| 465 object_mapping_.Add(encoded, zone()); | 465 object_mapping_.Add(encoded, zone()); |
| 466 } | 466 } |
| 467 | 467 |
| 468 int ObjectDuplicateOfAt(int index) { | 468 int ObjectDuplicateOfAt(int index) { |
| 469 ASSERT(ObjectIsDuplicateAt(index)); | 469 DCHECK(ObjectIsDuplicateAt(index)); |
| 470 return LengthOrDupeField::decode(object_mapping_[index]); | 470 return LengthOrDupeField::decode(object_mapping_[index]); |
| 471 } | 471 } |
| 472 | 472 |
| 473 int ObjectLengthAt(int index) { | 473 int ObjectLengthAt(int index) { |
| 474 ASSERT(!ObjectIsDuplicateAt(index)); | 474 DCHECK(!ObjectIsDuplicateAt(index)); |
| 475 return LengthOrDupeField::decode(object_mapping_[index]); | 475 return LengthOrDupeField::decode(object_mapping_[index]); |
| 476 } | 476 } |
| 477 | 477 |
| 478 bool ObjectIsArgumentsAt(int index) { | 478 bool ObjectIsArgumentsAt(int index) { |
| 479 ASSERT(!ObjectIsDuplicateAt(index)); | 479 DCHECK(!ObjectIsDuplicateAt(index)); |
| 480 return IsArgumentsField::decode(object_mapping_[index]); | 480 return IsArgumentsField::decode(object_mapping_[index]); |
| 481 } | 481 } |
| 482 | 482 |
| 483 bool ObjectIsDuplicateAt(int index) { | 483 bool ObjectIsDuplicateAt(int index) { |
| 484 return IsDuplicateField::decode(object_mapping_[index]); | 484 return IsDuplicateField::decode(object_mapping_[index]); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void Register(int deoptimization_index, | 487 void Register(int deoptimization_index, |
| 488 int translation_index, | 488 int translation_index, |
| 489 int pc_offset) { | 489 int pc_offset) { |
| 490 ASSERT(!HasBeenRegistered()); | 490 DCHECK(!HasBeenRegistered()); |
| 491 deoptimization_index_ = deoptimization_index; | 491 deoptimization_index_ = deoptimization_index; |
| 492 translation_index_ = translation_index; | 492 translation_index_ = translation_index; |
| 493 pc_offset_ = pc_offset; | 493 pc_offset_ = pc_offset; |
| 494 } | 494 } |
| 495 bool HasBeenRegistered() const { | 495 bool HasBeenRegistered() const { |
| 496 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex; | 496 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex; |
| 497 } | 497 } |
| 498 | 498 |
| 499 void PrintTo(StringStream* stream); | 499 void PrintTo(StringStream* stream); |
| 500 | 500 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 explicit ShallowIterator(LEnvironment* env) | 539 explicit ShallowIterator(LEnvironment* env) |
| 540 : env_(env), | 540 : env_(env), |
| 541 limit_(env != NULL ? env->values()->length() : 0), | 541 limit_(env != NULL ? env->values()->length() : 0), |
| 542 current_(0) { | 542 current_(0) { |
| 543 SkipUninteresting(); | 543 SkipUninteresting(); |
| 544 } | 544 } |
| 545 | 545 |
| 546 bool Done() { return current_ >= limit_; } | 546 bool Done() { return current_ >= limit_; } |
| 547 | 547 |
| 548 LOperand* Current() { | 548 LOperand* Current() { |
| 549 ASSERT(!Done()); | 549 DCHECK(!Done()); |
| 550 ASSERT(env_->values()->at(current_) != NULL); | 550 DCHECK(env_->values()->at(current_) != NULL); |
| 551 return env_->values()->at(current_); | 551 return env_->values()->at(current_); |
| 552 } | 552 } |
| 553 | 553 |
| 554 void Advance() { | 554 void Advance() { |
| 555 ASSERT(!Done()); | 555 DCHECK(!Done()); |
| 556 ++current_; | 556 ++current_; |
| 557 SkipUninteresting(); | 557 SkipUninteresting(); |
| 558 } | 558 } |
| 559 | 559 |
| 560 LEnvironment* env() { return env_; } | 560 LEnvironment* env() { return env_; } |
| 561 | 561 |
| 562 private: | 562 private: |
| 563 bool ShouldSkip(LOperand* op) { | 563 bool ShouldSkip(LOperand* op) { |
| 564 return op == NULL || op->IsConstantOperand(); | 564 return op == NULL || op->IsConstantOperand(); |
| 565 } | 565 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 581 class DeepIterator V8_FINAL BASE_EMBEDDED { | 581 class DeepIterator V8_FINAL BASE_EMBEDDED { |
| 582 public: | 582 public: |
| 583 explicit DeepIterator(LEnvironment* env) | 583 explicit DeepIterator(LEnvironment* env) |
| 584 : current_iterator_(env) { | 584 : current_iterator_(env) { |
| 585 SkipUninteresting(); | 585 SkipUninteresting(); |
| 586 } | 586 } |
| 587 | 587 |
| 588 bool Done() { return current_iterator_.Done(); } | 588 bool Done() { return current_iterator_.Done(); } |
| 589 | 589 |
| 590 LOperand* Current() { | 590 LOperand* Current() { |
| 591 ASSERT(!current_iterator_.Done()); | 591 DCHECK(!current_iterator_.Done()); |
| 592 ASSERT(current_iterator_.Current() != NULL); | 592 DCHECK(current_iterator_.Current() != NULL); |
| 593 return current_iterator_.Current(); | 593 return current_iterator_.Current(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void Advance() { | 596 void Advance() { |
| 597 current_iterator_.Advance(); | 597 current_iterator_.Advance(); |
| 598 SkipUninteresting(); | 598 SkipUninteresting(); |
| 599 } | 599 } |
| 600 | 600 |
| 601 private: | 601 private: |
| 602 void SkipUninteresting() { | 602 void SkipUninteresting() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 643 |
| 644 const ZoneList<Handle<JSFunction> >* inlined_closures() const { | 644 const ZoneList<Handle<JSFunction> >* inlined_closures() const { |
| 645 return &inlined_closures_; | 645 return &inlined_closures_; |
| 646 } | 646 } |
| 647 | 647 |
| 648 void AddInlinedClosure(Handle<JSFunction> closure) { | 648 void AddInlinedClosure(Handle<JSFunction> closure) { |
| 649 inlined_closures_.Add(closure, zone()); | 649 inlined_closures_.Add(closure, zone()); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void AddDeprecationDependency(Handle<Map> map) { | 652 void AddDeprecationDependency(Handle<Map> map) { |
| 653 ASSERT(!map->is_deprecated()); | 653 DCHECK(!map->is_deprecated()); |
| 654 if (!map->CanBeDeprecated()) return; | 654 if (!map->CanBeDeprecated()) return; |
| 655 ASSERT(!info_->IsStub()); | 655 DCHECK(!info_->IsStub()); |
| 656 deprecation_dependencies_.insert(map); | 656 deprecation_dependencies_.insert(map); |
| 657 } | 657 } |
| 658 | 658 |
| 659 void AddStabilityDependency(Handle<Map> map) { | 659 void AddStabilityDependency(Handle<Map> map) { |
| 660 ASSERT(map->is_stable()); | 660 DCHECK(map->is_stable()); |
| 661 if (!map->CanTransition()) return; | 661 if (!map->CanTransition()) return; |
| 662 ASSERT(!info_->IsStub()); | 662 DCHECK(!info_->IsStub()); |
| 663 stability_dependencies_.insert(map); | 663 stability_dependencies_.insert(map); |
| 664 } | 664 } |
| 665 | 665 |
| 666 Zone* zone() const { return info_->zone(); } | 666 Zone* zone() const { return info_->zone(); } |
| 667 | 667 |
| 668 Handle<Code> Codegen(); | 668 Handle<Code> Codegen(); |
| 669 | 669 |
| 670 void set_allocated_double_registers(BitVector* allocated_registers); | 670 void set_allocated_double_registers(BitVector* allocated_registers); |
| 671 BitVector* allocated_double_registers() { | 671 BitVector* allocated_double_registers() { |
| 672 return allocated_double_registers_; | 672 return allocated_double_registers_; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 private: | 797 private: |
| 798 InputIterator input_iterator_; | 798 InputIterator input_iterator_; |
| 799 DeepIterator env_iterator_; | 799 DeepIterator env_iterator_; |
| 800 }; | 800 }; |
| 801 | 801 |
| 802 class LInstruction; | 802 class LInstruction; |
| 803 class LCodeGen; | 803 class LCodeGen; |
| 804 } } // namespace v8::internal | 804 } } // namespace v8::internal |
| 805 | 805 |
| 806 #endif // V8_LITHIUM_H_ | 806 #endif // V8_LITHIUM_H_ |
| OLD | NEW |