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

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

Issue 866493003: Retry "Use a WeakCell in the CallIC type vector." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 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/heap/objects-visiting-inl.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 dd2f788b4bfa1283aa3fc420aa656b6c5631f5e9..9d4c64e764cd06ce122ff1227abe2016a28509e0 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -450,6 +450,10 @@ Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
template <>
HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
+ // This stub is performance sensitive, the generated code must be tuned
+ // so that it doesn't build an eager frame.
+ info()->MarkMustNotHaveEagerFrame();
+
HValue* size = Add<HConstant>(AllocationSite::kSize);
HInstruction* object = Add<HAllocate>(size, HType::JSObject(), TENURED,
JS_OBJECT_TYPE);
@@ -523,6 +527,36 @@ Handle<Code> CreateAllocationSiteStub::GenerateCode() {
template <>
+HValue* CodeStubGraphBuilder<CreateWeakCellStub>::BuildCodeStub() {
+ // This stub is performance sensitive, the generated code must be tuned
+ // so that it doesn't build an eager frame.
+ info()->MarkMustNotHaveEagerFrame();
+
+ HValue* size = Add<HConstant>(WeakCell::kSize);
+ HInstruction* object =
+ Add<HAllocate>(size, HType::JSObject(), TENURED, JS_OBJECT_TYPE);
+
+ Handle<Map> weak_cell_map = isolate()->factory()->weak_cell_map();
+ AddStoreMapConstant(object, weak_cell_map);
+
+ HInstruction* value = GetParameter(CreateWeakCellDescriptor::kValueIndex);
+ Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellValue(), value);
+ Add<HStoreNamedField>(object, HObjectAccess::ForWeakCellNext(),
+ graph()->GetConstantUndefined());
+
+ HInstruction* feedback_vector =
+ GetParameter(CreateWeakCellDescriptor::kVectorIndex);
+ HInstruction* slot = GetParameter(CreateWeakCellDescriptor::kSlotIndex);
+ Add<HStoreKeyed>(feedback_vector, slot, object, FAST_ELEMENTS,
+ INITIALIZING_STORE);
+ return graph()->GetConstant0();
+}
+
+
+Handle<Code> CreateWeakCellStub::GenerateCode() { return DoGenerateCode(this); }
+
+
+template <>
HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() {
int context_index = casted_stub()->context_index();
int slot_index = casted_stub()->slot_index();
« no previous file with comments | « src/code-stubs.cc ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698