Commit d4070531 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[in-place weak refs] Remove DeoptimizationData::WeakCellCache

It's now unused.

BUG=v8:7308

Change-Id: I301b83fde1d941d5d535922a1174d017186b82ce
Reviewed-on: https://chromium-review.googlesource.com/1169017Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55020}
parent e8f5d29d
......@@ -2061,7 +2061,6 @@ DEFINE_DEOPT_ELEMENT_ACCESSORS(LiteralArray, FixedArray)
DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrBytecodeOffset, Smi)
DEFINE_DEOPT_ELEMENT_ACCESSORS(OsrPcOffset, Smi)
DEFINE_DEOPT_ELEMENT_ACCESSORS(OptimizationId, Smi)
DEFINE_DEOPT_ELEMENT_ACCESSORS(WeakCellCache, Object)
DEFINE_DEOPT_ELEMENT_ACCESSORS(InliningPositions, PodArray<InliningPosition>)
DEFINE_DEOPT_ENTRY_ACCESSORS(BytecodeOffsetRaw, Smi)
......
......@@ -14599,29 +14599,6 @@ bool Code::IsIsolateIndependent(Isolate* isolate) {
return is_process_independent;
}
Handle<WeakCell> Code::WeakCellFor(Handle<Code> code) {
DCHECK(code->kind() == OPTIMIZED_FUNCTION);
WeakCell* raw_cell = code->CachedWeakCell();
if (raw_cell != nullptr) {
return Handle<WeakCell>(raw_cell, code->GetIsolate());
}
Handle<WeakCell> cell = code->GetIsolate()->factory()->NewWeakCell(code);
DeoptimizationData::cast(code->deoptimization_data())
->SetWeakCellCache(*cell);
return cell;
}
WeakCell* Code::CachedWeakCell() {
DCHECK(kind() == OPTIMIZED_FUNCTION);
Object* weak_cell_cache =
DeoptimizationData::cast(deoptimization_data())->WeakCellCache();
if (weak_cell_cache->IsWeakCell()) {
DCHECK(this == WeakCell::cast(weak_cell_cache)->value());
return WeakCell::cast(weak_cell_cache);
}
return nullptr;
}
bool Code::Inlines(SharedFunctionInfo* sfi) {
// We can only check for inlining for optimized code.
DCHECK(is_optimized_code());
......
......@@ -356,9 +356,6 @@ class Code : public HeapObject, public NeverReadOnlySpaceObject {
static inline bool IsWeakObjectInOptimizedCode(Object* object);
static Handle<WeakCell> WeakCellFor(Handle<Code> code);
WeakCell* CachedWeakCell();
// Return true if the function is inlined in the code.
bool Inlines(SharedFunctionInfo* sfi);
......@@ -837,9 +834,8 @@ class DeoptimizationData : public FixedArray {
static const int kOsrPcOffsetIndex = 4;
static const int kOptimizationIdIndex = 5;
static const int kSharedFunctionInfoIndex = 6;
static const int kWeakCellCacheIndex = 7;
static const int kInliningPositionsIndex = 8;
static const int kFirstDeoptEntryIndex = 9;
static const int kInliningPositionsIndex = 7;
static const int kFirstDeoptEntryIndex = 8;
// Offsets of deopt entry elements relative to the start of the entry.
static const int kBytecodeOffsetRawOffset = 0;
......@@ -859,7 +855,6 @@ class DeoptimizationData : public FixedArray {
DECL_ELEMENT_ACCESSORS(OsrPcOffset, Smi)
DECL_ELEMENT_ACCESSORS(OptimizationId, Smi)
DECL_ELEMENT_ACCESSORS(SharedFunctionInfo, Object)
DECL_ELEMENT_ACCESSORS(WeakCellCache, Object)
DECL_ELEMENT_ACCESSORS(InliningPositions, PodArray<InliningPosition>)
#undef DECL_ELEMENT_ACCESSORS
......
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