Commit 6e745789 authored by ishell@chromium.org's avatar ishell@chromium.org

Use stability to only conditionally flush information from the map check table.

R=ishell@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21274 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 631b6619
This diff is collapsed.
......@@ -3957,7 +3957,7 @@ void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
free_space_instr->InsertBefore(this);
HConstant* filler_map = HConstant::CreateAndInsertAfter(
zone, Unique<Map>::CreateImmovable(
isolate()->factory()->free_space_map()), free_space_instr);
isolate()->factory()->free_space_map()), true, free_space_instr);
HInstruction* store_map = HStoreNamedField::New(zone, context(),
free_space_instr, HObjectAccess::ForMap(), filler_map);
store_map->SetFlag(HValue::kHasNoObservableSideEffects);
......
......@@ -1575,6 +1575,7 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction {
}
Unique<Map> map() const { return map_; }
bool map_is_stable() const { return map_is_stable_; }
virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
return Representation::Tagged();
......@@ -1591,12 +1592,14 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction {
HBasicBlock* true_target = NULL,
HBasicBlock* false_target = NULL)
: HUnaryControlInstruction(value, true_target, false_target),
known_successor_index_(kNoKnownSuccessorIndex), map_(Unique<Map>(map)) {
ASSERT(!map.is_null());
known_successor_index_(kNoKnownSuccessorIndex),
map_is_stable_(map->is_stable()),
map_(Unique<Map>::CreateImmovable(map)) {
set_representation(Representation::Tagged());
}
int known_successor_index_;
int known_successor_index_ : 31;
bool map_is_stable_ : 1;
Unique<Map> map_;
};
......@@ -2769,6 +2772,7 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
bool IsStabilityCheck() const { return is_stability_check_; }
void MarkAsStabilityCheck() {
maps_are_stable_ = true;
has_migration_target_ = false;
is_stability_check_ = true;
ClearChangesFlag(kNewSpacePromotion);
......@@ -2799,16 +2803,16 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
Unique<Map> map,
bool map_is_stable,
HInstruction* instr) {
return CreateAndInsertAfter(zone, value, new(zone) UniqueSet<Map>(
map, zone), map_is_stable, instr);
return instr->Append(new(zone) HCheckMaps(
value, new(zone) UniqueSet<Map>(map, zone), map_is_stable));
}
static HCheckMaps* CreateAndInsertAfter(Zone* zone,
HValue* value,
const UniqueSet<Map>* maps,
bool maps_are_stable,
HInstruction* instr) {
return instr->Append(new(zone) HCheckMaps(value, maps, maps_are_stable));
static HCheckMaps* CreateAndInsertBefore(Zone* zone,
HValue* value,
const UniqueSet<Map>* maps,
bool maps_are_stable,
HInstruction* instr) {
return instr->Prepend(new(zone) HCheckMaps(value, maps, maps_are_stable));
}
DECLARE_CONCRETE_INSTRUCTION(CheckMaps)
......@@ -3502,20 +3506,21 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> {
}
static HConstant* CreateAndInsertBefore(Zone* zone,
Unique<Object> object,
bool is_not_in_new_space,
Unique<Map> map,
bool map_is_stable,
HInstruction* instruction) {
return instruction->Prepend(new(zone) HConstant(
object, Unique<Map>(Handle<Map>::null()), false,
Representation::Tagged(), HType::Tagged(), is_not_in_new_space,
false, false, kUnknownInstanceType));
map, Unique<Map>(Handle<Map>::null()), map_is_stable,
Representation::Tagged(), HType::Tagged(), true,
false, false, MAP_TYPE));
}
static HConstant* CreateAndInsertAfter(Zone* zone,
Unique<Map> map,
bool map_is_stable,
HInstruction* instruction) {
return instruction->Append(new(zone) HConstant(
map, Unique<Map>(Handle<Map>::null()), false,
map, Unique<Map>(Handle<Map>::null()), map_is_stable,
Representation::Tagged(), HType::Tagged(), true,
false, false, MAP_TYPE));
}
......
......@@ -5450,13 +5450,7 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedField(
UniqueSet<Map>* maps = new(zone()) UniqueSet<Map>(map_list->length(), zone());
for (int i = 0; i < map_list->length(); ++i) {
Handle<Map> map = map_list->at(i);
maps->Add(Unique<Map>::CreateImmovable(map), zone());
// TODO(bmeurer): Get rid of this shit!
if (map->CanTransition()) {
Map::AddDependentCompilationInfo(
map, DependentCode::kPrototypeCheckGroup, top_info());
}
maps->Add(Unique<Map>::CreateImmovable(map_list->at(i)), zone());
}
return New<HLoadNamedField>(
checked_object, checked_object, access, maps, info->field_type());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment