Commit 1db42896 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[objects] Remove obsolete fields for old OSR support.

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

Change-Id: Ib8bb85674f63fed47aa55a775eaade6b14d60f2e
Reviewed-on: https://chromium-review.googlesource.com/654040Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47873}
parent f199674b
......@@ -3821,20 +3821,6 @@ void Code::set_has_reloc_info_for_serialization(bool value) {
WRITE_UINT32_FIELD(this, kFullCodeFlags, flags);
}
int Code::allow_osr_at_loop_nesting_level() const {
DCHECK_EQ(FUNCTION, kind());
int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
return AllowOSRAtLoopNestingLevelField::decode(fields);
}
void Code::set_allow_osr_at_loop_nesting_level(int level) {
DCHECK_EQ(FUNCTION, kind());
DCHECK(level >= 0 && level <= AbstractCode::kMaxLoopNestingMarker);
int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
int updated = AllowOSRAtLoopNestingLevelField::update(previous, level);
WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
}
int Code::builtin_index() const {
int index = READ_INT_FIELD(this, kBuiltinIndexOffset);
......@@ -3880,27 +3866,6 @@ void Code::set_safepoint_table_offset(unsigned offset) {
WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
}
unsigned Code::back_edge_table_offset() const {
DCHECK_EQ(FUNCTION, kind());
return BackEdgeTableOffsetField::decode(
READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)) << kPointerSizeLog2;
}
void Code::set_back_edge_table_offset(unsigned offset) {
DCHECK_EQ(FUNCTION, kind());
DCHECK(IsAligned(offset, static_cast<unsigned>(kPointerSize)));
offset = offset >> kPointerSizeLog2;
int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
int updated = BackEdgeTableOffsetField::update(previous, offset);
WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
}
bool Code::back_edges_patched_for_osr() const {
DCHECK_EQ(FUNCTION, kind());
return allow_osr_at_loop_nesting_level() > 0;
}
bool Code::marked_for_deoptimization() const {
DCHECK(kind() == OPTIMIZED_FUNCTION);
......
......@@ -14565,16 +14565,12 @@ void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT
int size = instruction_size();
int safepoint_offset =
is_turbofanned() ? static_cast<int>(safepoint_table_offset()) : size;
int back_edge_offset = (kind() == Code::FUNCTION)
? static_cast<int>(back_edge_table_offset())
: size;
int constant_pool_offset = FLAG_enable_embedded_constant_pool
? this->constant_pool_offset()
: size;
// Stop before reaching any embedded tables
int code_size = Min(safepoint_offset, back_edge_offset);
code_size = Min(code_size, constant_pool_offset);
int code_size = Min(safepoint_offset, constant_pool_offset);
byte* begin = instruction_start();
byte* end = begin + code_size;
Disassembler::Decode(isolate, &os, begin, end, this);
......
......@@ -3805,13 +3805,6 @@ class Code: public HeapObject {
inline bool has_reloc_info_for_serialization() const;
inline void set_has_reloc_info_for_serialization(bool value);
// [allow_osr_at_loop_nesting_level]: For FUNCTION kind, tells for
// how long the function has been marked for OSR and therefore which
// level of loop nesting we are willing to do on-stack replacement
// for.
inline void set_allow_osr_at_loop_nesting_level(int level);
inline int allow_osr_at_loop_nesting_level() const;
// [builtin_index]: For builtins, tells which builtin index the code object
// has. Note that builtins can have a code kind other than BUILTIN. The
// builtin index is a non-negative integer for builtins, and -1 otherwise.
......@@ -3829,13 +3822,6 @@ class Code: public HeapObject {
inline unsigned safepoint_table_offset() const;
inline void set_safepoint_table_offset(unsigned offset);
// [back_edge_table_start]: For kind FUNCTION, the offset in the
// instruction stream where the back edge table starts.
inline unsigned back_edge_table_offset() const;
inline void set_back_edge_table_offset(unsigned offset);
inline bool back_edges_patched_for_osr() const;
// [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether
// the code is going to be deoptimized because of dead embedded maps.
inline bool marked_for_deoptimization() const;
......@@ -4053,9 +4039,6 @@ class Code: public HeapObject {
static const int kTrapHandlerIndex = kBuiltinIndexOffset + kIntSize;
static const int kHeaderPaddingStart = kTrapHandlerIndex + kPointerSize;
enum TrapFields { kTrapCodeOffset, kTrapLandingOffset, kTrapDataSize };
// Add padding to align the instruction start following right after
// the Code object header.
static const int kHeaderSize =
......@@ -4129,12 +4112,6 @@ class Code: public HeapObject {
kSafepointTableOffsetFirstBit,
kSafepointTableOffsetBitCount> {}; // NOLINT
// KindSpecificFlags2 layout (FUNCTION)
class BackEdgeTableOffsetField
: public BitField<int, kHasTaggedStackBit + 1, 27> {}; // NOLINT
class AllowOSRAtLoopNestingLevelField
: public BitField<int, kHasTaggedStackBit + 1 + 27, 4> {}; // NOLINT
static const int kArgumentsBits = 16;
static const int kMaxArguments = (1 << kArgumentsBits) - 1;
......@@ -4203,8 +4180,6 @@ class AbstractCode : public HeapObject {
// Max loop nesting marker used to postpose OSR. We don't take loop
// nesting that is deeper than 5 levels into account.
static const int kMaxLoopNestingMarker = 6;
STATIC_ASSERT(Code::AllowOSRAtLoopNestingLevelField::kMax >=
kMaxLoopNestingMarker);
};
// Dependent code is a singly linked list of fixed arrays. Each array contains
......
......@@ -649,9 +649,7 @@ static void CheckCodeForUnsafeLiteral(Handle<JSFunction> f) {
if (f->code()->kind() == Code::FUNCTION) {
Address pc = f->code()->instruction_start();
int decode_size =
Min(f->code()->instruction_size(),
static_cast<int>(f->code()->back_edge_table_offset()));
int decode_size = f->code()->instruction_size();
if (FLAG_enable_embedded_constant_pool) {
decode_size = Min(decode_size, f->code()->constant_pool_offset());
}
......
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