CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, CompilationInfo* info) { Isolate* isolate = info->isolate(); Code::Flags flags; if (info->IsStub() && info->code_stub()) { DCHECK_EQ(info->output_code_kind(), info->code_stub()->GetCodeKind()); flags = Code::ComputeFlags( info->output_code_kind(), info->code_stub()->GetICState(), info->code_stub()->GetExtraICState(), info->code_stub()->GetStubType()); } else { flags = Code::ComputeFlags(info->output_code_kind()); } // Allocate and install the code. CodeDesc desc; bool is_crankshafted = Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || info->IsStub(); masm->GetCode(&desc); Handle code = isolate->factory()->NewCode(desc, flags, masm->CodeObject(), false, is_crankshafted, info->prologue_offset(), info->is_debug() && !is_crankshafted); isolate->counters()->total_compiled_code_size()->Increment( code->instruction_size()); isolate->heap()->IncrementCodeGeneratedBytes(is_crankshafted, code->instruction_size()); return code; } void CodeGenerator::PrintCode(Handle code, CompilationInfo* info) { #ifdef ENABLE_DISASSEMBLER AllowDeferredHandleDereference allow_deference_for_print_code; bool print_code = info->isolate()->bootstrapper()->IsActive() ? FLAG_print_builtin_code : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || (info->IsOptimizing() && FLAG_print_opt_code)); if (print_code) { base::SmartArrayPointer debug_name = info->GetDebugName(); CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); OFStream os(tracing_scope.file()); // Print the source code if available. bool print_source = info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || code->kind() == Code::FUNCTION); if (print_source) { FunctionLiteral* literal = info->literal(); Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
code = isolate->factory()->NewCode(desc, flags, masm->CodeObject(), false, is_crankshafted, info->prologue_offset(), info->is_debug() && !is_crankshafted); isolate->counters()->total_compiled_code_size()->Increment( code->instruction_size()); isolate->heap()->IncrementCodeGeneratedBytes(is_crankshafted, code->instruction_size()); return code; } void CodeGenerator::PrintCode(Handle code, CompilationInfo* info) { #ifdef ENABLE_DISASSEMBLER AllowDeferredHandleDereference allow_deference_for_print_code; bool print_code = info->isolate()->bootstrapper()->IsActive() ? FLAG_print_builtin_code : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || (info->IsOptimizing() && FLAG_print_opt_code)); if (print_code) { base::SmartArrayPointer debug_name = info->GetDebugName(); CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); OFStream os(tracing_scope.file()); // Print the source code if available. bool print_source = info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || code->kind() == Code::FUNCTION); if (print_source) { FunctionLiteral* literal = info->literal(); Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
code, CompilationInfo* info) { #ifdef ENABLE_DISASSEMBLER AllowDeferredHandleDereference allow_deference_for_print_code; bool print_code = info->isolate()->bootstrapper()->IsActive() ? FLAG_print_builtin_code : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || (info->IsOptimizing() && FLAG_print_opt_code)); if (print_code) { base::SmartArrayPointer debug_name = info->GetDebugName(); CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); OFStream os(tracing_scope.file()); // Print the source code if available. bool print_source = info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || code->kind() == Code::FUNCTION); if (print_source) { FunctionLiteral* literal = info->literal(); Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
您还没有登录,登录后您可以:
首次使用?从这里 注册