Filler sizes have to be Smis, fix x64 breakage.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/23577002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16355 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
hpayer@chromium.org 2013-08-27 11:51:03 +00:00
parent 166b6d0747
commit dc6a16d6e0
2 changed files with 22 additions and 5 deletions

View File

@ -3296,7 +3296,11 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
} }
HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore( HInstruction* new_dominator_size_constant = HConstant::CreateAndInsertBefore(
zone, context(), new_dominator_size, dominator_allocate); zone,
context(),
new_dominator_size,
Representation::None(),
dominator_allocate);
dominator_allocate->UpdateSize(new_dominator_size_constant); dominator_allocate->UpdateSize(new_dominator_size_constant);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
@ -3389,11 +3393,15 @@ HAllocate* HAllocate::GetFoldableDominator(HAllocate* dominator) {
void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) { void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) {
ASSERT(filler_free_space_size_ != NULL); ASSERT(filler_free_space_size_ != NULL);
Zone* zone = block()->zone(); Zone* zone = block()->zone();
// We must explicitly force Smi representation here because on x64 we
// would otherwise automatically choose int32, but the actual store
// requires a Smi-tagged value.
HConstant* new_free_space_size = HConstant::CreateAndInsertBefore( HConstant* new_free_space_size = HConstant::CreateAndInsertBefore(
zone, zone,
context(), context(),
filler_free_space_size_->value()->GetInteger32Constant() + filler_free_space_size_->value()->GetInteger32Constant() +
free_space_size, free_space_size,
Representation::Smi(),
filler_free_space_size_); filler_free_space_size_);
filler_free_space_size_->UpdateValue(new_free_space_size); filler_free_space_size_->UpdateValue(new_free_space_size);
} }
@ -3419,10 +3427,15 @@ void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
store_map->SetFlag(HValue::kHasNoObservableSideEffects); store_map->SetFlag(HValue::kHasNoObservableSideEffects);
store_map->InsertAfter(filler_map); store_map->InsertAfter(filler_map);
// We must explicitly force Smi representation here because on x64 we
// would otherwise automatically choose int32, but the actual store
// requires a Smi-tagged value.
HConstant* filler_size = HConstant::CreateAndInsertAfter( HConstant* filler_size = HConstant::CreateAndInsertAfter(
zone, context(), free_space_size, store_map); zone, context(), free_space_size, Representation::Smi(), store_map);
// Must force Smi representation for x64 (see comment above).
HObjectAccess access = HObjectAccess access =
HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset); HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset,
Representation::Smi());
HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), HStoreNamedField* store_size = HStoreNamedField::New(zone, context(),
free_space_instr, access, filler_size); free_space_instr, access, filler_size);
store_size->SetFlag(HValue::kHasNoObservableSideEffects); store_size->SetFlag(HValue::kHasNoObservableSideEffects);

View File

@ -3246,8 +3246,10 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
static HConstant* CreateAndInsertAfter(Zone* zone, static HConstant* CreateAndInsertAfter(Zone* zone,
HValue* context, HValue* context,
int32_t value, int32_t value,
Representation representation,
HInstruction* instruction) { HInstruction* instruction) {
HConstant* new_constant = HConstant::New(zone, context, value); HConstant* new_constant =
HConstant::New(zone, context, value, representation);
new_constant->InsertAfter(instruction); new_constant->InsertAfter(instruction);
return new_constant; return new_constant;
} }
@ -3255,8 +3257,10 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
static HConstant* CreateAndInsertBefore(Zone* zone, static HConstant* CreateAndInsertBefore(Zone* zone,
HValue* context, HValue* context,
int32_t value, int32_t value,
Representation representation,
HInstruction* instruction) { HInstruction* instruction) {
HConstant* new_constant = HConstant::New(zone, context, value); HConstant* new_constant =
HConstant::New(zone, context, value, representation);
new_constant->InsertBefore(instruction); new_constant->InsertBefore(instruction);
return new_constant; return new_constant;
} }