Commit 6ee34530 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[literals] Don't reserve unused FeedbackVectorSlot for the empty object literal

Bug: v8:6211
Change-Id: Ie838cf118679e12483689e2c223e7ecc8335db18
Reviewed-on: https://chromium-review.googlesource.com/662759Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48418}
parent 0c370623
...@@ -393,6 +393,9 @@ void ObjectLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec, ...@@ -393,6 +393,9 @@ void ObjectLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode, LanguageMode language_mode,
FunctionKind kind, FunctionKind kind,
FeedbackSlotCache* cache) { FeedbackSlotCache* cache) {
// The empty object literal doesn't need any feedback vector slot.
if (this->IsEmptyObjectLiteral()) return;
MaterializedLiteral::AssignFeedbackSlots(spec, language_mode, kind, cache); MaterializedLiteral::AssignFeedbackSlots(spec, language_mode, kind, cache);
// This logic that computes the number of slots needed for vector store // This logic that computes the number of slots needed for vector store
......
...@@ -338,10 +338,10 @@ bytecodes: [ ...@@ -338,10 +338,10 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0), /* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0), B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(1), U8(41), R(1), /* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41), R(1),
/* 60 E> */ B(ToName), R(2), /* 60 E> */ B(ToName), R(2),
B(LdaSmi), I8(1), B(LdaSmi), I8(1),
B(StaDataPropertyInLiteral), R(1), R(2), U8(0), U8(2), B(StaDataPropertyInLiteral), R(1), R(2), U8(0), U8(1),
B(CreateEmptyObjectLiteral), B(CreateEmptyObjectLiteral),
B(Star), R(3), B(Star), R(3),
B(Mov), R(1), R(2), B(Mov), R(1), R(2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment