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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 181413002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/code-stubs.cc ('k') | src/codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index e1d11fb2147ec882e1466155f7b979f59edc42dd..638f9e5a1d044fa7b9060b750049be824669a2ed 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -81,11 +81,6 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
HContext* context() { return context_; }
Isolate* isolate() { return info_.isolate(); }
- HLoadNamedField* BuildLoadNamedField(HValue* object,
- Representation representation,
- int offset,
- bool is_inobject);
-
enum ArgumentClass {
NONE,
SINGLE,
@@ -252,7 +247,8 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(Isolate* isolate) {
GetCodeKind(),
GetICState(),
GetExtraICState(),
- GetStubType());
+ GetStubType(),
+ GetStubFlags());
Handle<Code> new_object = factory->NewCode(
desc, flags, masm.CodeObject(), NeedsImmovableCode());
return new_object;
@@ -299,8 +295,7 @@ HValue* CodeStubGraphBuilder<ToNumberStub>::BuildCodeStub() {
// Check if the parameter is already a SMI or heap number.
IfBuilder if_number(this);
if_number.If<HIsSmiAndBranch>(value);
- if_number.OrIf<HCompareMap>(value, isolate()->factory()->heap_number_map(),
- top_info());
+ if_number.OrIf<HCompareMap>(value, isolate()->factory()->heap_number_map());
if_number.Then();
// Return the number.
@@ -363,8 +358,7 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
HValue* elements = AddLoadElements(boilerplate);
IfBuilder if_fixed_cow(this);
- if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map(),
- top_info());
+ if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map());
if_fixed_cow.Then();
push_value = BuildCloneShallowArray(boilerplate,
allocation_site,
@@ -375,7 +369,7 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
if_fixed_cow.Else();
IfBuilder if_fixed(this);
- if_fixed.If<HCompareMap>(elements, factory->fixed_array_map(), top_info());
+ if_fixed.If<HCompareMap>(elements, factory->fixed_array_map());
if_fixed.Then();
push_value = BuildCloneShallowArray(boilerplate,
allocation_site,
@@ -536,11 +530,15 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
object);
- HInstruction* feedback_vector = GetParameter(0);
- HInstruction* slot = GetParameter(1);
- Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS,
- INITIALIZING_STORE);
- return feedback_vector;
+ // We use a hammer (SkipWriteBarrier()) to indicate that we know the input
+ // cell is really a Cell, and so no write barrier is needed.
+ // TODO(mvstanton): Add a debug_code check to verify the input cell is really
+ // a cell. (perhaps with a new instruction, HAssert).
+ HInstruction* cell = GetParameter(0);
+ HObjectAccess access = HObjectAccess::ForCellValue();
+ store = Add<HStoreNamedField>(cell, access, object);
+ store->SkipWriteBarrier();
+ return cell;
}
@@ -554,7 +552,7 @@ HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
HInstruction* load = BuildUncheckedMonomorphicElementAccess(
GetParameter(0), GetParameter(1), NULL,
casted_stub()->is_js_array(), casted_stub()->elements_kind(),
- LOAD, NEVER_RETURN_HOLE, STANDARD_STORE);
+ false, NEVER_RETURN_HOLE, STANDARD_STORE);
return load;
}
@@ -564,32 +562,14 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) {
}
-HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
- HValue* object,
- Representation representation,
- int offset,
- bool is_inobject) {
- HObjectAccess access = is_inobject
- ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
- : HObjectAccess::ForBackingStoreOffset(offset, representation);
- if (representation.IsDouble()) {
- // Load the heap number.
- object = Add<HLoadNamedField>(
- object, static_cast<HValue*>(NULL),
- access.WithRepresentation(Representation::Tagged()));
- // Load the double value from it.
- access = HObjectAccess::ForHeapNumberValue();
- }
- return Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), access);
-}
-
-
template<>
HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() {
- return BuildLoadNamedField(GetParameter(0),
- casted_stub()->representation(),
- casted_stub()->offset(),
- casted_stub()->is_inobject());
+ Representation rep = casted_stub()->representation();
+ int offset = casted_stub()->offset();
+ HObjectAccess access = casted_stub()->is_inobject() ?
+ HObjectAccess::ForObservableJSObjectOffset(offset, rep) :
+ HObjectAccess::ForBackingStoreOffset(offset, rep);
+ return AddLoadNamedField(GetParameter(0), access);
}
@@ -600,10 +580,12 @@ Handle<Code> LoadFieldStub::GenerateCode(Isolate* isolate) {
template<>
HValue* CodeStubGraphBuilder<KeyedLoadFieldStub>::BuildCodeStub() {
- return BuildLoadNamedField(GetParameter(0),
- casted_stub()->representation(),
- casted_stub()->offset(),
- casted_stub()->is_inobject());
+ Representation rep = casted_stub()->representation();
+ int offset = casted_stub()->offset();
+ HObjectAccess access = casted_stub()->is_inobject() ?
+ HObjectAccess::ForObservableJSObjectOffset(offset, rep) :
+ HObjectAccess::ForBackingStoreOffset(offset, rep);
+ return AddLoadNamedField(GetParameter(0), access);
}
@@ -617,7 +599,7 @@ HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
BuildUncheckedMonomorphicElementAccess(
GetParameter(0), GetParameter(1), GetParameter(2),
casted_stub()->is_js_array(), casted_stub()->elements_kind(),
- STORE, NEVER_RETURN_HOLE, casted_stub()->store_mode());
+ true, NEVER_RETURN_HOLE, casted_stub()->store_mode());
return GetParameter(2);
}
@@ -1114,7 +1096,7 @@ HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() {
BuildUncheckedMonomorphicElementAccess(object, key, value,
casted_stub()->is_jsarray(),
casted_stub()->to_kind(),
- STORE, ALLOW_RETURN_HOLE,
+ true, ALLOW_RETURN_HOLE,
casted_stub()->store_mode());
}
« no previous file with comments | « src/code-stubs.cc ('k') | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698