diff options
Diffstat (limited to 'deps/v8/src/codegen.cc')
-rw-r--r-- | deps/v8/src/codegen.cc | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/deps/v8/src/codegen.cc b/deps/v8/src/codegen.cc index fb8c5cd4a3..8a64d77b70 100644 --- a/deps/v8/src/codegen.cc +++ b/deps/v8/src/codegen.cc @@ -139,6 +139,16 @@ void CodeGenerator::MakeCodePrologue(CompilationInfo* info) { print_source = FLAG_print_source; print_ast = FLAG_print_ast; print_json_ast = FLAG_print_json_ast; + Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); + if (print_source && !filter.is_empty()) { + print_source = info->function()->name()->IsEqualTo(filter); + } + if (print_ast && !filter.is_empty()) { + print_ast = info->function()->name()->IsEqualTo(filter); + } + if (print_json_ast && !filter.is_empty()) { + print_json_ast = info->function()->name()->IsEqualTo(filter); + } ftype = "user-defined"; } @@ -174,14 +184,24 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, masm->GetCode(&desc); Handle<Code> code = Factory::NewCode(desc, flags, masm->CodeObject()); + if (!code.is_null()) { + Counters::total_compiled_code_size.Increment(code->instruction_size()); + } + return code; +} + + +void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { #ifdef ENABLE_DISASSEMBLER bool print_code = Bootstrapper::IsActive() ? FLAG_print_builtin_code - : FLAG_print_code; - if (print_code) { + : (FLAG_print_code || (info->IsOptimizing() && FLAG_print_opt_code)); + Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); + FunctionLiteral* function = info->function(); + bool match = filter.is_empty() || function->debug_name()->IsEqualTo(filter); + if (print_code && match) { // Print the source code if available. Handle<Script> script = info->script(); - FunctionLiteral* function = info->function(); if (!script->IsUndefined() && !script->source()->IsUndefined()) { PrintF("--- Raw source ---\n"); StringInputBuffer stream(String::cast(script->source())); @@ -199,22 +219,22 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, code->Disassemble(*function->name()->ToCString()); } #endif // ENABLE_DISASSEMBLER - - if (!code.is_null()) { - Counters::total_compiled_code_size.Increment(code->instruction_size()); - } - return code; } // Generate the code. Compile the AST and assemble all the pieces into a // Code object. bool CodeGenerator::MakeCode(CompilationInfo* info) { + // When using Crankshaft the classic backend should never be used. + ASSERT(!V8::UseCrankshaft()); Handle<Script> script = info->script(); if (!script->IsUndefined() && !script->source()->IsUndefined()) { int len = String::cast(script->source())->length(); Counters::total_old_codegen_source_size.Increment(len); } + if (FLAG_trace_codegen) { + PrintF("Classic Compiler - "); + } MakeCodePrologue(info); // Generate code. const int kInitialBufferSize = 4 * KB; @@ -230,6 +250,9 @@ bool CodeGenerator::MakeCode(CompilationInfo* info) { InLoopFlag in_loop = info->is_in_loop() ? IN_LOOP : NOT_IN_LOOP; Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop); Handle<Code> code = MakeCodeEpilogue(cgen.masm(), flags, info); + // There is no stack check table in code generated by the classic backend. + code->SetNoStackCheckTable(); + CodeGenerator::PrintCode(code, info); info->SetCode(code); // May be an empty handle. return !code.is_null(); } @@ -441,10 +464,11 @@ void ArgumentsAccessStub::Generate(MacroAssembler* masm) { int CEntryStub::MinorKey() { ASSERT(result_size_ == 1 || result_size_ == 2); + int result = save_doubles_ ? 1 : 0; #ifdef _WIN64 - return result_size_ == 1 ? 0 : 1; + return result | ((result_size_ == 1) ? 0 : 2); #else - return 0; + return result; #endif } |