Commit 128954a8 authored by Mythri A's avatar Mythri A Committed by Commit Bot

[interpreter] Omit bounds check for interrupt budget loads in bytecode handlers

With lazy feedback allocation we load the interrupt budget from the
ClosureFeedbackCellArray instead of the bytecode array. The factory method
that constructs the ClosureFeedbackCellArray ensures we have a field for
interrupt budget. So, it is safe to omit bounds check here. Including the
bounds check increases the size of all jump bytecode handlers by around
~120 bytes. This translates to ~9-10KB of the native code size on Android.

Bug: chromium:948835
Change-Id: I8e10b3f630097728ae9e520bfb0d85dfc0f806ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1550403Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60603}
parent c13ae846
......@@ -1268,9 +1268,9 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) {
// different places where we track interrupt budget.
GotoIf(IsFeedbackVector(feedback_cell_value), &load_budget_from_bytecode);
TNode<FixedArray> closure_feedback_cell_array = CAST(feedback_cell_value);
TNode<Smi> old_budget_smi = CAST(
LoadFixedArrayElement(closure_feedback_cell_array,
ClosureFeedbackCellArray::kInterruptBudgetIndex));
TNode<Smi> old_budget_smi = CAST(UnsafeLoadFixedArrayElement(
closure_feedback_cell_array,
ClosureFeedbackCellArray::kInterruptBudgetIndex));
old_budget = SmiToInt32(old_budget_smi);
Goto(&load_budget_done);
......@@ -1308,9 +1308,10 @@ void InterpreterAssembler::UpdateInterruptBudget(Node* weight, bool backward) {
// Update budget.
Label update_budget_in_bytecode(this), end(this);
GotoIf(IsFeedbackVector(feedback_cell_value), &update_budget_in_bytecode);
StoreFixedArrayElement(closure_feedback_cell_array,
ClosureFeedbackCellArray::kInterruptBudgetIndex,
SmiFromInt32(new_budget.value()), SKIP_WRITE_BARRIER);
UnsafeStoreFixedArrayElement(closure_feedback_cell_array,
ClosureFeedbackCellArray::kInterruptBudgetIndex,
SmiFromInt32(new_budget.value()),
SKIP_WRITE_BARRIER);
Goto(&end);
BIND(&update_budget_in_bytecode);
......
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