Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: src/hydrogen.cc

Issue 296023002: Get rid of HStoreNamedField::SkipWriteBarrier(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 964db8bdcc0af450eafe73d541871abb1e4e9c0e..c7b8eea46cc9dd3d5587d1291effc250041ea368 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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),
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698