mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:27:43 +00:00
Fix disassembly of OSR functions.
This got broken when I changed the compiler to not install OSR code on the function, where it had to be immediately uninstalled again. R=vegorov@google.com BUG= Review-Url: https://codereview.chromium.org/2793943002 .
This commit is contained in:
parent
38f398281d
commit
1f1854aa78
|
@ -1349,10 +1349,10 @@ static RawObject* CompileFunctionHelper(CompilationPipeline* pipeline,
|
|||
}
|
||||
|
||||
if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
|
||||
Disassembler::DisassembleCode(function, optimized);
|
||||
Disassembler::DisassembleCode(function, result, optimized);
|
||||
} else if (FLAG_disassemble_optimized && optimized &&
|
||||
FlowGraphPrinter::ShouldPrint(function)) {
|
||||
Disassembler::DisassembleCode(function, true);
|
||||
Disassembler::DisassembleCode(function, result, true);
|
||||
}
|
||||
|
||||
return result.raw();
|
||||
|
@ -1559,7 +1559,8 @@ RawError* Compiler::CompileParsedFunction(ParsedFunction* parsed_function) {
|
|||
CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
|
||||
helper.Compile(&pipeline);
|
||||
if (FLAG_disassemble) {
|
||||
Disassembler::DisassembleCode(parsed_function->function(), false);
|
||||
Code& code = Code::Handle(parsed_function->function().CurrentCode());
|
||||
Disassembler::DisassembleCode(parsed_function->function(), code, false);
|
||||
}
|
||||
return Error::null();
|
||||
} else {
|
||||
|
|
|
@ -301,17 +301,10 @@ void Disassembler::DisassembleCodeHelper(const char* function_fullname,
|
|||
}
|
||||
|
||||
|
||||
void Disassembler::DisassembleCode(const Function& function, bool optimized) {
|
||||
void Disassembler::DisassembleCode(const Function& function,
|
||||
const Code& code,
|
||||
bool optimized) {
|
||||
const char* function_fullname = function.ToFullyQualifiedCString();
|
||||
const Code& code = Code::Handle(function.CurrentCode());
|
||||
DisassembleCodeHelper(function_fullname, code, optimized);
|
||||
}
|
||||
|
||||
|
||||
void Disassembler::DisassembleCodeUnoptimized(const Function& function,
|
||||
bool optimized) {
|
||||
const char* function_fullname = function.ToFullyQualifiedCString();
|
||||
const Code& code = Code::Handle(function.unoptimized_code());
|
||||
DisassembleCodeHelper(function_fullname, code, optimized);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ class Disassembler : public AllStatic {
|
|||
Object** object,
|
||||
uword pc);
|
||||
|
||||
static void DisassembleCode(const Function& function, bool optimized);
|
||||
static void DisassembleCodeUnoptimized(const Function& function,
|
||||
bool optimized);
|
||||
static void DisassembleCode(const Function& function,
|
||||
const Code& code,
|
||||
bool optimized);
|
||||
|
||||
private:
|
||||
static void DisassembleCodeHelper(const char* function_fullname,
|
||||
|
|
|
@ -1246,7 +1246,8 @@ RawFunction* Precompiler::CompileStaticInitializer(const Field& field,
|
|||
|
||||
if ((FLAG_disassemble || FLAG_disassemble_optimized) &&
|
||||
FlowGraphPrinter::ShouldPrint(parsed_function->function())) {
|
||||
Disassembler::DisassembleCode(parsed_function->function(),
|
||||
Code& code = Code::Handle(parsed_function->function().CurrentCode());
|
||||
Disassembler::DisassembleCode(parsed_function->function(), code,
|
||||
/* optimized = */ true);
|
||||
}
|
||||
return parsed_function->function().raw();
|
||||
|
@ -3532,10 +3533,12 @@ static RawError* PrecompileFunctionHelper(Precompiler* precompiler,
|
|||
}
|
||||
|
||||
if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
|
||||
Disassembler::DisassembleCode(function, optimized);
|
||||
Code& code = Code::Handle(function.CurrentCode());
|
||||
Disassembler::DisassembleCode(function, code, optimized);
|
||||
} else if (FLAG_disassemble_optimized && optimized &&
|
||||
FlowGraphPrinter::ShouldPrint(function)) {
|
||||
Disassembler::DisassembleCode(function, true);
|
||||
Code& code = Code::Handle(function.CurrentCode());
|
||||
Disassembler::DisassembleCode(function, code, true);
|
||||
}
|
||||
return Error::null();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue