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

Unified Diff: src/code-stub-assembler.cc

Issue 2436423003: [stubs] Fine-tune monomorphic IC dispatcher performance (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index e7df20d9cc2edbcd4ea785eb766729b87a967256..99097ca92ff8553ff1f68665b5d2f4cb248cc488 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -4784,8 +4784,7 @@ void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback,
compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) {
Variable var_receiver_map(this, MachineRepresentation::kTagged);
- // TODO(ishell): defer blocks when it works.
- Label load_smi_map(this /*, Label::kDeferred*/), load_receiver_map(this),
+ Label load_smi_map(this, Label::kDeferred), load_receiver_map(this),
if_result(this);
Branch(TaggedIsSmi(receiver), &load_smi_map, &load_receiver_map);
@@ -4811,17 +4810,22 @@ compiler::Node* CodeStubAssembler::TryMonomorphicCase(
// TODO(ishell): add helper class that hides offset computations for a series
// of loads.
int32_t header_size = FixedArray::kHeaderSize - kHeapObjectTag;
- Node* offset = ElementOffsetFromIndex(slot, FAST_HOLEY_ELEMENTS,
- SMI_PARAMETERS, header_size);
- Node* feedback = Load(MachineType::AnyTagged(), vector, offset);
+ // Adding |header_size| with a separate IntPtrAdd rather than passing it
+ // into ElementOffsetFromIndex() allows it to be folded into a single
+ // [base, index, offset] indirect memory access on x64.
+ Node* offset =
+ ElementOffsetFromIndex(slot, FAST_HOLEY_ELEMENTS, SMI_PARAMETERS);
+ Node* feedback = Load(MachineType::AnyTagged(), vector,
+ IntPtrAdd(offset, IntPtrConstant(header_size)));
// Try to quickly handle the monomorphic case without knowing for sure
// if we have a weak cell in feedback. We do know it's safe to look
// at WeakCell::kValueOffset.
- GotoUnless(WordEqual(receiver_map, LoadWeakCellValue(feedback)), if_miss);
+ GotoIf(WordNotEqual(receiver_map, LoadWeakCellValue(feedback)), if_miss);
- Node* handler = Load(MachineType::AnyTagged(), vector,
- IntPtrAdd(offset, IntPtrConstant(kPointerSize)));
+ Node* handler =
+ Load(MachineType::AnyTagged(), vector,
+ IntPtrAdd(offset, IntPtrConstant(header_size + kPointerSize)));
var_handler->Bind(handler);
Goto(if_handler);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698