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

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

Issue 1469833005: [runtime] Pass closure to %CreateArrayLiteral and %CreateObjectLiteral. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | src/compiler/ast-graph-builder.cc » ('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 8ec255b2644fff2329f069941e231cec3bb03fdc..aa3f50ddca174d6051bc089eb615b4b8728c3b09 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -437,14 +437,19 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
Factory* factory = isolate()->factory();
HValue* undefined = graph()->GetConstantUndefined();
AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode();
+ HValue* closure = GetParameter(0);
+ HValue* literal_index = GetParameter(1);
// This stub is very performance sensitive, the generated code must be tuned
// so that it doesn't build and eager frame.
info()->MarkMustNotHaveEagerFrame();
+ HValue* literals_array = Add<HLoadNamedField>(
+ closure, nullptr, HObjectAccess::ForLiteralsPointer());
+
HInstruction* allocation_site = Add<HLoadKeyed>(
- GetParameter(0), GetParameter(1), nullptr, FAST_ELEMENTS,
- NEVER_RETURN_HOLE, LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag);
+ literals_array, literal_index, nullptr, FAST_ELEMENTS, NEVER_RETURN_HOLE,
+ LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag);
IfBuilder checker(this);
checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
undefined);
@@ -504,10 +509,15 @@ Handle<Code> FastCloneShallowArrayStub::GenerateCode() {
template <>
HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
HValue* undefined = graph()->GetConstantUndefined();
+ HValue* closure = GetParameter(0);
+ HValue* literal_index = GetParameter(1);
+
+ HValue* literals_array = Add<HLoadNamedField>(
+ closure, nullptr, HObjectAccess::ForLiteralsPointer());
HInstruction* allocation_site = Add<HLoadKeyed>(
- GetParameter(0), GetParameter(1), nullptr, FAST_ELEMENTS,
- NEVER_RETURN_HOLE, LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag);
+ literals_array, literal_index, nullptr, FAST_ELEMENTS, NEVER_RETURN_HOLE,
+ LiteralsArray::kOffsetToFirstLiteral - kHeapObjectTag);
IfBuilder checker(this);
checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site,
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698