[vm] Introduce a separate VMTag for the interpreter.

Makes time spent in interpreted versus compiled Dart code visible in Observatory's pie chart. Will allow the profiler to know whether to start a stack walk from the machine code FP or the interpreter's FP.

Remove dead Dart 1 frontend tags. Add tag for loading bytecode.

Change-Id: I2c5a580e1581f8ccd5a93bb293899c81f900ef13
Reviewed-on: https://dart-review.googlesource.com/c/83564
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This commit is contained in:
Ryan Macnak 2018-11-09 01:58:54 +00:00 committed by commit-bot@chromium.org
parent 136c013bea
commit fa6a1684ef
17 changed files with 58 additions and 63 deletions

View file

@ -781,6 +781,8 @@ RawError* BytecodeReader::ReadFunctionBytecode(Thread* thread,
ASSERT(thread->sticky_error() == Error::null());
ASSERT(Thread::Current()->IsMutatorThread());
VMTagScope tagScope(thread, VMTag::kLoadBytecodeTagId);
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
StackZone stack_zone(thread);

View file

@ -675,7 +675,7 @@ static DART_NOINLINE bool InvokeRuntime(Thread* thread,
if (!setjmp(buffer.buffer_)) {
thread->set_vm_tag(reinterpret_cast<uword>(drt));
drt(args);
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartInterpretedTagId);
thread->set_top_exit_frame_info(0);
return true;
} else {
@ -692,7 +692,7 @@ static DART_NOINLINE bool InvokeNative(Thread* thread,
if (!setjmp(buffer.buffer_)) {
thread->set_vm_tag(reinterpret_cast<uword>(function));
wrapper(args, function);
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartInterpretedTagId);
thread->set_top_exit_frame_info(0);
return true;
} else {
@ -733,7 +733,7 @@ DART_NOINLINE bool Interpreter::InvokeCompiled(Thread* thread,
if (!setjmp(buffer.buffer_)) {
thread->set_vm_tag(reinterpret_cast<uword>(entrypoint));
result = entrypoint(code, argdesc_, call_base, thread);
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartInterpretedTagId);
thread->set_top_exit_frame_info(0);
ASSERT(thread->execution_state() == Thread::kThreadInGenerated);
} else {
@ -1044,7 +1044,7 @@ DART_NOINLINE bool Interpreter::ProcessInvocation(bool* invoked,
// Bytecode was loaded in the above compilation step.
// The caller will dispatch to the function's bytecode.
*invoked = false;
ASSERT(thread->vm_tag() == VMTag::kDartTagId);
ASSERT(thread->vm_tag() == VMTag::kDartInterpretedTagId);
ASSERT(thread->top_exit_frame_info() == 0);
return true;
}
@ -1633,7 +1633,7 @@ RawObject* Interpreter::Call(RawFunction* function,
// Save current VM tag and mark thread as executing Dart code.
const uword vm_tag = thread->vm_tag();
thread->set_vm_tag(VMTag::kDartTagId); // TODO(regis): kDartBytecodeTagId?
thread->set_vm_tag(VMTag::kDartInterpretedTagId);
// Save current top stack resource and reset the list.
StackResource* top_resource = thread->top_resource();
@ -3015,7 +3015,7 @@ void Interpreter::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
StackResource::Unwind(thread);
// Set the tag.
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartInterpretedTagId);
// Clear top exit frame.
thread->set_top_exit_frame_info(0);

View file

@ -3736,7 +3736,7 @@ void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
set_register(FP, static_cast<int32_t>(fp));
set_register(THR, reinterpret_cast<uword>(thread));
// Set the tag.
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
// Clear top exit frame.
thread->set_top_exit_frame_info(0);
// Restore pool pointer.

View file

@ -3556,7 +3556,7 @@ void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
set_register(NULL, FP, static_cast<int64_t>(fp));
set_register(NULL, THR, reinterpret_cast<int64_t>(thread));
// Set the tag.
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
// Clear top exit frame.
thread->set_top_exit_frame_info(0);
// Restore pool pointer.

View file

@ -957,7 +957,7 @@ DART_NOINLINE static bool InvokeRuntime(Thread* thread,
if (!setjmp(buffer.buffer_)) {
thread->set_vm_tag(reinterpret_cast<uword>(drt));
drt(args);
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
thread->set_top_exit_frame_info(0);
return true;
} else {
@ -974,7 +974,7 @@ DART_NOINLINE static bool InvokeNative(Thread* thread,
if (!setjmp(buffer.buffer_)) {
thread->set_vm_tag(reinterpret_cast<uword>(function));
wrapper(args, function);
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
thread->set_top_exit_frame_info(0);
return true;
} else {
@ -1227,7 +1227,7 @@ RawObject* Simulator::Call(const Code& code,
// Save current VM tag and mark thread as executing Dart code.
const uword vm_tag = thread->vm_tag();
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
// Save current top stack resource and reset the list.
StackResource* top_resource = thread->top_resource();
@ -3967,7 +3967,7 @@ void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) {
StackResource::Unwind(thread);
// Set the tag.
thread->set_vm_tag(VMTag::kDartTagId);
thread->set_vm_tag(VMTag::kDartCompiledTagId);
// Clear top exit frame.
thread->set_top_exit_frame_info(0);

View file

@ -55,7 +55,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
__ CompareImmediate(R8, VMTag::kDartTagId);
__ CompareImmediate(R8, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -94,7 +94,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ blx(R9);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -311,7 +311,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
__ CompareImmediate(R8, VMTag::kDartTagId);
__ CompareImmediate(R8, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -358,7 +358,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
__ blx(LR);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -404,7 +404,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(kWord, R8, THR, Thread::vm_tag_offset());
__ CompareImmediate(R8, VMTag::kDartTagId);
__ CompareImmediate(R8, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -448,7 +448,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
__ blx(R9);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -968,7 +968,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ Push(R9);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R9, VMTag::kDartTagId);
__ LoadImmediate(R9, VMTag::kDartCompiledTagId);
__ StoreToOffset(kWord, R9, THR, Thread::vm_tag_offset());
// Save top resource and top exit frame info. Use R4-6 as temporary registers.
@ -2458,7 +2458,7 @@ void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
__ mov(FP, Operand(R2)); // Frame_pointer.
__ mov(SP, Operand(IP)); // Set Stack pointer.
// Set the tag.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
// Clear top exit frame.
__ LoadImmediate(R2, 0);

View file

@ -56,7 +56,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(R8, THR, Thread::vm_tag_offset());
__ CompareImmediate(R8, VMTag::kDartTagId);
__ CompareImmediate(R8, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -118,7 +118,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
// Retval is next to 1st argument.
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -329,7 +329,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
__ CompareImmediate(R6, VMTag::kDartTagId);
__ CompareImmediate(R6, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -392,7 +392,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
__ ldr(BARRIER_MASK, Address(THR, Thread::write_barrier_mask_offset()));
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -437,7 +437,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
__ CompareImmediate(R6, VMTag::kDartTagId);
__ CompareImmediate(R6, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -497,7 +497,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
__ ldr(BARRIER_MASK, Address(THR, Thread::write_barrier_mask_offset()));
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -1049,7 +1049,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ Push(R4);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R6, VMTag::kDartTagId);
__ LoadImmediate(R6, VMTag::kDartCompiledTagId);
__ StoreToOffset(R6, THR, Thread::vm_tag_offset());
// Save top resource and top exit frame info. Use R6 as a temporary register.
@ -1188,7 +1188,7 @@ void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
__ Push(R4);
// Mark that the thread is executing Dart code.
__ LoadImmediate(R6, VMTag::kDartTagId);
__ LoadImmediate(R6, VMTag::kDartCompiledTagId);
__ StoreToOffset(R6, THR, Thread::vm_tag_offset());
// Save top resource and top exit frame info. Use R6 as a temporary register.
@ -2176,7 +2176,7 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
Label ok;
// Check that we are always entering from Dart code.
__ LoadFromOffset(R8, THR, Thread::vm_tag_offset());
__ CompareImmediate(R8, VMTag::kDartTagId);
__ CompareImmediate(R8, VMTag::kDartCompiledTagId);
__ b(&ok, EQ);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -2232,7 +2232,7 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
__ ldr(BARRIER_MASK, Address(THR, Thread::write_barrier_mask_offset()));
// Mark that the thread is executing Dart code.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(R2, THR, Thread::vm_tag_offset());
// Reset exit frame information in Isolate structure.
@ -2723,7 +2723,7 @@ void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
__ mov(THR, R3);
__ ldr(BARRIER_MASK, Address(THR, Thread::write_barrier_mask_offset()));
// Set the tag.
__ LoadImmediate(R2, VMTag::kDartTagId);
__ LoadImmediate(R2, VMTag::kDartCompiledTagId);
__ StoreToOffset(R2, THR, Thread::vm_tag_offset());
// Clear top exit frame.
__ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());

View file

@ -55,7 +55,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
{
Label ok;
// Check that we are always entering from Dart code.
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -83,7 +83,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ movl(Address(ESP, retval_offset), EAX); // Set retval in NativeArguments.
__ call(ECX);
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -160,7 +160,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
{
Label ok;
// Check that we are always entering from Dart code.
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -191,7 +191,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
__ movl(Address(ESP, kWordSize), ECX); // Function to call.
__ call(wrapper);
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -237,7 +237,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
{
Label ok;
// Check that we are always entering from Dart code.
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
__ Bind(&ok);
@ -265,7 +265,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
__ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments.
__ call(ECX);
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -757,7 +757,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ pushl(ECX);
// Mark that the thread is executing Dart code.
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Save top resource and top exit frame info. Use EDX as a temporary register.
// StackFrameIterator reads the top exit frame info saved in this frame.
@ -2011,7 +2011,7 @@ void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
__ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX.
__ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer.
// Set tag.
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Clear top exit frame.
__ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
__ jmp(EBX); // Jump to the exception handler code.

View file

@ -59,7 +59,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
{
Label ok;
// Check that we are always entering from Dart code.
__ movq(RAX, Immediate(VMTag::kDartTagId));
__ movq(RAX, Immediate(VMTag::kDartCompiledTagId));
__ cmpq(RAX, Assembler::VMTagAddress());
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
@ -93,7 +93,7 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ CallCFunction(RBX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -314,7 +314,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
{
Label ok;
// Check that we are always entering from Dart code.
__ movq(R8, Immediate(VMTag::kDartTagId));
__ movq(R8, Immediate(VMTag::kDartCompiledTagId));
__ cmpq(R8, Assembler::VMTagAddress());
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
@ -349,7 +349,7 @@ static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
__ CallCFunction(RAX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -397,7 +397,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
{
Label ok;
// Check that we are always entering from Dart code.
__ movq(R8, Immediate(VMTag::kDartTagId));
__ movq(R8, Immediate(VMTag::kDartCompiledTagId));
__ cmpq(R8, Assembler::VMTagAddress());
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
@ -428,7 +428,7 @@ void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
__ CallCFunction(RBX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -965,7 +965,7 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
__ pushq(RAX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Save top resource and top exit frame info. Use RAX as a temporary register.
// StackFrameIterator reads the top exit frame info saved in this frame.
@ -1106,7 +1106,7 @@ void StubCode::GenerateInvokeDartCodeFromBytecodeStub(Assembler* assembler) {
__ pushq(RAX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Save top resource and top exit frame info. Use RAX as a temporary register.
// StackFrameIterator reads the top exit frame info saved in this frame.
@ -2187,7 +2187,7 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
{
Label ok;
// Check that we are always entering from Dart code.
__ movq(R8, Immediate(VMTag::kDartTagId));
__ movq(R8, Immediate(VMTag::kDartCompiledTagId));
__ cmpq(R8, Assembler::VMTagAddress());
__ j(EQUAL, &ok, Assembler::kNearJump);
__ Stop("Not coming from Dart code.");
@ -2238,7 +2238,7 @@ void StubCode::GenerateInterpretCallStub(Assembler* assembler) {
__ call(RAX);
// Mark that the thread is executing Dart code.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Reset exit frame information in Isolate structure.
__ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@ -2729,7 +2729,7 @@ void StubCode::GenerateJumpToFrameStub(Assembler* assembler) {
__ movq(RBP, CallingConventions::kArg3Reg);
__ movq(RSP, CallingConventions::kArg2Reg);
// Set the tag.
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
__ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartCompiledTagId));
// Clear top exit frame.
__ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
// Restore the pool pointer.

View file

@ -36,7 +36,7 @@ bool VMTag::IsNativeEntryTag(uword tag) {
}
bool VMTag::IsDartTag(uword id) {
return id == kDartTagId;
return (id == kDartCompiledTagId) || (id == kDartInterpretedTagId);
}
bool VMTag::IsExitFrameTag(uword id) {

View file

@ -17,15 +17,13 @@ class RuntimeEntry;
V(Idle) /* isolate is idle and is_runnable() */ \
V(LoadWait) /* isolate is idle and !is_runnable() */ \
V(VM) /* Catch all */ \
V(LoadBytecode) \
V(CompileOptimized) \
V(CompileUnoptimized) \
V(CompileClass) \
V(CompileTopLevel) \
V(CompileScanner) \
V(CompileParseFunction) \
V(CompileParseRegExp) \
V(CompileFlowGraphBuilder) \
V(Dart) \
V(DartCompiled) \
V(DartInterpreted) \
V(GCNewSpace) \
V(GCOldSpace) \
V(Embedder) \

View file

@ -637,11 +637,11 @@ bool Thread::CanCollectGarbage() const {
}
bool Thread::IsExecutingDartCode() const {
return (top_exit_frame_info() == 0) && (vm_tag() == VMTag::kDartTagId);
return (top_exit_frame_info() == 0) && VMTag::IsDartTag(vm_tag());
}
bool Thread::HasExitedDartCode() const {
return (top_exit_frame_info() != 0) && (vm_tag() != VMTag::kDartTagId);
return (top_exit_frame_info() != 0) && !VMTag::IsDartTag(vm_tag());
}
template <class C>

View file

@ -18,7 +18,6 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
class ThreadInterrupterAndroid : public AllStatic {

View file

@ -23,7 +23,6 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
// TODO(ZX-430): Currently, CPU profiling for Fuchsia is arranged very similarly

View file

@ -17,7 +17,6 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
class ThreadInterrupterLinux : public AllStatic {

View file

@ -22,7 +22,6 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
// Returns true if the current process is being debugged (either

View file

@ -14,7 +14,6 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
#define kThreadError -1