[sparkplug] Change Sparkplug to Baseline
Currently we sometimes refer to baseline code or the baseline compiler by its codename (Sparkplug). The codename is fun, but we should be consistent and call things by one name or the other. Following the pattern of Ignition stuff being called "interpreter", we call Sparkplug "baseline", and leave the codename only in flags and variants. Bug: v8:11420 Change-Id: I432e5629518be7c7ad38b6acff024c91d4cfd6d3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2692186 Commit-Queue: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#72696}
This commit is contained in:
parent
9129547bf5
commit
c913ef3a91
@ -364,7 +364,7 @@ Handle<Code> BaselineCompiler::Build(Isolate* isolate) {
|
||||
// Allocate the bytecode offset table.
|
||||
Handle<ByteArray> bytecode_offset_table =
|
||||
bytecode_offset_table_builder_.ToBytecodeOffsetTable(isolate);
|
||||
return Factory::CodeBuilder(isolate, desc, CodeKind::SPARKPLUG)
|
||||
return Factory::CodeBuilder(isolate, desc, CodeKind::BASELINE)
|
||||
.set_bytecode_offset_table(bytecode_offset_table)
|
||||
.Build();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ Handle<Code> CompileWithBaseline(Isolate* isolate,
|
||||
if (FLAG_trace_opt) {
|
||||
PrintF("[compiling method ");
|
||||
shared->ShortPrint();
|
||||
PrintF(" using Sparkplug]\n");
|
||||
PrintF(" using Baseline]\n");
|
||||
}
|
||||
|
||||
base::ElapsedTimer timer;
|
||||
@ -65,7 +65,7 @@ Handle<Code> CompileWithBaseline(Isolate* isolate,
|
||||
Compiler::LogFunctionCompilation(
|
||||
isolate, CodeEventListener::FUNCTION_TAG, shared,
|
||||
handle(Script::cast(shared->script()), isolate),
|
||||
Handle<AbstractCode>::cast(code), CodeKind::SPARKPLUG,
|
||||
Handle<AbstractCode>::cast(code), CodeKind::BASELINE,
|
||||
timer.Elapsed().InMillisecondsF());
|
||||
}
|
||||
|
||||
|
@ -1247,7 +1247,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) {
|
||||
// Horrible hack: This should be the bytecode offset, but we calculate that
|
||||
// from the PC, so we cache the feedback vector in there instead.
|
||||
// TODO(v8:11429): Make this less a horrible hack, and more just a frame
|
||||
// difference, by improving the approach distinguishing ignition and sparkplug
|
||||
// difference, by improving the approach distinguishing ignition and baseline
|
||||
// frames.
|
||||
if (__ emit_debug_code()) {
|
||||
__ CompareObjectType(feedback_vector, x4, x4, FEEDBACK_VECTOR_TYPE);
|
||||
|
@ -155,7 +155,7 @@ void LazyBuiltinsAssembler::CompileLazy(TNode<JSFunction> function) {
|
||||
LoadObjectField<Uint32T>(sfi_code, Code::kFlagsOffset);
|
||||
TNode<Uint32T> code_kind = DecodeWord32<Code::KindField>(code_flags);
|
||||
TNode<BoolT> is_baseline =
|
||||
IsEqualInWord32<Code::KindField>(code_kind, CodeKind::SPARKPLUG);
|
||||
IsEqualInWord32<Code::KindField>(code_kind, CodeKind::BASELINE);
|
||||
GotoIf(is_baseline, &baseline);
|
||||
|
||||
// Finally, check for presence of an NCI cached Code object - if an entry
|
||||
|
@ -208,7 +208,7 @@ void Compiler::LogFunctionCompilation(Isolate* isolate,
|
||||
case CodeKind::INTERPRETED_FUNCTION:
|
||||
name = "interpreter";
|
||||
break;
|
||||
case CodeKind::SPARKPLUG:
|
||||
case CodeKind::BASELINE:
|
||||
name = "baseline";
|
||||
break;
|
||||
case CodeKind::TURBOPROP:
|
||||
@ -1861,7 +1861,7 @@ bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag,
|
||||
// immediately after a flush would be better.
|
||||
JSFunction::InitializeFeedbackCell(function, is_compiled_scope, true);
|
||||
|
||||
// If --always-sparkplug is enabled, make sure we have sparkplug code.
|
||||
// If --always-sparkplug is enabled, make sure we have baseline code.
|
||||
// TODO(v8:11429): Extract out the rest of the if into a "can baseline
|
||||
// compile" predicate, or similar.
|
||||
if (FLAG_always_sparkplug && !function->shared().HasAsmWasmData() &&
|
||||
@ -1886,7 +1886,7 @@ bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag,
|
||||
function->set_code(*code);
|
||||
|
||||
// Install a feedback vector if necessary.
|
||||
if (code->kind() == CodeKind::SPARKPLUG) {
|
||||
if (code->kind() == CodeKind::BASELINE) {
|
||||
JSFunction::EnsureFeedbackVector(function, is_compiled_scope);
|
||||
}
|
||||
|
||||
|
@ -3167,7 +3167,7 @@ void TurboAssembler::EnterFrame(StackFrame::Type type) {
|
||||
}
|
||||
|
||||
void TurboAssembler::LeaveFrame(StackFrame::Type type) {
|
||||
// TODO(v8:11429): Consider passing SPARKPLUG instead, and checking for
|
||||
// TODO(v8:11429): Consider passing BASELINE instead, and checking for
|
||||
// IsJSFrame or similar. Could then unify with manual frame leaves in the
|
||||
// interpreter too.
|
||||
if (emit_debug_code() && type != StackFrame::MANUAL) {
|
||||
|
@ -1073,7 +1073,7 @@ void Debug::PrepareStep(StepAction step_action) {
|
||||
if (!EnsureBreakInfo(shared)) return;
|
||||
PrepareFunctionForDebugExecution(shared);
|
||||
|
||||
// PrepareFunctionForDebugExecution can invalidate Sparkplug frames
|
||||
// PrepareFunctionForDebugExecution can invalidate Baseline frames
|
||||
js_frame = JavaScriptFrame::cast(frames_it.Reframe());
|
||||
|
||||
Handle<DebugInfo> debug_info(shared->GetDebugInfo(), isolate_);
|
||||
@ -1246,8 +1246,8 @@ void Debug::DeoptimizeFunction(Handle<SharedFunctionInfo> shared) {
|
||||
// inlining.
|
||||
isolate_->AbortConcurrentOptimization(BlockingBehavior::kBlock);
|
||||
|
||||
if (shared->GetCode().kind() == CodeKind::SPARKPLUG) {
|
||||
Deoptimizer::DeoptimizeSparkplug(*shared);
|
||||
if (shared->GetCode().kind() == CodeKind::BASELINE) {
|
||||
Deoptimizer::DeoptimizeBaseline(*shared);
|
||||
}
|
||||
|
||||
bool found_something = false;
|
||||
|
@ -96,7 +96,7 @@ std::vector<wasm_addr_t> WasmModuleDebug::GetCallStack(
|
||||
case StackFrame::JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH:
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::SPARKPLUG:
|
||||
case StackFrame::BASELINE:
|
||||
case StackFrame::BUILTIN:
|
||||
case StackFrame::WASM: {
|
||||
// A standard frame may include many summarized frames, due to inlining.
|
||||
@ -155,7 +155,7 @@ std::vector<FrameSummary> WasmModuleDebug::FindWasmFrame(
|
||||
case StackFrame::JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH:
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::SPARKPLUG:
|
||||
case StackFrame::BASELINE:
|
||||
case StackFrame::BUILTIN:
|
||||
case StackFrame::WASM: {
|
||||
// A standard frame may include many summarized frames, due to inlining.
|
||||
|
@ -382,7 +382,7 @@ void Deoptimizer::DeoptimizeAll(Isolate* isolate) {
|
||||
TraceDeoptAll(isolate);
|
||||
isolate->AbortConcurrentOptimization(BlockingBehavior::kBlock);
|
||||
DisallowGarbageCollection no_gc;
|
||||
DeoptimizeAllSparkplug(isolate);
|
||||
DeoptimizeAllBaseline(isolate);
|
||||
// For all contexts, mark all code, then deoptimize.
|
||||
Object context = isolate->heap()->native_contexts_list();
|
||||
while (!context.IsUndefined(isolate)) {
|
||||
@ -422,17 +422,17 @@ void Deoptimizer::MarkAllCodeForContext(NativeContext native_context) {
|
||||
}
|
||||
|
||||
namespace {
|
||||
class DeoptimizeSparkplugVisitor : public ThreadVisitor {
|
||||
class DeoptimizeBaselineVisitor : public ThreadVisitor {
|
||||
public:
|
||||
explicit DeoptimizeSparkplugVisitor(SharedFunctionInfo shared)
|
||||
explicit DeoptimizeBaselineVisitor(SharedFunctionInfo shared)
|
||||
: shared_(shared) {}
|
||||
DeoptimizeSparkplugVisitor() : shared_(SharedFunctionInfo()) {}
|
||||
DeoptimizeBaselineVisitor() : shared_(SharedFunctionInfo()) {}
|
||||
|
||||
void VisitThread(Isolate* isolate, ThreadLocalTop* top) override {
|
||||
bool deopt_all = shared_ == SharedFunctionInfo();
|
||||
for (JavaScriptFrameIterator it(isolate, top); !it.done(); it.Advance()) {
|
||||
if (it.frame()->type() == StackFrame::SPARKPLUG) {
|
||||
SparkplugFrame* frame = SparkplugFrame::cast(it.frame());
|
||||
if (it.frame()->type() == StackFrame::BASELINE) {
|
||||
BaselineFrame* frame = BaselineFrame::cast(it.frame());
|
||||
if (!deopt_all && frame->function().shared() != shared_) continue;
|
||||
frame->InterpretedFrame::PatchBytecodeOffset(
|
||||
frame->GetBytecodeOffset());
|
||||
@ -450,10 +450,10 @@ class DeoptimizeSparkplugVisitor : public ThreadVisitor {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
void Deoptimizer::DeoptimizeSparkplug(SharedFunctionInfo shared) {
|
||||
DCHECK_EQ(shared.GetCode().kind(), CodeKind::SPARKPLUG);
|
||||
void Deoptimizer::DeoptimizeBaseline(SharedFunctionInfo shared) {
|
||||
DCHECK_EQ(shared.GetCode().kind(), CodeKind::BASELINE);
|
||||
Isolate* isolate = shared.GetIsolate();
|
||||
DeoptimizeSparkplugVisitor visitor(shared);
|
||||
DeoptimizeBaselineVisitor visitor(shared);
|
||||
visitor.VisitThread(isolate, isolate->thread_local_top());
|
||||
isolate->thread_manager()->IterateArchivedThreads(&visitor);
|
||||
// TODO(v8:11429): Avoid this heap walk somehow.
|
||||
@ -464,15 +464,15 @@ void Deoptimizer::DeoptimizeSparkplug(SharedFunctionInfo shared) {
|
||||
obj = iterator.Next()) {
|
||||
if (obj.IsJSFunction()) {
|
||||
JSFunction fun = JSFunction::cast(obj);
|
||||
if (fun.shared() == shared && fun.code().kind() == CodeKind::SPARKPLUG) {
|
||||
if (fun.shared() == shared && fun.code().kind() == CodeKind::BASELINE) {
|
||||
fun.set_code(*trampoline);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Deoptimizer::DeoptimizeAllSparkplug(Isolate* isolate) {
|
||||
DeoptimizeSparkplugVisitor visitor;
|
||||
void Deoptimizer::DeoptimizeAllBaseline(Isolate* isolate) {
|
||||
DeoptimizeBaselineVisitor visitor;
|
||||
visitor.VisitThread(isolate, isolate->thread_local_top());
|
||||
HeapObjectIterator iterator(isolate->heap());
|
||||
auto trampoline = BUILTIN_CODE(isolate, InterpreterEntryTrampoline);
|
||||
|
@ -66,11 +66,11 @@ class Deoptimizer : public Malloced {
|
||||
// instead of the function code (e.g. OSR code not installed on function).
|
||||
static void DeoptimizeFunction(JSFunction function, Code code = Code());
|
||||
|
||||
// From Sparkplug to Ignition.
|
||||
// From Baseline to Ignition.
|
||||
// TODO(v8:11429): Consider moving this to the debugger, since it's only for
|
||||
// debug.
|
||||
static void DeoptimizeSparkplug(SharedFunctionInfo shared);
|
||||
static void DeoptimizeAllSparkplug(Isolate* isolate);
|
||||
static void DeoptimizeBaseline(SharedFunctionInfo shared);
|
||||
static void DeoptimizeAllBaseline(Isolate* isolate);
|
||||
|
||||
// Deoptimize all code in the given isolate.
|
||||
V8_EXPORT_PRIVATE static void DeoptimizeAll(Isolate* isolate);
|
||||
|
@ -817,7 +817,7 @@ void JSFunction::JSFunctionVerify(Isolate* isolate) {
|
||||
TorqueGeneratedClassVerifiers::JSFunctionVerify(*this, isolate);
|
||||
CHECK(code().IsCode());
|
||||
CHECK(map().is_callable());
|
||||
CHECK_IMPLIES(code().kind() == CodeKind::SPARKPLUG, has_feedback_vector());
|
||||
CHECK_IMPLIES(code().kind() == CodeKind::BASELINE, has_feedback_vector());
|
||||
Handle<JSFunction> function(*this, isolate);
|
||||
LookupIterator it(isolate, function, isolate->factory()->prototype_string(),
|
||||
LookupIterator::OWN_SKIP_INTERCEPTOR);
|
||||
|
@ -214,7 +214,7 @@ void PerfJitLogger::LogRecordedBuffer(
|
||||
abstract_code->kind() != CodeKind::TURBOFAN &&
|
||||
abstract_code->kind() != CodeKind::NATIVE_CONTEXT_INDEPENDENT &&
|
||||
abstract_code->kind() != CodeKind::TURBOPROP &&
|
||||
abstract_code->kind() != CodeKind::SPARKPLUG)) {
|
||||
abstract_code->kind() != CodeKind::BASELINE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -339,10 +339,10 @@ SourcePositionInfo GetSourcePositionInfo(Handle<Code> code,
|
||||
void PerfJitLogger::LogWriteDebugInfo(Handle<Code> code,
|
||||
Handle<SharedFunctionInfo> shared) {
|
||||
DisallowGarbageCollection no_gc;
|
||||
// TODO(v8:11429,cbruni): add proper sparkplug source position iterator
|
||||
bool is_sparkplug = code->kind() == CodeKind::SPARKPLUG;
|
||||
// TODO(v8:11429,cbruni): add proper baseline source position iterator
|
||||
bool is_baseline = code->kind() == CodeKind::BASELINE;
|
||||
ByteArray source_position_table = code->SourcePositionTable();
|
||||
if (is_sparkplug) {
|
||||
if (is_baseline) {
|
||||
source_position_table =
|
||||
shared->GetBytecodeArray(shared->GetIsolate()).SourcePositionTable();
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ inline OptimizedFrame::OptimizedFrame(StackFrameIteratorBase* iterator)
|
||||
inline InterpretedFrame::InterpretedFrame(StackFrameIteratorBase* iterator)
|
||||
: JavaScriptFrame(iterator) {}
|
||||
|
||||
inline SparkplugFrame::SparkplugFrame(StackFrameIteratorBase* iterator)
|
||||
inline BaselineFrame::BaselineFrame(StackFrameIteratorBase* iterator)
|
||||
: InterpretedFrame(iterator) {}
|
||||
|
||||
inline BuiltinFrame::BuiltinFrame(StackFrameIteratorBase* iterator)
|
||||
|
@ -592,7 +592,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
}
|
||||
if (code_obj.is_baseline_prologue_builtin() ||
|
||||
code_obj.is_baseline_leave_frame_builtin()) {
|
||||
return SPARKPLUG;
|
||||
return BASELINE;
|
||||
}
|
||||
if (code_obj.is_turbofanned()) {
|
||||
// TODO(bmeurer): We treat frames for BUILTIN Code objects as
|
||||
@ -606,8 +606,8 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
case CodeKind::NATIVE_CONTEXT_INDEPENDENT:
|
||||
case CodeKind::TURBOPROP:
|
||||
return OPTIMIZED;
|
||||
case CodeKind::SPARKPLUG:
|
||||
return Type::SPARKPLUG;
|
||||
case CodeKind::BASELINE:
|
||||
return Type::BASELINE;
|
||||
case CodeKind::JS_TO_WASM_FUNCTION:
|
||||
return JS_TO_WASM;
|
||||
case CodeKind::JS_TO_JS_FUNCTION:
|
||||
@ -993,7 +993,7 @@ void CommonFrame::IterateCompiledFrame(RootVisitor* v) const {
|
||||
break;
|
||||
case OPTIMIZED:
|
||||
case INTERPRETED:
|
||||
case SPARKPLUG:
|
||||
case BASELINE:
|
||||
case BUILTIN:
|
||||
// These frame types have a context, but they are actually stored
|
||||
// in the place on the stack that one finds the frame type.
|
||||
@ -1190,7 +1190,7 @@ int CommonFrameWithJSLinkage::LookupExceptionHandlerInTable(
|
||||
int* stack_depth, HandlerTable::CatchPrediction* prediction) {
|
||||
DCHECK(!LookupCode().has_handler_table());
|
||||
DCHECK(!LookupCode().is_optimized_code() ||
|
||||
LookupCode().kind() == CodeKind::SPARKPLUG);
|
||||
LookupCode().kind() == CodeKind::BASELINE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1363,7 +1363,7 @@ FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
|
||||
is_constructor_(is_constructor),
|
||||
parameters_(parameters, isolate) {
|
||||
DCHECK(abstract_code.IsBytecodeArray() ||
|
||||
Code::cast(abstract_code).kind() == CodeKind::SPARKPLUG ||
|
||||
Code::cast(abstract_code).kind() == CodeKind::BASELINE ||
|
||||
!CodeKindIsOptimizedJSFunction(Code::cast(abstract_code).kind()));
|
||||
}
|
||||
|
||||
@ -1750,12 +1750,12 @@ void InterpretedFrame::PatchBytecodeOffset(int new_offset) {
|
||||
SetExpression(index, Smi::FromInt(raw_offset));
|
||||
}
|
||||
|
||||
int SparkplugFrame::GetBytecodeOffset() const {
|
||||
return LookupCode().GetBytecodeOffsetForSparkplugPC(this->pc());
|
||||
int BaselineFrame::GetBytecodeOffset() const {
|
||||
return LookupCode().GetBytecodeOffsetForBaselinePC(this->pc());
|
||||
}
|
||||
|
||||
intptr_t SparkplugFrame::GetPCForBytecodeOffset(int bytecode_offset) const {
|
||||
return LookupCode().GetSparkplugPCForBytecodeOffset(bytecode_offset);
|
||||
intptr_t BaselineFrame::GetPCForBytecodeOffset(int bytecode_offset) const {
|
||||
return LookupCode().GetBaselinePCForBytecodeOffset(bytecode_offset);
|
||||
}
|
||||
|
||||
BytecodeArray InterpretedFrame::GetBytecodeArray() const {
|
||||
|
@ -19,7 +19,7 @@
|
||||
// - JavaScriptFrame (aka StandardFrame)
|
||||
// - InterpretedFrame
|
||||
// - OptimizedFrame
|
||||
// - SparkplugFrame
|
||||
// - BaselineFrame
|
||||
// - TypedFrameWithJSLinkage
|
||||
// - BuiltinFrame
|
||||
// - JavaScriptBuiltinContinuationFrame
|
||||
@ -103,7 +103,7 @@ class StackHandler {
|
||||
V(WASM_EXIT, WasmExitFrame) \
|
||||
V(WASM_COMPILE_LAZY, WasmCompileLazyFrame) \
|
||||
V(INTERPRETED, InterpretedFrame) \
|
||||
V(SPARKPLUG, SparkplugFrame) \
|
||||
V(BASELINE, BaselineFrame) \
|
||||
V(OPTIMIZED, OptimizedFrame) \
|
||||
V(STUB, StubFrame) \
|
||||
V(BUILTIN_CONTINUATION, BuiltinContinuationFrame) \
|
||||
@ -130,8 +130,8 @@ class StackFrame {
|
||||
#undef DECLARE_TYPE
|
||||
|
||||
bool IsUnoptimizedJavaScriptFrame() const {
|
||||
STATIC_ASSERT(SPARKPLUG == INTERPRETED + 1);
|
||||
return base::IsInRange(type(), INTERPRETED, SPARKPLUG);
|
||||
STATIC_ASSERT(BASELINE == INTERPRETED + 1);
|
||||
return base::IsInRange(type(), INTERPRETED, BASELINE);
|
||||
}
|
||||
|
||||
// Used to mark the outermost JS entry frame.
|
||||
@ -215,11 +215,11 @@ class StackFrame {
|
||||
bool is_exit() const { return type() == EXIT; }
|
||||
bool is_optimized() const { return type() == OPTIMIZED; }
|
||||
// TODO(v8:11429): Clean up these predicates, distinguishing interpreted from
|
||||
// sparkplug frames, and adding a new predicate that covers both.
|
||||
// baseline frames, and adding a new predicate that covers both.
|
||||
bool is_interpreted() const {
|
||||
return type() == INTERPRETED || type() == SPARKPLUG;
|
||||
return type() == INTERPRETED || type() == BASELINE;
|
||||
}
|
||||
bool is_sparkplug() const { return type() == SPARKPLUG; }
|
||||
bool is_baseline() const { return type() == BASELINE; }
|
||||
bool is_wasm() const { return this->type() == WASM; }
|
||||
bool is_wasm_compile_lazy() const { return type() == WASM_COMPILE_LAZY; }
|
||||
bool is_wasm_debug_break() const { return type() == WASM_DEBUG_BREAK; }
|
||||
@ -238,8 +238,8 @@ class StackFrame {
|
||||
bool is_builtin_exit() const { return type() == BUILTIN_EXIT; }
|
||||
|
||||
bool is_java_script() const {
|
||||
STATIC_ASSERT(INTERPRETED + 1 == SPARKPLUG);
|
||||
STATIC_ASSERT(SPARKPLUG + 1 == OPTIMIZED);
|
||||
STATIC_ASSERT(INTERPRETED + 1 == BASELINE);
|
||||
STATIC_ASSERT(BASELINE + 1 == OPTIMIZED);
|
||||
Type t = type();
|
||||
return t >= INTERPRETED && t <= OPTIMIZED;
|
||||
}
|
||||
@ -880,22 +880,22 @@ class InterpretedFrame : public JavaScriptFrame {
|
||||
friend class StackFrameIteratorBase;
|
||||
};
|
||||
|
||||
class SparkplugFrame : public InterpretedFrame {
|
||||
class BaselineFrame : public InterpretedFrame {
|
||||
public:
|
||||
Type type() const override { return SPARKPLUG; }
|
||||
Type type() const override { return BASELINE; }
|
||||
|
||||
// Returns the current offset into the bytecode stream.
|
||||
int GetBytecodeOffset() const override;
|
||||
|
||||
intptr_t GetPCForBytecodeOffset(int lookup_offset) const;
|
||||
|
||||
static SparkplugFrame* cast(StackFrame* frame) {
|
||||
DCHECK(frame->is_sparkplug());
|
||||
return static_cast<SparkplugFrame*>(frame);
|
||||
static BaselineFrame* cast(StackFrame* frame) {
|
||||
DCHECK(frame->is_baseline());
|
||||
return static_cast<BaselineFrame*>(frame);
|
||||
}
|
||||
|
||||
protected:
|
||||
inline explicit SparkplugFrame(StackFrameIteratorBase* iterator);
|
||||
inline explicit BaselineFrame(StackFrameIteratorBase* iterator);
|
||||
|
||||
private:
|
||||
friend class StackFrameIteratorBase;
|
||||
|
@ -1013,7 +1013,7 @@ Handle<FixedArray> CaptureStackTrace(Isolate* isolate, Handle<Object> caller,
|
||||
case StackFrame::JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH:
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::SPARKPLUG:
|
||||
case StackFrame::BASELINE:
|
||||
case StackFrame::BUILTIN:
|
||||
case StackFrame::WASM: {
|
||||
// A standard frame may include many summarized frames (due to
|
||||
@ -1824,7 +1824,7 @@ Object Isolate::UnwindAndFindHandler() {
|
||||
}
|
||||
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::SPARKPLUG: {
|
||||
case StackFrame::BASELINE: {
|
||||
// For interpreted frame we perform a range lookup in the handler table.
|
||||
if (!catchable_by_js) break;
|
||||
InterpretedFrame* js_frame = static_cast<InterpretedFrame*>(frame);
|
||||
@ -1851,10 +1851,10 @@ Object Isolate::UnwindAndFindHandler() {
|
||||
Context::cast(js_frame->ReadInterpreterRegister(context_reg));
|
||||
DCHECK(context.IsContext());
|
||||
|
||||
if (frame->type() == StackFrame::SPARKPLUG) {
|
||||
if (frame->type() == StackFrame::BASELINE) {
|
||||
Code code = frame->LookupCode();
|
||||
intptr_t pc_offset =
|
||||
static_cast<SparkplugFrame*>(frame)->GetPCForBytecodeOffset(
|
||||
static_cast<BaselineFrame*>(frame)->GetPCForBytecodeOffset(
|
||||
offset);
|
||||
// Write the context directly into the context register, so that we
|
||||
// don't need to have a context read + write in the baseline code.
|
||||
@ -1992,7 +1992,7 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
|
||||
// For JavaScript frames we perform a lookup in the handler table.
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::SPARKPLUG:
|
||||
case StackFrame::BASELINE:
|
||||
case StackFrame::BUILTIN: {
|
||||
JavaScriptFrame* js_frame = JavaScriptFrame::cast(frame);
|
||||
Isolate::CatchType prediction = ToCatchType(PredictException(js_frame));
|
||||
|
@ -3388,7 +3388,7 @@ Handle<JSFunction> Factory::JSFunctionBuilder::Build() {
|
||||
|
||||
Handle<JSFunction> result = BuildRaw(code);
|
||||
|
||||
if (have_cached_code || code->kind() == CodeKind::SPARKPLUG) {
|
||||
if (have_cached_code || code->kind() == CodeKind::BASELINE) {
|
||||
IsCompiledScope is_compiled_scope(sfi_->is_compiled_scope(isolate_));
|
||||
JSFunction::EnsureFeedbackVector(result, &is_compiled_scope);
|
||||
if (FLAG_trace_turbo_nci && have_cached_code) {
|
||||
|
@ -835,7 +835,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> {
|
||||
CodeBuilder& set_bytecode_offset_table(Handle<ByteArray> table) {
|
||||
DCHECK(!table.is_null());
|
||||
// TODO(v8:11429): Rename this and clean up calls to SourcePositionTable
|
||||
// under Sparkplug.
|
||||
// under Baseline.
|
||||
source_position_table_ = table;
|
||||
return *this;
|
||||
}
|
||||
@ -887,7 +887,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> {
|
||||
int32_t builtin_index_ = Builtins::kNoBuiltinId;
|
||||
uint32_t inlined_bytecode_size_ = 0;
|
||||
int32_t kind_specific_flags_ = 0;
|
||||
// Contains bytecode offset table for sparkplug
|
||||
// Contains bytecode offset table for baseline
|
||||
Handle<ByteArray> source_position_table_;
|
||||
Handle<DeoptimizationData> deoptimization_data_ =
|
||||
DeoptimizationData::Empty(isolate_);
|
||||
|
@ -1221,10 +1221,10 @@ void Logger::LogSourceCodeInformation(Handle<AbstractCode> code,
|
||||
<< reinterpret_cast<void*>(code->InstructionStart()) << Logger::kNext
|
||||
<< script.id() << Logger::kNext << shared->StartPosition()
|
||||
<< Logger::kNext << shared->EndPosition() << Logger::kNext;
|
||||
// TODO(v8:11429): Clean-up sparkplug-replated code in source position
|
||||
// TODO(v8:11429): Clean-up baseline-replated code in source position
|
||||
// iteration.
|
||||
bool hasInlined = false;
|
||||
if (code->kind() != CodeKind::SPARKPLUG) {
|
||||
if (code->kind() != CodeKind::BASELINE) {
|
||||
SourcePositionTableIterator iterator(code->source_position_table());
|
||||
for (; !iterator.done(); iterator.Advance()) {
|
||||
SourcePosition pos = iterator.source_position();
|
||||
@ -2105,7 +2105,7 @@ void ExistingCodeLogger::LogCodeObject(Object object) {
|
||||
switch (abstract_code->kind()) {
|
||||
case CodeKind::INTERPRETED_FUNCTION:
|
||||
case CodeKind::TURBOFAN:
|
||||
case CodeKind::SPARKPLUG:
|
||||
case CodeKind::BASELINE:
|
||||
case CodeKind::NATIVE_CONTEXT_INDEPENDENT:
|
||||
case CodeKind::TURBOPROP:
|
||||
return; // We log this later using LogCompiledFunctions.
|
||||
|
@ -347,14 +347,14 @@ inline int ReadUint(ByteArray array, int* index) {
|
||||
|
||||
} // namespace detail
|
||||
|
||||
int Code::GetBytecodeOffsetForSparkplugPC(Address sparkplug_pc) {
|
||||
int Code::GetBytecodeOffsetForBaselinePC(Address baseline_pc) {
|
||||
DisallowGarbageCollection no_gc;
|
||||
if (is_baseline_prologue_builtin()) return kFunctionEntryBytecodeOffset;
|
||||
if (is_baseline_leave_frame_builtin()) return kFunctionExitBytecodeOffset;
|
||||
CHECK_EQ(kind(), CodeKind::SPARKPLUG);
|
||||
CHECK_EQ(kind(), CodeKind::BASELINE);
|
||||
ByteArray data = ByteArray::cast(source_position_table());
|
||||
Address lookup_pc = 0;
|
||||
Address pc = sparkplug_pc - InstructionStart();
|
||||
Address pc = baseline_pc - InstructionStart();
|
||||
int index = 0;
|
||||
int offset = 0;
|
||||
while (pc > lookup_pc) {
|
||||
@ -365,10 +365,10 @@ int Code::GetBytecodeOffsetForSparkplugPC(Address sparkplug_pc) {
|
||||
return offset;
|
||||
}
|
||||
|
||||
uintptr_t Code::GetSparkplugPCForBytecodeOffset(int bytecode_offset,
|
||||
uintptr_t Code::GetBaselinePCForBytecodeOffset(int bytecode_offset,
|
||||
bool precise) {
|
||||
DisallowGarbageCollection no_gc;
|
||||
CHECK_EQ(kind(), CodeKind::SPARKPLUG);
|
||||
CHECK_EQ(kind(), CodeKind::BASELINE);
|
||||
ByteArray data = ByteArray::cast(source_position_table());
|
||||
intptr_t pc = 0;
|
||||
int index = 0;
|
||||
@ -527,14 +527,14 @@ int Code::stack_slots() const {
|
||||
}
|
||||
|
||||
bool Code::marked_for_deoptimization() const {
|
||||
// TODO(v8:11429): Re-evaluate if sparkplug code can really deopt.
|
||||
DCHECK(CodeKindCanDeoptimize(kind()) || kind() == CodeKind::SPARKPLUG);
|
||||
// TODO(v8:11429): Re-evaluate if baseline code can really deopt.
|
||||
DCHECK(CodeKindCanDeoptimize(kind()) || kind() == CodeKind::BASELINE);
|
||||
int32_t flags = code_data_container(kAcquireLoad).kind_specific_flags();
|
||||
return MarkedForDeoptimizationField::decode(flags);
|
||||
}
|
||||
|
||||
void Code::set_marked_for_deoptimization(bool flag) {
|
||||
DCHECK(CodeKindCanDeoptimize(kind()) || kind() == CodeKind::SPARKPLUG);
|
||||
DCHECK(CodeKindCanDeoptimize(kind()) || kind() == CodeKind::BASELINE);
|
||||
DCHECK_IMPLIES(flag, AllowDeoptimization::IsAllowed(GetIsolate()));
|
||||
CodeDataContainer container = code_data_container(kAcquireLoad);
|
||||
int32_t previous = container.kind_specific_flags();
|
||||
|
@ -22,7 +22,7 @@ const char* CodeKindToMarker(CodeKind kind) {
|
||||
switch (kind) {
|
||||
case CodeKind::INTERPRETED_FUNCTION:
|
||||
return "~";
|
||||
case CodeKind::SPARKPLUG:
|
||||
case CodeKind::BASELINE:
|
||||
return "^";
|
||||
case CodeKind::NATIVE_CONTEXT_INDEPENDENT:
|
||||
return "-";
|
||||
|
@ -27,7 +27,7 @@ namespace internal {
|
||||
V(C_WASM_ENTRY) \
|
||||
V(INTERPRETED_FUNCTION) \
|
||||
V(NATIVE_CONTEXT_INDEPENDENT) \
|
||||
V(SPARKPLUG) \
|
||||
V(BASELINE) \
|
||||
V(TURBOPROP) \
|
||||
V(TURBOFAN)
|
||||
|
||||
@ -87,7 +87,7 @@ inline constexpr bool CodeKindCanOSR(CodeKind kind) {
|
||||
|
||||
inline constexpr bool CodeKindIsOptimizedAndCanTierUp(CodeKind kind) {
|
||||
return kind == CodeKind::NATIVE_CONTEXT_INDEPENDENT ||
|
||||
kind == CodeKind::SPARKPLUG ||
|
||||
kind == CodeKind::BASELINE ||
|
||||
(!FLAG_turboprop_as_toptier && kind == CodeKind::TURBOPROP);
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ DEFINE_OPERATORS_FOR_FLAGS(CodeKinds)
|
||||
static constexpr CodeKinds kJSFunctionCodeKindsMask{
|
||||
CodeKindFlag::INTERPRETED_FUNCTION | CodeKindFlag::TURBOFAN |
|
||||
CodeKindFlag::NATIVE_CONTEXT_INDEPENDENT | CodeKindFlag::TURBOPROP |
|
||||
CodeKindFlag::SPARKPLUG};
|
||||
CodeKindFlag::BASELINE};
|
||||
static constexpr CodeKinds kOptimizedJSFunctionCodeKindsMask{
|
||||
CodeKindFlag::TURBOFAN | CodeKindFlag::NATIVE_CONTEXT_INDEPENDENT |
|
||||
CodeKindFlag::TURBOPROP};
|
||||
|
@ -497,13 +497,13 @@ void Code::Disassemble(const char* name, std::ostream& os, Isolate* isolate,
|
||||
if ((name != nullptr) && (name[0] != '\0')) {
|
||||
os << "name = " << name << "\n";
|
||||
}
|
||||
if (CodeKindIsOptimizedJSFunction(kind()) && kind() != CodeKind::SPARKPLUG) {
|
||||
if (CodeKindIsOptimizedJSFunction(kind()) && kind() != CodeKind::BASELINE) {
|
||||
os << "stack_slots = " << stack_slots() << "\n";
|
||||
}
|
||||
os << "compiler = "
|
||||
<< (is_turbofanned()
|
||||
? "turbofan"
|
||||
: kind() == CodeKind::SPARKPLUG ? "baseline" : "unknown")
|
||||
: kind() == CodeKind::BASELINE ? "baseline" : "unknown")
|
||||
<< "\n";
|
||||
os << "address = " << reinterpret_cast<void*>(ptr()) << "\n\n";
|
||||
|
||||
@ -535,7 +535,7 @@ void Code::Disassemble(const char* name, std::ostream& os, Isolate* isolate,
|
||||
}
|
||||
os << "\n";
|
||||
|
||||
if (kind() != CodeKind::SPARKPLUG) {
|
||||
if (kind() != CodeKind::BASELINE) {
|
||||
{
|
||||
SourcePositionTableIterator it(
|
||||
SourcePositionTable(), SourcePositionTableIterator::kJavaScriptOnly);
|
||||
|
@ -379,9 +379,9 @@ class Code : public HeapObject {
|
||||
static inline void CopyRelocInfoToByteArray(ByteArray dest,
|
||||
const CodeDesc& desc);
|
||||
|
||||
inline uintptr_t GetSparkplugPCForBytecodeOffset(int bytecode_offset,
|
||||
inline uintptr_t GetBaselinePCForBytecodeOffset(int bytecode_offset,
|
||||
bool precise = true);
|
||||
inline int GetBytecodeOffsetForSparkplugPC(Address sparkplug_pc);
|
||||
inline int GetBytecodeOffsetForBaselinePC(Address baseline_pc);
|
||||
|
||||
// Flushes the instruction cache for the executable instructions of this code
|
||||
// object. Make sure to call this while the code is still writable.
|
||||
|
@ -74,7 +74,7 @@ void JSFunction::MarkForOptimization(ConcurrencyMode mode) {
|
||||
}
|
||||
|
||||
DCHECK(!is_compiled() || ActiveTierIsIgnition() || ActiveTierIsNCI() ||
|
||||
ActiveTierIsMidtierTurboprop() || ActiveTierIsSparkplug());
|
||||
ActiveTierIsMidtierTurboprop() || ActiveTierIsBaseline());
|
||||
DCHECK(!ActiveTierIsTurbofan());
|
||||
DCHECK(shared().IsInterpreted());
|
||||
DCHECK(shared().allows_lazy_compilation() ||
|
||||
|
@ -52,10 +52,10 @@ CodeKinds JSFunction::GetAvailableCodeKinds() const {
|
||||
}
|
||||
}
|
||||
|
||||
if ((result & CodeKindFlag::SPARKPLUG) == 0) {
|
||||
if ((result & CodeKindFlag::BASELINE) == 0) {
|
||||
// The SharedFunctionInfo could have attached baseline code.
|
||||
if (shared().HasBaselineData()) {
|
||||
result |= CodeKindFlag::SPARKPLUG;
|
||||
result |= CodeKindFlag::BASELINE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,8 +98,8 @@ bool HighestTierOf(CodeKinds kinds, CodeKind* highest_tier) {
|
||||
} else if ((kinds & CodeKindFlag::TURBOPROP) != 0) {
|
||||
*highest_tier = CodeKind::TURBOPROP;
|
||||
return true;
|
||||
} else if ((kinds & CodeKindFlag::SPARKPLUG) != 0) {
|
||||
*highest_tier = CodeKind::SPARKPLUG;
|
||||
} else if ((kinds & CodeKindFlag::BASELINE) != 0) {
|
||||
*highest_tier = CodeKind::BASELINE;
|
||||
return true;
|
||||
} else if ((kinds & CodeKindFlag::NATIVE_CONTEXT_INDEPENDENT) != 0) {
|
||||
*highest_tier = CodeKind::NATIVE_CONTEXT_INDEPENDENT;
|
||||
@ -131,7 +131,7 @@ CodeKind JSFunction::GetActiveTier() const {
|
||||
DCHECK(shared().is_compiled());
|
||||
HighestTierOf(GetAvailableCodeKinds(), &highest_tier);
|
||||
DCHECK(highest_tier == CodeKind::TURBOFAN ||
|
||||
highest_tier == CodeKind::SPARKPLUG ||
|
||||
highest_tier == CodeKind::BASELINE ||
|
||||
highest_tier == CodeKind::TURBOPROP ||
|
||||
highest_tier == CodeKind::NATIVE_CONTEXT_INDEPENDENT ||
|
||||
highest_tier == CodeKind::INTERPRETED_FUNCTION);
|
||||
@ -148,14 +148,14 @@ bool JSFunction::ActiveTierIsNCI() const {
|
||||
return GetActiveTier() == CodeKind::NATIVE_CONTEXT_INDEPENDENT;
|
||||
}
|
||||
|
||||
bool JSFunction::ActiveTierIsSparkplug() const {
|
||||
bool JSFunction::ActiveTierIsBaseline() const {
|
||||
CodeKind highest_tier;
|
||||
if (!HighestTierOf(GetAvailableCodeKinds(), &highest_tier)) return false;
|
||||
return highest_tier == CodeKind::SPARKPLUG;
|
||||
return highest_tier == CodeKind::BASELINE;
|
||||
}
|
||||
|
||||
bool JSFunction::ActiveTierIsIgnitionOrSparkplug() const {
|
||||
return ActiveTierIsIgnition() || ActiveTierIsSparkplug();
|
||||
bool JSFunction::ActiveTierIsIgnitionOrBaseline() const {
|
||||
return ActiveTierIsIgnition() || ActiveTierIsBaseline();
|
||||
}
|
||||
|
||||
bool JSFunction::ActiveTierIsToptierTurboprop() const {
|
||||
@ -174,7 +174,7 @@ CodeKind JSFunction::NextTier() const {
|
||||
if (V8_UNLIKELY(FLAG_turboprop) && ActiveTierIsMidtierTurboprop()) {
|
||||
return CodeKind::TURBOFAN;
|
||||
} else if (V8_UNLIKELY(FLAG_turboprop)) {
|
||||
DCHECK(ActiveTierIsIgnitionOrSparkplug());
|
||||
DCHECK(ActiveTierIsIgnitionOrBaseline());
|
||||
return CodeKind::TURBOPROP;
|
||||
}
|
||||
return CodeKind::TURBOFAN;
|
||||
|
@ -117,8 +117,8 @@ class JSFunction : public JSFunctionOrBoundFunction {
|
||||
V8_EXPORT_PRIVATE bool ActiveTierIsIgnition() const;
|
||||
bool ActiveTierIsTurbofan() const;
|
||||
bool ActiveTierIsNCI() const;
|
||||
bool ActiveTierIsSparkplug() const;
|
||||
bool ActiveTierIsIgnitionOrSparkplug() const;
|
||||
bool ActiveTierIsBaseline() const;
|
||||
bool ActiveTierIsIgnitionOrBaseline() const;
|
||||
bool ActiveTierIsMidtierTurboprop() const;
|
||||
bool ActiveTierIsToptierTurboprop() const;
|
||||
|
||||
|
@ -116,11 +116,11 @@ void ProfilerListener::CodeCreateEvent(LogEventsAndTags tag,
|
||||
|
||||
is_shared_cross_origin = script->origin_options().IsSharedCrossOrigin();
|
||||
|
||||
// TODO(v8:11429,cbruni): improve iteration for sparkplug code
|
||||
bool is_sparkplug = abstract_code->kind() == CodeKind::SPARKPLUG;
|
||||
// TODO(v8:11429,cbruni): improve iteration for baseline code
|
||||
bool is_baseline = abstract_code->kind() == CodeKind::BASELINE;
|
||||
Handle<ByteArray> source_position_table(
|
||||
abstract_code->source_position_table(), isolate_);
|
||||
if (is_sparkplug) {
|
||||
if (is_baseline) {
|
||||
source_position_table = handle(
|
||||
shared->GetBytecodeArray(isolate_).SourcePositionTable(), isolate_);
|
||||
}
|
||||
@ -134,19 +134,19 @@ void ProfilerListener::CodeCreateEvent(LogEventsAndTags tag,
|
||||
int position = it.source_position().ScriptOffset();
|
||||
int inlining_id = it.source_position().InliningId();
|
||||
int code_offset = it.code_offset();
|
||||
if (is_sparkplug) {
|
||||
// Use the bytecode offset to calculate pc offset for sparkplug code.
|
||||
if (is_baseline) {
|
||||
// Use the bytecode offset to calculate pc offset for baseline code.
|
||||
// TODO(v8:11429,cbruni): Speed this up.
|
||||
code_offset = static_cast<int>(
|
||||
abstract_code->GetCode().GetSparkplugPCForBytecodeOffset(
|
||||
code_offset, false));
|
||||
abstract_code->GetCode().GetBaselinePCForBytecodeOffset(code_offset,
|
||||
false));
|
||||
}
|
||||
|
||||
if (inlining_id == SourcePosition::kNotInlined) {
|
||||
int line_number = script->GetLineNumber(position) + 1;
|
||||
line_table->SetPosition(code_offset, line_number, inlining_id);
|
||||
} else {
|
||||
DCHECK(!is_sparkplug);
|
||||
DCHECK(!is_baseline);
|
||||
DCHECK(abstract_code->IsCode());
|
||||
Handle<Code> code = handle(abstract_code->GetCode(), isolate_);
|
||||
std::vector<SourcePositionInfo> stack =
|
||||
|
@ -310,8 +310,8 @@ BytecodeOffset DetermineEntryAndDisarmOSRForInterpreter(
|
||||
|
||||
DCHECK_IMPLIES(frame->type() == StackFrame::INTERPRETED,
|
||||
frame->LookupCode().is_interpreter_trampoline_builtin());
|
||||
DCHECK_IMPLIES(frame->type() == StackFrame::SPARKPLUG,
|
||||
frame->LookupCode().kind() == CodeKind::SPARKPLUG);
|
||||
DCHECK_IMPLIES(frame->type() == StackFrame::BASELINE,
|
||||
frame->LookupCode().kind() == CodeKind::BASELINE);
|
||||
DCHECK(frame->is_interpreted());
|
||||
DCHECK(frame->function().shared().HasBytecodeArray());
|
||||
|
||||
|
@ -100,7 +100,7 @@ void PrintRegisters(Isolate* isolate, std::ostream& os, bool is_input,
|
||||
} // namespace
|
||||
|
||||
// TODO(v8:11429): Consider either renaming to not just be "Interpreter", or
|
||||
// copying for Sparkplug.
|
||||
// copying for Baseline.
|
||||
RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
||||
if (!FLAG_trace_ignition) {
|
||||
return ReadOnlyRoots(isolate).undefined_value();
|
||||
@ -111,7 +111,7 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
||||
CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, accumulator, 2);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, is_sparkplug, 3);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, is_baseline, 3);
|
||||
|
||||
int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
|
||||
interpreter::BytecodeArrayIterator bytecode_iterator(bytecode_array);
|
||||
@ -123,8 +123,8 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeEntry) {
|
||||
const uint8_t* base_address = reinterpret_cast<const uint8_t*>(
|
||||
bytecode_array->GetFirstBytecodeAddress());
|
||||
const uint8_t* bytecode_address = base_address + offset;
|
||||
if (is_sparkplug->BooleanValue(isolate)) {
|
||||
os << "S-> ";
|
||||
if (is_baseline->BooleanValue(isolate)) {
|
||||
os << "B-> ";
|
||||
} else {
|
||||
os << " -> ";
|
||||
}
|
||||
|
@ -190,10 +190,10 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeFunction) {
|
||||
|
||||
if (function->HasAttachedOptimizedCode()) {
|
||||
Deoptimizer::DeoptimizeFunction(*function);
|
||||
} else if (function->code().kind() == CodeKind::SPARKPLUG) {
|
||||
} else if (function->code().kind() == CodeKind::BASELINE) {
|
||||
// TODO(v8:11429): This should either be in Deoptimizer::DeoptimizeFunction,
|
||||
// or not be considered deoptimization at all.
|
||||
Deoptimizer::DeoptimizeSparkplug(function->shared());
|
||||
Deoptimizer::DeoptimizeBaseline(function->shared());
|
||||
}
|
||||
|
||||
return ReadOnlyRoots(isolate).undefined_value();
|
||||
@ -212,8 +212,8 @@ RUNTIME_FUNCTION(Runtime_DeoptimizeNow) {
|
||||
|
||||
if (function->HasAttachedOptimizedCode()) {
|
||||
Deoptimizer::DeoptimizeFunction(*function);
|
||||
} else if (function->code().kind() == CodeKind::SPARKPLUG) {
|
||||
Deoptimizer::DeoptimizeSparkplug(function->shared());
|
||||
} else if (function->code().kind() == CodeKind::BASELINE) {
|
||||
Deoptimizer::DeoptimizeBaseline(function->shared());
|
||||
}
|
||||
|
||||
return ReadOnlyRoots(isolate).undefined_value();
|
||||
@ -601,9 +601,9 @@ RUNTIME_FUNCTION(Runtime_GetOptimizationStatus) {
|
||||
status |= static_cast<int>(OptimizationStatus::kTurboFanned);
|
||||
}
|
||||
}
|
||||
// TODO(v8:11429): Clean up code kind predicates to include Sparkplug.
|
||||
if (function->code().kind() == CodeKind::SPARKPLUG) {
|
||||
status |= static_cast<int>(OptimizationStatus::kSparkplug);
|
||||
// TODO(v8:11429): Clean up code kind predicates to include Baseline.
|
||||
if (function->code().kind() == CodeKind::BASELINE) {
|
||||
status |= static_cast<int>(OptimizationStatus::kBaseline);
|
||||
}
|
||||
if (function->ActiveTierIsIgnition()) {
|
||||
status |= static_cast<int>(OptimizationStatus::kInterpreted);
|
||||
|
@ -850,7 +850,7 @@ enum class OptimizationStatus {
|
||||
kTopmostFrameIsTurboFanned = 1 << 11,
|
||||
kLiteMode = 1 << 12,
|
||||
kMarkedForDeoptimization = 1 << 13,
|
||||
kSparkplug = 1 << 14,
|
||||
kBaseline = 1 << 14,
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -22,12 +22,12 @@
|
||||
|
||||
%CompileBaseline(f1);
|
||||
assertEquals(0, f1(0));
|
||||
assertTrue(isSparkplug(f1));
|
||||
assertFalse(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f1));
|
||||
assertFalse(isBaseline(f2));
|
||||
|
||||
assertEquals(0, f2(0));
|
||||
assertTrue(isSparkplug(f1));
|
||||
assertTrue(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f1));
|
||||
assertTrue(isBaseline(f2));
|
||||
})();
|
||||
|
||||
// Ensure a feedback vector is created when sharing baseline code and a closure
|
||||
@ -50,14 +50,14 @@
|
||||
assertEquals(0, f2(0));
|
||||
%CompileBaseline(f1);
|
||||
assertEquals(0, f1(0));
|
||||
assertTrue(isSparkplug(f1));
|
||||
assertFalse(isSparkplug(f2));
|
||||
assertFalse(isSparkplug(f3));
|
||||
assertTrue(isBaseline(f1));
|
||||
assertFalse(isBaseline(f2));
|
||||
assertFalse(isBaseline(f3));
|
||||
|
||||
assertEquals(0, f3(0));
|
||||
assertTrue(isSparkplug(f3));
|
||||
assertFalse(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f3));
|
||||
assertFalse(isBaseline(f2));
|
||||
|
||||
assertEquals(0, f2(0));
|
||||
assertTrue(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f2));
|
||||
})();
|
||||
|
@ -297,18 +297,18 @@ assertEquals(run((x)=>{
|
||||
assertEquals(f1(0), 0);
|
||||
assertEquals(f2(0), 0);
|
||||
assertTrue(isInterpreted(f1))
|
||||
assertFalse(isSparkplug(f1));
|
||||
assertFalse(isBaseline(f1));
|
||||
assertTrue(isInterpreted(f2))
|
||||
assertFalse(isSparkplug(f2));
|
||||
assertFalse(isBaseline(f2));
|
||||
|
||||
%CompileBaseline(f1);
|
||||
assertEquals(f1(0), 0);
|
||||
assertTrue(isSparkplug(f1));
|
||||
assertFalse(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f1));
|
||||
assertFalse(isBaseline(f2));
|
||||
|
||||
assertEquals(f2(0), 0);
|
||||
assertTrue(isSparkplug(f1));
|
||||
assertTrue(isSparkplug(f2));
|
||||
assertTrue(isBaseline(f1));
|
||||
assertTrue(isBaseline(f2));
|
||||
})();
|
||||
|
||||
// DeoptNow to Ignition
|
||||
@ -328,7 +328,7 @@ assertEquals(run((x)=>{
|
||||
assertTrue(isInterpreted(f));
|
||||
%CompileBaseline(f);
|
||||
f();
|
||||
assertTrue(isSparkplug(f));
|
||||
assertTrue(isBaseline(f));
|
||||
%DeoptimizeFunction(f);
|
||||
f();
|
||||
assertTrue(isInterpreted(f));
|
||||
|
@ -175,7 +175,7 @@ var V8OptimizationStatus = {
|
||||
kTopmostFrameIsTurboFanned: 1 << 11,
|
||||
kLiteMode: 1 << 12,
|
||||
kMarkedForDeoptimization: 1 << 13,
|
||||
kSparkplug: 1 << 14,
|
||||
kBaseline: 1 << 14,
|
||||
};
|
||||
|
||||
// Returns true if --lite-mode is on and we can't ever turn on optimization.
|
||||
@ -190,8 +190,8 @@ var isAlwaysOptimize;
|
||||
// Returns true if given function in interpreted.
|
||||
var isInterpreted;
|
||||
|
||||
// Returns true if given function in sparkplug.
|
||||
var isSparkplug;
|
||||
// Returns true if given function in baseline.
|
||||
var isBaseline;
|
||||
|
||||
// Returns true if given function is optimized.
|
||||
var isOptimized;
|
||||
@ -681,8 +681,8 @@ var prettyPrinted;
|
||||
return;
|
||||
}
|
||||
var is_optimized = (opt_status & V8OptimizationStatus.kOptimized) !== 0;
|
||||
var is_sparkplug = (opt_status & V8OptimizationStatus.kSparkplug) !== 0;
|
||||
assertFalse(is_optimized && !is_sparkplug, name_opt);
|
||||
var is_baseline = (opt_status & V8OptimizationStatus.kBaseline) !== 0;
|
||||
assertFalse(is_optimized && !is_baseline, name_opt);
|
||||
}
|
||||
|
||||
assertOptimized = function assertOptimized(
|
||||
@ -737,12 +737,12 @@ var prettyPrinted;
|
||||
(opt_status & V8OptimizationStatus.kInterpreted) !== 0;
|
||||
}
|
||||
|
||||
isSparkplug = function isSparkplug(fun) {
|
||||
isBaseline = function isBaseline(fun) {
|
||||
var opt_status = OptimizationStatus(fun, "");
|
||||
assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0,
|
||||
"not a function");
|
||||
return (opt_status & V8OptimizationStatus.kOptimized) === 0 &&
|
||||
(opt_status & V8OptimizationStatus.kSparkplug) !== 0;
|
||||
(opt_status & V8OptimizationStatus.kBaseline) !== 0;
|
||||
}
|
||||
|
||||
isOptimized = function isOptimized(fun) {
|
||||
|
@ -181,7 +181,7 @@ export class Profile {
|
||||
static CodeState = {
|
||||
COMPILED: 0,
|
||||
IGNITION: 1,
|
||||
SPARKPLUG: 2,
|
||||
BASELINE: 2,
|
||||
NATIVE_CONTEXT_INDEPENDENT: 3,
|
||||
TURBOPROP: 4,
|
||||
TURBOFAN: 5,
|
||||
@ -197,7 +197,7 @@ export class Profile {
|
||||
case '~':
|
||||
return this.CodeState.IGNITION;
|
||||
case '^':
|
||||
return this.CodeState.SPARKPLUG;
|
||||
return this.CodeState.BASELINE;
|
||||
case '-':
|
||||
return this.CodeState.NATIVE_CONTEXT_INDEPENDENT;
|
||||
case '+':
|
||||
@ -213,8 +213,8 @@ export class Profile {
|
||||
return "Builtin";
|
||||
} else if (state === this.CodeState.IGNITION) {
|
||||
return "Unopt";
|
||||
} else if (state === this.CodeState.SPARKPLUG) {
|
||||
return "Sparkplug";
|
||||
} else if (state === this.CodeState.BASELINE) {
|
||||
return "Baseline";
|
||||
} else if (state === this.CodeState.NATIVE_CONTEXT_INDEPENDENT) {
|
||||
return "NCI";
|
||||
} else if (state === this.CodeState.TURBOPROP) {
|
||||
|
@ -513,7 +513,7 @@ FRAME_MARKERS = (
|
||||
"WASM_EXIT",
|
||||
"WASM_COMPILE_LAZY",
|
||||
"INTERPRETED",
|
||||
"SPARKPLUG",
|
||||
"BASELINE",
|
||||
"OPTIMIZED",
|
||||
"STUB",
|
||||
"BUILTIN_CONTINUATION",
|
||||
|
Loading…
Reference in New Issue
Block a user