Commit fd4da6bf authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Get rid of HStoreNamedField::SkipWriteBarrier().

The write barrier elimination does the right thing now, so
we can get rid of this hack.

R=mvstanton@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b09989ec
......@@ -500,7 +500,7 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
// Store an empty fixed array for the code dependency.
HConstant* empty_fixed_array =
Add<HConstant>(isolate()->factory()->empty_fixed_array());
HStoreNamedField* store = Add<HStoreNamedField>(
Add<HStoreNamedField>(
object,
HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kDependentCodeOffset),
......@@ -512,10 +512,15 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
HValue* site = Add<HLoadNamedField>(
site_list, static_cast<HValue*>(NULL),
HObjectAccess::ForAllocationSiteList());
store = Add<HStoreNamedField>(object,
// TODO(mvstanton): This is a store to a weak pointer, which we may want to
// mark as such in order to skip the write barrier, once we have a unified
// system for weakness. For now we decided to keep it like this because having
// an initial write barrier backed store makes this pointer strong until the
// next GC, and allocation sites are designed to survive several GCs anyway.
Add<HStoreNamedField>(
object,
HObjectAccess::ForAllocationSiteOffset(AllocationSite::kWeakNextOffset),
site);
store->SkipWriteBarrier();
Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
object);
......
......@@ -6704,11 +6704,6 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> {
}
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
void SkipWriteBarrier() { write_barrier_mode_ = SKIP_WRITE_BARRIER; }
bool IsSkipWriteBarrier() const {
return write_barrier_mode_ == SKIP_WRITE_BARRIER;
}
HValue* object() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
......@@ -6717,7 +6712,6 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> {
StoreFieldOrKeyedMode store_mode() const { return store_mode_; }
bool NeedsWriteBarrier() {
if (IsSkipWriteBarrier()) return false;
if (field_representation().IsDouble()) return false;
if (field_representation().IsSmi()) return false;
if (field_representation().IsInteger32()) return false;
......@@ -6742,7 +6736,6 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> {
StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE)
: access_(access),
new_space_dominator_(NULL),
write_barrier_mode_(UPDATE_WRITE_BARRIER),
store_mode_(store_mode) {
// Stores to a non existing in-object property are allowed only to the
// newly allocated objects (via HAllocate or HInnerAllocatedObject).
......@@ -6755,7 +6748,6 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<2> {
HObjectAccess access_;
HValue* new_space_dominator_;
WriteBarrierMode write_barrier_mode_ : 1;
StoreFieldOrKeyedMode store_mode_ : 1;
};
......
......@@ -1560,7 +1560,9 @@ HValue* HGraphBuilder::BuildRegExpConstructResult(HValue* length,
HValue* native_context = Add<HLoadNamedField>(
global_object, static_cast<HValue*>(NULL),
HObjectAccess::ForGlobalObjectNativeContext());
AddStoreMapNoWriteBarrier(result, Add<HLoadNamedField>(
Add<HStoreNamedField>(
result, HObjectAccess::ForMap(),
Add<HLoadNamedField>(
native_context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(Context::REGEXP_RESULT_MAP_INDEX)));
Add<HStoreNamedField>(
......@@ -1581,8 +1583,7 @@ HValue* HGraphBuilder::BuildRegExpConstructResult(HValue* length,
input);
// Initialize the elements header.
AddStoreMapConstantNoWriteBarrier(elements,
isolate()->factory()->fixed_array_map());
AddStoreMapConstant(elements, isolate()->factory()->fixed_array_map());
Add<HStoreNamedField>(elements, HObjectAccess::ForFixedArrayLength(), length);
// Initialize the elements contents with undefined.
......@@ -1832,14 +1833,16 @@ HValue* HGraphBuilder::BuildCreateConsString(
if_onebyte.Then();
{
// We can safely skip the write barrier for storing the map here.
Handle<Map> map = isolate()->factory()->cons_ascii_string_map();
AddStoreMapConstantNoWriteBarrier(result, map);
Add<HStoreNamedField>(
result, HObjectAccess::ForMap(),
Add<HConstant>(isolate()->factory()->cons_ascii_string_map()));
}
if_onebyte.Else();
{
// We can safely skip the write barrier for storing the map here.
Handle<Map> map = isolate()->factory()->cons_string_map();
AddStoreMapConstantNoWriteBarrier(result, map);
Add<HStoreNamedField>(
result, HObjectAccess::ForMap(),
Add<HConstant>(isolate()->factory()->cons_string_map()));
}
if_onebyte.End();
......@@ -1998,9 +2001,7 @@ HValue* HGraphBuilder::BuildUncheckedStringAdd(
// STRING_TYPE or ASCII_STRING_TYPE here, so we just use STRING_TYPE here.
HAllocate* result = BuildAllocate(
size, HType::String(), STRING_TYPE, allocation_mode);
// We can safely skip the write barrier for storing map here.
AddStoreMapNoWriteBarrier(result, map);
Add<HStoreNamedField>(result, HObjectAccess::ForMap(), map);
// Initialize the string fields.
Add<HStoreNamedField>(result, HObjectAccess::ForStringHashField(),
......@@ -2307,7 +2308,7 @@ void HGraphBuilder::BuildInitializeElementsHeader(HValue* elements,
? factory->fixed_double_array_map()
: factory->fixed_array_map();
AddStoreMapConstant(elements, map);
Add<HStoreNamedField>(elements, HObjectAccess::ForMap(), Add<HConstant>(map));
Add<HStoreNamedField>(elements, HObjectAccess::ForFixedArrayLength(),
capacity);
}
......@@ -2812,11 +2813,9 @@ void HGraphBuilder::BuildCreateAllocationMemento(
// This smi value is reset to zero after every gc, overflow isn't a problem
// since the counter is bounded by the new space size.
memento_create_count->ClearFlag(HValue::kCanOverflow);
HStoreNamedField* store = Add<HStoreNamedField>(
Add<HStoreNamedField>(
allocation_site, HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kPretenureCreateCountOffset), memento_create_count);
// No write barrier needed to store a smi.
store->SkipWriteBarrier();
}
}
......@@ -3034,13 +3033,6 @@ HValue* HGraphBuilder::JSArrayBuilder::AllocateArray(HValue* size_in_bytes,
}
HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object,
Handle<Map> map) {
return Add<HStoreNamedField>(object, HObjectAccess::ForMap(),
Add<HConstant>(map));
}
HValue* HGraphBuilder::AddLoadJSBuiltin(Builtins::JavaScript builtin) {
HValue* global_object = Add<HLoadNamedField>(
context(), static_cast<HValue*>(NULL),
......
......@@ -1388,18 +1388,9 @@ class HGraphBuilder {
HInstruction* AddLoadStringInstanceType(HValue* string);
HInstruction* AddLoadStringLength(HValue* string);
HStoreNamedField* AddStoreMapNoWriteBarrier(HValue* object, HValue* map) {
HStoreNamedField* store_map = Add<HStoreNamedField>(
object, HObjectAccess::ForMap(), map);
store_map->SkipWriteBarrier();
return store_map;
}
HStoreNamedField* AddStoreMapConstant(HValue* object, Handle<Map> map);
HStoreNamedField* AddStoreMapConstantNoWriteBarrier(HValue* object,
Handle<Map> map) {
HStoreNamedField* store_map = AddStoreMapConstant(object, map);
store_map->SkipWriteBarrier();
return store_map;
HStoreNamedField* AddStoreMapConstant(HValue* object, Handle<Map> map) {
return Add<HStoreNamedField>(object, HObjectAccess::ForMap(),
Add<HConstant>(map));
}
HLoadNamedField* AddLoadElements(HValue* object,
HValue* dependency = NULL);
......
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