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

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

Issue 2304573004: Port FastCloneShallowArrayStub to Turbofan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: break live range of allocation_site so instruction selection uses nice addressing modes Created 4 years, 3 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
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 3514beed0669a2fdfa01ebe7571d4e407a050cff..ab58db0f27dd8b87510ecc10882f7e7438142314 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -339,85 +339,6 @@ Handle<Code> NumberToStringStub::GenerateCode() {
return DoGenerateCode(this);
}
-
-template <>
-HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
- Factory* factory = isolate()->factory();
- HValue* undefined = graph()->GetConstantUndefined();
- AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode();
- HValue* closure = GetParameter(Descriptor::kClosure);
- HValue* literal_index = GetParameter(Descriptor::kLiteralIndex);
-
- // TODO(turbofan): This codestub has regressed to need a frame on ia32 at some
- // point and wasn't caught since it wasn't built in the snapshot. We should
- // probably just replace with a TurboFan stub rather than fixing it.
-#if !(V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87)
- // This stub is very performance sensitive, the generated code must be tuned
- // so that it doesn't build and eager frame.
- info()->MarkMustNotHaveEagerFrame();
-#endif
-
- HValue* literals_array = Add<HLoadNamedField>(
- closure, nullptr, HObjectAccess::ForLiteralsPointer());
-
- HInstruction* allocation_site = Add<HLoadKeyed>(
- literals_array, literal_index, nullptr, nullptr, FAST_ELEMENTS,
- NEVER_RETURN_HOLE, LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag);
- IfBuilder checker(this);
- checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
- undefined);
- checker.Then();
-
- HObjectAccess access = HObjectAccess::ForAllocationSiteOffset(
- AllocationSite::kTransitionInfoOffset);
- HInstruction* boilerplate =
- Add<HLoadNamedField>(allocation_site, nullptr, access);
- HValue* elements = AddLoadElements(boilerplate);
- HValue* capacity = AddLoadFixedArrayLength(elements);
- IfBuilder zero_capacity(this);
- zero_capacity.If<HCompareNumericAndBranch>(capacity, graph()->GetConstant0(),
- Token::EQ);
- zero_capacity.Then();
- Push(BuildCloneShallowArrayEmpty(boilerplate,
- allocation_site,
- alloc_site_mode));
- zero_capacity.Else();
- IfBuilder if_fixed_cow(this);
- if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map());
- if_fixed_cow.Then();
- Push(BuildCloneShallowArrayCow(boilerplate,
- allocation_site,
- alloc_site_mode,
- FAST_ELEMENTS));
- if_fixed_cow.Else();
- IfBuilder if_fixed(this);
- if_fixed.If<HCompareMap>(elements, factory->fixed_array_map());
- if_fixed.Then();
- Push(BuildCloneShallowArrayNonEmpty(boilerplate,
- allocation_site,
- alloc_site_mode,
- FAST_ELEMENTS));
-
- if_fixed.Else();
- Push(BuildCloneShallowArrayNonEmpty(boilerplate,
- allocation_site,
- alloc_site_mode,
- FAST_DOUBLE_ELEMENTS));
- if_fixed.End();
- if_fixed_cow.End();
- zero_capacity.End();
-
- checker.ElseDeopt(DeoptimizeReason::kUninitializedBoilerplateLiterals);
- checker.End();
-
- return environment()->Pop();
-}
-
-
-Handle<Code> FastCloneShallowArrayStub::GenerateCode() {
- return DoGenerateCode(this);
-}
-
HValue* CodeStubGraphBuilderBase::BuildPushElement(HValue* object, HValue* argc,
HValue* argument_elements,
ElementsKind kind) {
@@ -468,6 +389,7 @@ template <>
HValue* CodeStubGraphBuilder<FastArrayPushStub>::BuildCodeStub() {
// TODO(verwaest): Fix deoptimizer messages.
HValue* argc = GetArgumentsLength();
+
HInstruction* argument_elements = Add<HArgumentsElements>(false, false);
HInstruction* object = Add<HAccessArgumentsAt>(argument_elements, argc,
graph()->GetConstantMinus1());
« src/code-stubs.cc ('K') | « src/code-stubs.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698