Commit 52407c55 authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[ext-code-space] Avoid Code <-> CodeT conversions in runtime, pt.3

This CL
* migrates FeedbackVector::optimized_code to CodeT,
* migrates OSROptimizedCodeCache to CodeT.

Bug: v8:11880
Change-Id: I2082412fb9fdf90e7ed90f4454ecf55f4f3d53d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3330468Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78367}
parent 907a03d3
......@@ -838,7 +838,7 @@ V8_WARN_UNUSED_RESULT MaybeHandle<Code> GetCodeFromOptimizedCodeCache(
RCS_SCOPE(isolate, RuntimeCallCounterId::kCompileGetFromOptimizedCodeMap);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
DisallowGarbageCollection no_gc;
Code code;
CodeT code;
if (osr_offset.IsNone() && function->has_feedback_vector()) {
FeedbackVector feedback_vector = function->feedback_vector();
feedback_vector.EvictOptimizedCodeMarkedForDeoptimization(
......@@ -858,7 +858,8 @@ V8_WARN_UNUSED_RESULT MaybeHandle<Code> GetCodeFromOptimizedCodeCache(
DCHECK(function->shared().is_compiled());
DCHECK(CodeKindIsStoredInOptimizedCodeCache(code.kind()));
DCHECK_IMPLIES(!osr_offset.IsNone(), CodeKindCanOSR(code.kind()));
return Handle<Code>(code, isolate);
// TODO(v8:11880): avoid roundtrips between cdc and code.
return Handle<Code>(FromCodeT(code), isolate);
}
return MaybeHandle<Code>();
}
......@@ -885,14 +886,15 @@ void InsertCodeIntoOptimizedCodeCache(
}
// Cache optimized code.
Handle<Code> code = compilation_info->code();
Handle<JSFunction> function = compilation_info->closure();
Handle<SharedFunctionInfo> shared(function->shared(), function->GetIsolate());
Isolate* isolate = function->GetIsolate();
Handle<CodeT> code = ToCodeT(compilation_info->code(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<NativeContext> native_context(function->context().native_context(),
function->GetIsolate());
isolate);
if (compilation_info->osr_offset().IsNone()) {
Handle<FeedbackVector> vector =
handle(function->feedback_vector(), function->GetIsolate());
handle(function->feedback_vector(), isolate);
FeedbackVector::SetOptimizedCode(vector, code,
function->raw_feedback_cell());
} else {
......@@ -1020,8 +1022,7 @@ Handle<Code> ContinuationForConcurrentOptimization(
// into the feedback vector.
STATIC_ASSERT(
FeedbackVector::kFeedbackVectorMaybeOptimizedCodeIsStoreRelease);
// TODO(v8:11880): avoid roundtrips between cdc and code.
function->set_code(ToCodeT(function->feedback_vector().optimized_code()));
function->set_code(function->feedback_vector().optimized_code());
}
// TODO(v8:11880): avoid roundtrips between cdc and code.
return handle(FromCodeT(function->code()), isolate);
......@@ -3306,19 +3307,17 @@ void Compiler::PostInstantiation(Handle<JSFunction> function) {
function->feedback_vector().EvictOptimizedCodeMarkedForDeoptimization(
function->raw_feedback_cell(), *shared,
"new function from shared function info");
// TODO(v8:11880): avoid roundtrips between cdc and code.
Code code = function->feedback_vector().optimized_code();
CodeT code = function->feedback_vector().optimized_code();
if (!code.is_null()) {
CodeT codet = ToCodeT(code);
// Caching of optimized code enabled and optimized code found.
DCHECK(!codet.marked_for_deoptimization());
DCHECK(!code.marked_for_deoptimization());
DCHECK(function->shared().is_compiled());
// We don't need a release store because the optimized code was
// stored with release semantics into the vector
STATIC_ASSERT(
FeedbackVector::kFeedbackVectorMaybeOptimizedCodeIsStoreRelease);
function->set_code(codet);
function->set_code(code);
}
}
......
......@@ -8060,7 +8060,7 @@ Handle<CodeT> CompileCWasmEntry(Isolate* isolate, const wasm::FunctionSig* sig,
CHECK_NE(job->FinalizeJob(isolate), CompilationJob::FAILED);
#ifdef V8_EXTERNAL_CODE_SPACE
return handle(ToCodeT(*job->compilation_info()->code()), isolate);
return ToCodeT(job->compilation_info()->code(), isolate);
#else
return job->compilation_info()->code();
#endif
......
......@@ -266,6 +266,14 @@ inline CodeT ToCodeT(Code code) {
#endif
}
inline Handle<CodeT> ToCodeT(Handle<Code> code, Isolate* isolate) {
#ifdef V8_EXTERNAL_CODE_SPACE
return handle(code->code_data_container(kAcquireLoad), isolate);
#else
return code;
#endif
}
inline Code FromCodeT(CodeT code) {
#ifdef V8_EXTERNAL_CODE_SPACE
return code.code();
......@@ -1028,6 +1036,10 @@ bool CodeDataContainer::is_builtin() const {
return builtin_id() != Builtin::kNoBuiltinId;
}
bool CodeDataContainer::is_optimized_code() const {
return CodeKindIsOptimizedJSFunction(kind());
}
inline bool CodeDataContainer::is_interpreter_trampoline_builtin() const {
return IsInterpreterTrampolineBuiltin(builtin_id());
}
......
......@@ -753,6 +753,7 @@ class Code::OptimizedCodeIterator {
// Helper functions for converting Code objects to CodeDataContainer and back
// when V8_EXTERNAL_CODE_SPACE is enabled.
inline CodeT ToCodeT(Code code);
inline Handle<CodeT> ToCodeT(Handle<Code> code, Isolate* isolate);
inline Code FromCodeT(CodeT code);
inline Code FromCodeT(CodeT code, RelaxedLoadTag);
inline Code FromCodeT(CodeT code, AcquireLoadTag);
......
......@@ -124,13 +124,13 @@ void FeedbackVector::clear_invocation_count(RelaxedStoreTag tag) {
set_invocation_count(0, tag);
}
Code FeedbackVector::optimized_code() const {
CodeT FeedbackVector::optimized_code() const {
MaybeObject slot = maybe_optimized_code(kAcquireLoad);
DCHECK(slot->IsWeakOrCleared());
HeapObject heap_object;
Code code;
CodeT code;
if (slot->GetHeapObject(&heap_object)) {
code = FromCodeT(CodeT::cast(heap_object));
code = CodeT::cast(heap_object);
}
// It is possible that the maybe_optimized_code slot is cleared but the
// optimization tier hasn't been updated yet. We update the tier when we
......
......@@ -390,7 +390,7 @@ void FeedbackVector::SaturatingIncrementProfilerTicks() {
// static
void FeedbackVector::SetOptimizedCode(Handle<FeedbackVector> vector,
Handle<Code> code,
Handle<CodeT> code,
FeedbackCell feedback_cell) {
DCHECK(CodeKindIsOptimizedJSFunction(code->kind()));
// We should set optimized code only when there is no valid optimized code or
......@@ -405,7 +405,7 @@ void FeedbackVector::SetOptimizedCode(Handle<FeedbackVector> vector,
// re-mark the function for non-concurrent optimization after an OSR. We
// should avoid these cases and also check that marker isn't
// kCompileOptimized or kCompileOptimizedConcurrent.
vector->set_maybe_optimized_code(HeapObjectReference::Weak(ToCodeT(*code)),
vector->set_maybe_optimized_code(HeapObjectReference::Weak(*code),
kReleaseStore);
int32_t state = vector->flags();
state = OptimizationTierBits::update(state, GetTierForCodeKind(code->kind()));
......
......@@ -236,7 +236,7 @@ class FeedbackVector
DECL_RELAXED_INT32_ACCESSORS(invocation_count)
inline void clear_invocation_count(RelaxedStoreTag tag);
inline Code optimized_code() const;
inline CodeT optimized_code() const;
inline bool has_optimized_code() const;
inline bool has_optimization_marker() const;
inline OptimizationMarker optimization_marker() const;
......@@ -245,8 +245,8 @@ class FeedbackVector
void EvictOptimizedCodeMarkedForDeoptimization(FeedbackCell feedback_cell,
SharedFunctionInfo shared,
const char* reason);
static void SetOptimizedCode(Handle<FeedbackVector> vector, Handle<Code> code,
FeedbackCell feedback_cell);
static void SetOptimizedCode(Handle<FeedbackVector> vector,
Handle<CodeT> code, FeedbackCell feedback_cell);
void SetOptimizationMarker(OptimizationMarker marker);
void ClearOptimizationTier(FeedbackCell feedback_cell);
void InitializeOptimizationState();
......
......@@ -48,7 +48,7 @@ CodeKinds JSFunction::GetAvailableCodeKinds() const {
// Check the optimized code cache.
if (has_feedback_vector() && feedback_vector().has_optimized_code() &&
!feedback_vector().optimized_code().marked_for_deoptimization()) {
Code code = feedback_vector().optimized_code();
CodeT code = feedback_vector().optimized_code();
DCHECK(CodeKindIsOptimizedJSFunction(code.kind()));
result |= CodeKindToCodeKindFlag(code.kind());
}
......
......@@ -17,7 +17,7 @@ const int OSROptimizedCodeCache::kMaxLength;
void OSROptimizedCodeCache::AddOptimizedCode(
Handle<NativeContext> native_context, Handle<SharedFunctionInfo> shared,
Handle<Code> code, BytecodeOffset osr_offset) {
Handle<CodeT> code, BytecodeOffset osr_offset) {
DCHECK(!osr_offset.IsNone());
DCHECK(CodeKindIsOptimizedJSFunction(code->kind()));
STATIC_ASSERT(kEntryLength == 3);
......@@ -90,16 +90,16 @@ void OSROptimizedCodeCache::Compact(Handle<NativeContext> native_context) {
native_context->set_osr_code_cache(*new_osr_cache);
}
Code OSROptimizedCodeCache::GetOptimizedCode(Handle<SharedFunctionInfo> shared,
BytecodeOffset osr_offset,
Isolate* isolate) {
CodeT OSROptimizedCodeCache::GetOptimizedCode(Handle<SharedFunctionInfo> shared,
BytecodeOffset osr_offset,
Isolate* isolate) {
DisallowGarbageCollection no_gc;
int index = FindEntry(shared, osr_offset);
if (index == -1) return Code();
Code code = GetCodeFromEntry(index);
if (index == -1) return CodeT();
CodeT code = GetCodeFromEntry(index);
if (code.is_null()) {
ClearEntry(index, isolate);
return code;
return CodeT();
}
DCHECK(code.is_optimized_code() && !code.marked_for_deoptimization());
return code;
......@@ -114,8 +114,7 @@ void OSROptimizedCodeCache::EvictMarkedCode(Isolate* isolate) {
HeapObject heap_object;
if (!code_entry->GetHeapObject(&heap_object)) continue;
// TODO(v8:11880): avoid roundtrips between cdc and code.
Code code = FromCodeT(CodeT::cast(heap_object));
CodeT code = CodeT::cast(heap_object);
DCHECK(code.is_optimized_code());
if (!code.marked_for_deoptimization()) continue;
......@@ -140,15 +139,14 @@ int OSROptimizedCodeCache::GrowOSRCache(
return old_length;
}
Code OSROptimizedCodeCache::GetCodeFromEntry(int index) {
CodeT OSROptimizedCodeCache::GetCodeFromEntry(int index) {
DCHECK_LE(index + OSRCodeCacheConstants::kEntryLength, length());
DCHECK_EQ(index % kEntryLength, 0);
HeapObject code_entry;
Get(index + OSRCodeCacheConstants::kCachedCodeOffset)
->GetHeapObject(&code_entry);
if (code_entry.is_null()) return Code();
// TODO(v8:11880): avoid roundtrips between cdc and code.
return FromCodeT(CodeT::cast(code_entry));
if (code_entry.is_null()) return CodeT();
return CodeT::cast(code_entry);
}
SharedFunctionInfo OSROptimizedCodeCache::GetSFIFromEntry(int index) {
......@@ -191,13 +189,11 @@ void OSROptimizedCodeCache::ClearEntry(int index, Isolate* isolate) {
void OSROptimizedCodeCache::InitializeEntry(int entry,
SharedFunctionInfo shared,
Code code,
CodeT code,
BytecodeOffset osr_offset) {
Set(entry + OSRCodeCacheConstants::kSharedOffset,
HeapObjectReference::Weak(shared));
// TODO(v8:11880): avoid roundtrips between cdc and code.
HeapObjectReference weak_code_entry =
HeapObjectReference::Weak(ToCodeT(code));
HeapObjectReference weak_code_entry = HeapObjectReference::Weak(code);
Set(entry + OSRCodeCacheConstants::kCachedCodeOffset, weak_code_entry);
Set(entry + OSRCodeCacheConstants::kOsrIdOffset,
MaybeObject::FromSmi(Smi::FromInt(osr_offset.ToInt())));
......
......@@ -32,7 +32,7 @@ class V8_EXPORT OSROptimizedCodeCache : public WeakFixedArray {
// kOSRCodeCacheInitialLength entries.
static void AddOptimizedCode(Handle<NativeContext> context,
Handle<SharedFunctionInfo> shared,
Handle<Code> code, BytecodeOffset osr_offset);
Handle<CodeT> code, BytecodeOffset osr_offset);
// Reduces the size of the OSR code cache if the number of valid entries are
// less than the current capacity of the cache.
static void Compact(Handle<NativeContext> context);
......@@ -42,8 +42,8 @@ class V8_EXPORT OSROptimizedCodeCache : public WeakFixedArray {
// Returns the code corresponding to the shared function |shared| and
// BytecodeOffset |offset| if an entry exists in the cache. Returns an empty
// object otherwise.
Code GetOptimizedCode(Handle<SharedFunctionInfo> shared,
BytecodeOffset osr_offset, Isolate* isolate);
CodeT GetOptimizedCode(Handle<SharedFunctionInfo> shared,
BytecodeOffset osr_offset, Isolate* isolate);
// Remove all code objects marked for deoptimization from OSR code cache.
void EvictMarkedCode(Isolate* isolate);
......@@ -56,14 +56,14 @@ class V8_EXPORT OSROptimizedCodeCache : public WeakFixedArray {
Handle<OSROptimizedCodeCache>* osr_cache);
// Helper functions to get individual items from an entry in the cache.
Code GetCodeFromEntry(int index);
CodeT GetCodeFromEntry(int index);
SharedFunctionInfo GetSFIFromEntry(int index);
BytecodeOffset GetBytecodeOffsetFromEntry(int index);
inline int FindEntry(Handle<SharedFunctionInfo> shared,
BytecodeOffset osr_offset);
inline void ClearEntry(int src, Isolate* isolate);
inline void InitializeEntry(int entry, SharedFunctionInfo shared, Code code,
inline void InitializeEntry(int entry, SharedFunctionInfo shared, CodeT code,
BytecodeOffset osr_offset);
inline void MoveEntry(int src, int dst, Isolate* isolate);
......
......@@ -50,7 +50,7 @@ TEST_F(TestWithNativeContext, AddCodeToEmptyCache) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
BytecodeOffset bailout_id(1);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared, code,
bailout_id);
......@@ -66,7 +66,7 @@ TEST_F(TestWithNativeContext, AddCodeToEmptyCache) {
HeapObject code_entry;
osr_cache->Get(OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&code_entry);
EXPECT_EQ(code_entry, ToCodeT(*code));
EXPECT_EQ(code_entry, *code);
Smi osr_offset_entry;
osr_cache->Get(OSROptimizedCodeCache::kOsrIdOffset)->ToSmi(&osr_offset_entry);
EXPECT_EQ(osr_offset_entry.value(), bailout_id.ToInt());
......@@ -83,7 +83,7 @@ TEST_F(TestWithNativeContext, GrowCodeCache) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
int bailout_id = 0;
for (bailout_id = 0; bailout_id < kInitialEntries; bailout_id++) {
......@@ -108,7 +108,7 @@ TEST_F(TestWithNativeContext, GrowCodeCache) {
HeapObject code_entry;
osr_cache->Get(index + OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&code_entry);
EXPECT_EQ(code_entry, ToCodeT(*code));
EXPECT_EQ(code_entry, *code);
Smi osr_offset_entry;
osr_cache->Get(index + OSROptimizedCodeCache::kOsrIdOffset)
->ToSmi(&osr_offset_entry);
......@@ -126,7 +126,7 @@ TEST_F(TestWithNativeContext, FindCachedEntry) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
int bailout_id = 0;
for (bailout_id = 0; bailout_id < kInitialEntries; bailout_id++) {
......@@ -138,7 +138,7 @@ TEST_F(TestWithNativeContext, FindCachedEntry) {
GetSource(&source1, 1);
Handle<JSFunction> function1 = RunJS<JSFunction>(source1.begin());
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(FromCodeT(function1->code()), isolate);
Handle<CodeT> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
BytecodeOffset(bailout_id));
......@@ -172,7 +172,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
int bailout_id = 0;
// Add max_capacity - 1 entries.
......@@ -189,7 +189,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
GetSource(&source1, 1);
Handle<JSFunction> function1 = RunJS<JSFunction>(source1.begin());
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(FromCodeT(function1->code()), isolate);
Handle<CodeT> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
......@@ -204,7 +204,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
EXPECT_EQ(object, *shared1);
osr_cache->Get(index + OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&object);
EXPECT_EQ(object, ToCodeT(*code1));
EXPECT_EQ(object, *code1);
osr_cache->Get(index + OSROptimizedCodeCache::kOsrIdOffset)->ToSmi(&smi);
EXPECT_EQ(smi.value(), bailout_id);
......@@ -213,7 +213,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
GetSource(&source2, 2);
Handle<JSFunction> function2 = RunJS<JSFunction>(source2.begin());
Handle<SharedFunctionInfo> shared2(function2->shared(), isolate);
Handle<Code> code2(FromCodeT(function2->code()), isolate);
Handle<CodeT> code2(function2->code(), isolate);
bailout_id++;
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared2, code2,
BytecodeOffset(bailout_id));
......@@ -227,7 +227,7 @@ TEST_F(TestWithNativeContext, MaxCapacityCache) {
EXPECT_EQ(object, *shared2);
osr_cache->Get(index + OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&object);
EXPECT_EQ(object, ToCodeT(*code2));
EXPECT_EQ(object, *code2);
osr_cache->Get(index + OSROptimizedCodeCache::kOsrIdOffset)->ToSmi(&smi);
EXPECT_EQ(smi.value(), bailout_id);
}
......@@ -243,7 +243,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
int num_entries = kInitialEntries * 2;
int expected_length = kInitialLength * 2;
......@@ -267,7 +267,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
GetSource(&source1, 1);
Handle<JSFunction> function1 = RunJS<JSFunction>(source1.begin());
Handle<SharedFunctionInfo> shared1(function1->shared(), isolate);
Handle<Code> code1(FromCodeT(function1->code()), isolate);
Handle<CodeT> code1(function1->code(), isolate);
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared1, code1,
BytecodeOffset(bailout_id));
osr_cache = Handle<OSROptimizedCodeCache>(
......@@ -282,7 +282,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
EXPECT_EQ(object, *shared1);
osr_cache->Get(index + OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&object);
EXPECT_EQ(object, ToCodeT(*code1));
EXPECT_EQ(object, *code1);
osr_cache->Get(index + OSROptimizedCodeCache::kOsrIdOffset)->ToSmi(&smi);
EXPECT_EQ(smi.value(), bailout_id);
......@@ -290,7 +290,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
GetSource(&source2, 2);
Handle<JSFunction> function2 = RunJS<JSFunction>(source2.begin());
Handle<SharedFunctionInfo> shared2(function2->shared(), isolate);
Handle<Code> code2(FromCodeT(function2->code()), isolate);
Handle<CodeT> code2(function2->code(), isolate);
bailout_id++;
OSROptimizedCodeCache::AddOptimizedCode(native_context, shared2, code2,
BytecodeOffset(bailout_id));
......@@ -304,7 +304,7 @@ TEST_F(TestWithNativeContext, ReuseClearedEntry) {
EXPECT_EQ(object, *shared2);
osr_cache->Get(index + OSROptimizedCodeCache::kCachedCodeOffset)
->GetHeapObject(&object);
EXPECT_EQ(object, ToCodeT(*code2));
EXPECT_EQ(object, *code2);
osr_cache->Get(index + OSROptimizedCodeCache::kOsrIdOffset)->ToSmi(&smi);
EXPECT_EQ(smi.value(), bailout_id);
}
......@@ -320,13 +320,13 @@ TEST_F(TestWithNativeContext, EvictDeoptedEntriesNoCompact) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
base::ScopedVector<char> source1(1024);
GetSource(&source1, 1);
Handle<JSFunction> deopt_function = RunJS<JSFunction>(source1.begin());
Handle<SharedFunctionInfo> deopt_shared(deopt_function->shared(), isolate);
Handle<Code> deopt_code(FromCodeT(deopt_function->code()), isolate);
Handle<CodeT> deopt_code(deopt_function->code(), isolate);
int num_entries = kInitialEntries * 2;
int expected_length = kInitialLength * 2;
......@@ -379,13 +379,13 @@ TEST_F(TestWithNativeContext, EvictDeoptedEntriesCompact) {
Isolate* isolate = function->GetIsolate();
Handle<NativeContext> native_context(function->native_context(), isolate);
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
Handle<Code> code(FromCodeT(function->code()), isolate);
Handle<CodeT> code(function->code(), isolate);
base::ScopedVector<char> source1(1024);
GetSource(&source1, 1);
Handle<JSFunction> deopt_function = RunJS<JSFunction>(source1.begin());
Handle<SharedFunctionInfo> deopt_shared(deopt_function->shared(), isolate);
Handle<Code> deopt_code(FromCodeT(deopt_function->code()), isolate);
Handle<CodeT> deopt_code(deopt_function->code(), isolate);
int num_entries = kInitialEntries + 1;
int expected_length = kInitialLength * 2;
......
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