Commit 4f0029a4 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Reduce size of OSR nesting level field.

R=rmcilroy@chromium.org
BUG=v8:4764

Review-Url: https://codereview.chromium.org/2185293004
Cr-Commit-Position: refs/heads/master@{#38147}
parent f3f738fe
......@@ -848,7 +848,7 @@ Node* InterpreterAssembler::StackCheckTriggeredInterrupt() {
Node* InterpreterAssembler::LoadOSRNestingLevel() {
Node* offset =
IntPtrConstant(BytecodeArray::kOSRNestingLevelOffset - kHeapObjectTag);
return Load(MachineType::Int32(), BytecodeArrayTaggedPointer(), offset);
return Load(MachineType::Int8(), BytecodeArrayTaggedPointer(), offset);
}
void InterpreterAssembler::Abort(BailoutReason bailout_reason) {
......
......@@ -4099,12 +4099,13 @@ void BytecodeArray::set_interrupt_budget(int interrupt_budget) {
}
int BytecodeArray::osr_loop_nesting_level() const {
return READ_INT_FIELD(this, kOSRNestingLevelOffset);
return READ_INT8_FIELD(this, kOSRNestingLevelOffset);
}
void BytecodeArray::set_osr_loop_nesting_level(int depth) {
DCHECK(0 <= depth && depth <= AbstractCode::kMaxLoopNestingMarker);
WRITE_INT_FIELD(this, kOSRNestingLevelOffset, depth);
STATIC_ASSERT(AbstractCode::kMaxLoopNestingMarker < kMaxInt8);
WRITE_INT8_FIELD(this, kOSRNestingLevelOffset, depth);
}
int BytecodeArray::parameter_count() const {
......
......@@ -4575,10 +4575,8 @@ class BytecodeArray : public FixedArrayBase {
static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize;
static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize;
static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize;
// TODO(4764): The OSR nesting level is guaranteed to be in [0;6] bounds and
// could potentially be merged with another field (e.g. parameter_size).
static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize;
static const int kHeaderSize = kOSRNestingLevelOffset + kIntSize;
static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize;
// Maximal memory consumption for a single BytecodeArray.
static const int kMaxSize = 512 * MB;
......
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