diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 6c4bf4276d..c9ff2978d5 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,7 +1,15 @@ +2011-01-19: Version 3.0.9 + + Added basic GDB JIT Interface integration. + + Make invalid break/continue statements a syntax error instead of a + runtime error. + + 2011-01-17: Version 3.0.8 Exposed heap size limit to the heap statistics gathered by - the GetHeapStatistics API. + the GetHeapStatistics API. Wrapped external pointers more carefully (issue 1037). diff --git a/deps/v8/LICENSE b/deps/v8/LICENSE index c1fcb1a146..e435050e90 100644 --- a/deps/v8/LICENSE +++ b/deps/v8/LICENSE @@ -24,7 +24,7 @@ are: These libraries have their own licenses; we recommend you read them, as their terms may differ from the terms below. -Copyright 2006-2009, Google Inc. All rights reserved. +Copyright 2006-2011, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct index e10f8117c3..50babbae87 100644 --- a/deps/v8/SConstruct +++ b/deps/v8/SConstruct @@ -124,12 +124,15 @@ LIBRARY_FLAGS = { }, 'debuggersupport:on': { 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], + }, + 'inspector:on': { + 'CPPDEFINES': ['INSPECTOR'], } }, 'gcc': { 'all': { 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], - 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions', '-fno-builtin-memcpy'], + 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], }, 'visibility:hidden': { # Use visibility=default to disable this. @@ -229,6 +232,9 @@ LIBRARY_FLAGS = { }, 'prof:oprofile': { 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] + }, + 'gdbjit:on': { + 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE'] } }, 'msvc': { @@ -705,6 +711,11 @@ SIMPLE_OPTIONS = { 'default': 'off', 'help': 'enable profiling of build target' }, + 'gdbjit': { + 'values': ['on', 'off'], + 'default': 'off', + 'help': 'enable GDB JIT interface' + }, 'library': { 'values': ['static', 'shared'], 'default': 'static', @@ -735,6 +746,11 @@ SIMPLE_OPTIONS = { 'default': 'on', 'help': 'enable debugging of JavaScript code' }, + 'inspector': { + 'values': ['on', 'off'], + 'default': 'off', + 'help': 'enable inspector features' + }, 'soname': { 'values': ['on', 'off'], 'default': 'off', @@ -871,6 +887,8 @@ def VerifyOptions(env): return False if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on': Abort("Profiling on windows only supported for static library.") + if env['gdbjit'] == 'on' and (env['os'] != 'linux' or (env['arch'] != 'ia32' and env['arch'] != 'x64')): + Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux target.") if env['prof'] == 'oprofile' and env['os'] != 'linux': Abort("OProfile is only supported on Linux.") if env['os'] == 'win32' and env['soname'] == 'on': diff --git a/deps/v8/src/SConscript b/deps/v8/src/SConscript index 79b12040bd..708edeff06 100755 --- a/deps/v8/src/SConscript +++ b/deps/v8/src/SConscript @@ -71,6 +71,7 @@ SOURCES = { frames.cc full-codegen.cc func-name-inferrer.cc + gdb-jit.cc global-handles.cc fast-dtoa.cc fixed-dtoa.cc @@ -81,6 +82,7 @@ SOURCES = { hydrogen.cc hydrogen-instructions.cc ic.cc + inspector.cc interpreter-irregexp.cc jsregexp.cc jump-target.cc @@ -190,6 +192,7 @@ SOURCES = { ia32/ic-ia32.cc ia32/jump-target-ia32.cc ia32/lithium-codegen-ia32.cc + ia32/lithium-gap-resolver-ia32.cc ia32/lithium-ia32.cc ia32/macro-assembler-ia32.cc ia32/regexp-macro-assembler-ia32.cc diff --git a/deps/v8/src/arm/assembler-arm.cc b/deps/v8/src/arm/assembler-arm.cc index a7c1897aed..11a9c3930f 100644 --- a/deps/v8/src/arm/assembler-arm.cc +++ b/deps/v8/src/arm/assembler-arm.cc @@ -2495,6 +2495,10 @@ void Assembler::GrowBuffer() { void Assembler::db(uint8_t data) { + // No relocation info should be pending while using db. db is used + // to write pure data with no pointers and the constant pool should + // be emitted before using db. + ASSERT(num_prinfo_ == 0); CheckBuffer(); *reinterpret_cast(pc_) = data; pc_ += sizeof(uint8_t); @@ -2502,6 +2506,10 @@ void Assembler::db(uint8_t data) { void Assembler::dd(uint32_t data) { + // No relocation info should be pending while using dd. dd is used + // to write pure data with no pointers and the constant pool should + // be emitted before using dd. + ASSERT(num_prinfo_ == 0); CheckBuffer(); *reinterpret_cast(pc_) = data; pc_ += sizeof(uint32_t); diff --git a/deps/v8/src/arm/assembler-arm.h b/deps/v8/src/arm/assembler-arm.h index e0ea819e99..ad1bdabd01 100644 --- a/deps/v8/src/arm/assembler-arm.h +++ b/deps/v8/src/arm/assembler-arm.h @@ -1240,8 +1240,10 @@ class Assembler : public Malloced { // Use --code-comments to enable. void RecordComment(const char* msg); - // Writes a single byte or word of data in the code stream. Used for - // inline tables, e.g., jump-tables. + // Writes a single byte or word of data in the code stream. Used + // for inline tables, e.g., jump-tables. The constant pool should be + // emitted before any use of db and dd to ensure that constant pools + // are not emitted as part of the tables generated. void db(uint8_t data); void dd(uint32_t data); diff --git a/deps/v8/src/arm/ic-arm.cc b/deps/v8/src/arm/ic-arm.cc index 340bc1ef90..6120bba458 100644 --- a/deps/v8/src/arm/ic-arm.cc +++ b/deps/v8/src/arm/ic-arm.cc @@ -542,8 +542,12 @@ static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, Label number, non_number, non_string, boolean, probe, miss; // Probe the stub cache. - Code::Flags flags = - Code::ComputeFlags(kind, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc); + Code::Flags flags = Code::ComputeFlags(kind, + NOT_IN_LOOP, + MONOMORPHIC, + Code::kNoExtraICState, + NORMAL, + argc); StubCache::GenerateProbe(masm, flags, r1, r2, r3, r4, r5); // If the stub cache probing failed, the receiver might be a value. diff --git a/deps/v8/src/arm/lithium-arm.cc b/deps/v8/src/arm/lithium-arm.cc index df890ab55b..b51633e706 100644 --- a/deps/v8/src/arm/lithium-arm.cc +++ b/deps/v8/src/arm/lithium-arm.cc @@ -576,6 +576,13 @@ LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { } +LOperand* LChunkBuilder::UseAny(HValue* value) { + return value->IsConstant() + ? chunk_->DefineConstantOperand(HConstant::cast(value)) + : Use(value, new LUnallocated(LUnallocated::ANY)); +} + + LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) { if (value->EmitAtUses()) { HInstruction* instr = HInstruction::cast(value); @@ -907,11 +914,7 @@ LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { } else if (value->IsPushArgument()) { op = new LArgument(argument_index++); } else { - op = UseOrConstant(value); - if (op->IsUnallocated()) { - LUnallocated* unalloc = LUnallocated::cast(op); - unalloc->set_policy(LUnallocated::ANY); - } + op = UseAny(value); } result->AddValue(op, value->representation()); } diff --git a/deps/v8/src/arm/lithium-arm.h b/deps/v8/src/arm/lithium-arm.h index c6b89a5046..aab408111c 100644 --- a/deps/v8/src/arm/lithium-arm.h +++ b/deps/v8/src/arm/lithium-arm.h @@ -1887,15 +1887,25 @@ class LChunkBuilder BASE_EMBEDDED { LOperand* UseRegister(HValue* value); LOperand* UseRegisterAtStart(HValue* value); - // A value in a register that may be trashed. + // An input operand in a register that may be trashed. LOperand* UseTempRegister(HValue* value); + + // An input operand in a register or stack slot. LOperand* Use(HValue* value); LOperand* UseAtStart(HValue* value); + + // An input operand in a register, stack slot or a constant operand. LOperand* UseOrConstant(HValue* value); LOperand* UseOrConstantAtStart(HValue* value); + + // An input operand in a register or a constant operand. LOperand* UseRegisterOrConstant(HValue* value); LOperand* UseRegisterOrConstantAtStart(HValue* value); + // An input operand in register, stack slot or a constant operand. + // Will not be moved to a register even if one is freely available. + LOperand* UseAny(HValue* value); + // Methods for setting up define-use relationships. // Return the same instruction that they are passed. LInstruction* Define(LInstruction* instr, LUnallocated* result); diff --git a/deps/v8/src/arm/lithium-codegen-arm.cc b/deps/v8/src/arm/lithium-codegen-arm.cc index dca95f2361..55df8b4cb8 100644 --- a/deps/v8/src/arm/lithium-codegen-arm.cc +++ b/deps/v8/src/arm/lithium-codegen-arm.cc @@ -172,13 +172,13 @@ bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) { void LGapResolver::RegisterMove(LMoveOperands move) { - if (move.from()->IsConstantOperand()) { + if (move.source()->IsConstantOperand()) { // Constant moves should be last in the machine code. Therefore add them // first to the result set. - AddResultMove(move.from(), move.to()); + AddResultMove(move.source(), move.destination()); } else { - LGapNode* from = LookupNode(move.from()); - LGapNode* to = LookupNode(move.to()); + LGapNode* from = LookupNode(move.source()); + LGapNode* to = LookupNode(move.destination()); if (to->IsAssigned() && to->assigned_from() == from) { move.Eliminate(); return; @@ -341,6 +341,11 @@ bool LCodeGen::GenerateDeferredCode() { __ jmp(code->exit()); } + // Force constant pool emission at the end of deferred code to make + // sure that no constant pools are emitted after the official end of + // the instruction sequence. + masm()->CheckConstPool(true, false); + // Deferred code is the last part of the instruction sequence. Mark // the generated code as done unless we bailed out. if (!is_aborted()) status_ = DONE; @@ -816,8 +821,8 @@ void LCodeGen::DoParallelMove(LParallelMove* move) { resolver_.Resolve(move->move_operands(), &marker_operand); for (int i = moves->length() - 1; i >= 0; --i) { LMoveOperands move = moves->at(i); - LOperand* from = move.from(); - LOperand* to = move.to(); + LOperand* from = move.source(); + LOperand* to = move.destination(); ASSERT(!from->IsDoubleRegister() || !ToDoubleRegister(from).is(dbl_scratch)); ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(dbl_scratch)); @@ -999,7 +1004,6 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { void LCodeGen::DoModI(LModI* instr) { - Abort("ModI not implemented"); class DeferredModI: public LDeferredCode { public: DeferredModI(LCodeGen* codegen, LModI* instr) @@ -1055,7 +1059,6 @@ void LCodeGen::DoModI(LModI* instr) { void LCodeGen::DoDivI(LDivI* instr) { - Abort("DivI not implemented"); class DeferredDivI: public LDeferredCode { public: DeferredDivI(LCodeGen* codegen, LDivI* instr) @@ -1293,7 +1296,10 @@ void LCodeGen::DoConstantI(LConstantI* instr) { void LCodeGen::DoConstantD(LConstantD* instr) { - Abort("DoConstantD unimplemented."); + ASSERT(instr->result()->IsDoubleRegister()); + DwVfpRegister result = ToDoubleRegister(instr->result()); + double v = instr->value(); + __ vmov(result, v); } @@ -2336,6 +2342,15 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { // Move the result back to general purpose register r0. __ vmov(result, single_scratch); + + // Test for -0. + Label done; + __ cmp(result, Operand(0)); + __ b(ne, &done); + __ vmov(scratch, input.high()); + __ tst(scratch, Operand(HeapNumber::kSignMask)); + DeoptimizeIf(ne, instr->environment()); + __ bind(&done); } diff --git a/deps/v8/src/arm/stub-cache-arm.cc b/deps/v8/src/arm/stub-cache-arm.cc index 20e2801826..b7ec5d245a 100644 --- a/deps/v8/src/arm/stub-cache-arm.cc +++ b/deps/v8/src/arm/stub-cache-arm.cc @@ -1332,11 +1332,10 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, MaybeObject* CallStubCompiler::GenerateMissBranch() { + MaybeObject* maybe_obj = StubCache::ComputeCallMiss(arguments().immediate(), + kind_); Object* obj; - { MaybeObject* maybe_obj = - StubCache::ComputeCallMiss(arguments().immediate(), kind_); - if (!maybe_obj->ToObject(&obj)) return maybe_obj; - } + if (!maybe_obj->ToObject(&obj)) return maybe_obj; __ Jump(Handle(Code::cast(obj)), RelocInfo::CODE_TARGET); return obj; } @@ -1646,8 +1645,15 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( const int argc = arguments().immediate(); Label miss; + Label name_miss; Label index_out_of_range; - GenerateNameCheck(name, &miss); + Label* index_out_of_range_label = &index_out_of_range; + + if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { + index_out_of_range_label = &miss; + } + + GenerateNameCheck(name, &name_miss); // Check that the maps starting from the prototype haven't changed. GenerateDirectLoadGlobalFunctionPrototype(masm(), @@ -1675,7 +1681,7 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( result, &miss, // When not a string. &miss, // When not a number. - &index_out_of_range, + index_out_of_range_label, STRING_INDEX_IS_NUMBER); char_code_at_generator.GenerateFast(masm()); __ Drop(argc + 1); @@ -1684,12 +1690,17 @@ MaybeObject* CallStubCompiler::CompileStringCharCodeAtCall( StubRuntimeCallHelper call_helper; char_code_at_generator.GenerateSlow(masm(), call_helper); - __ bind(&index_out_of_range); - __ LoadRoot(r0, Heap::kNanValueRootIndex); - __ Drop(argc + 1); - __ Ret(); + if (index_out_of_range.is_linked()) { + __ bind(&index_out_of_range); + __ LoadRoot(r0, Heap::kNanValueRootIndex); + __ Drop(argc + 1); + __ Ret(); + } __ bind(&miss); + // Restore function name in r2. + __ Move(r2, Handle(name)); + __ bind(&name_miss); Object* obj; { MaybeObject* maybe_obj = GenerateMissBranch(); if (!maybe_obj->ToObject(&obj)) return maybe_obj; @@ -1720,9 +1731,15 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( const int argc = arguments().immediate(); Label miss; + Label name_miss; Label index_out_of_range; + Label* index_out_of_range_label = &index_out_of_range; - GenerateNameCheck(name, &miss); + if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { + index_out_of_range_label = &miss; + } + + GenerateNameCheck(name, &name_miss); // Check that the maps starting from the prototype haven't changed. GenerateDirectLoadGlobalFunctionPrototype(masm(), @@ -1752,7 +1769,7 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( result, &miss, // When not a string. &miss, // When not a number. - &index_out_of_range, + index_out_of_range_label, STRING_INDEX_IS_NUMBER); char_at_generator.GenerateFast(masm()); __ Drop(argc + 1); @@ -1761,12 +1778,17 @@ MaybeObject* CallStubCompiler::CompileStringCharAtCall( StubRuntimeCallHelper call_helper; char_at_generator.GenerateSlow(masm(), call_helper); - __ bind(&index_out_of_range); - __ LoadRoot(r0, Heap::kEmptyStringRootIndex); - __ Drop(argc + 1); - __ Ret(); + if (index_out_of_range.is_linked()) { + __ bind(&index_out_of_range); + __ LoadRoot(r0, Heap::kEmptyStringRootIndex); + __ Drop(argc + 1); + __ Ret(); + } __ bind(&miss); + // Restore function name in r2. + __ Move(r2, Handle(name)); + __ bind(&name_miss); Object* obj; { MaybeObject* maybe_obj = GenerateMissBranch(); if (!maybe_obj->ToObject(&obj)) return maybe_obj; diff --git a/deps/v8/src/assembler.cc b/deps/v8/src/assembler.cc index cdcf481891..fb9a4af14e 100644 --- a/deps/v8/src/assembler.cc +++ b/deps/v8/src/assembler.cc @@ -917,6 +917,11 @@ void PositionsRecorder::RecordPosition(int pos) { ASSERT(pos != RelocInfo::kNoPosition); ASSERT(pos >= 0); state_.current_position = pos; +#ifdef ENABLE_GDB_JIT_INTERFACE + if (gdbjit_lineinfo_ != NULL) { + gdbjit_lineinfo_->SetPosition(assembler_->pc_offset(), pos, false); + } +#endif } @@ -924,6 +929,11 @@ void PositionsRecorder::RecordStatementPosition(int pos) { ASSERT(pos != RelocInfo::kNoPosition); ASSERT(pos >= 0); state_.current_statement_position = pos; +#ifdef ENABLE_GDB_JIT_INTERFACE + if (gdbjit_lineinfo_ != NULL) { + gdbjit_lineinfo_->SetPosition(assembler_->pc_offset(), pos, true); + } +#endif } diff --git a/deps/v8/src/assembler.h b/deps/v8/src/assembler.h index 5817a15b45..4ef61e4b14 100644 --- a/deps/v8/src/assembler.h +++ b/deps/v8/src/assembler.h @@ -35,6 +35,7 @@ #ifndef V8_ASSEMBLER_H_ #define V8_ASSEMBLER_H_ +#include "gdb-jit.h" #include "runtime.h" #include "top.h" #include "token.h" @@ -637,7 +638,29 @@ struct PositionState { class PositionsRecorder BASE_EMBEDDED { public: explicit PositionsRecorder(Assembler* assembler) - : assembler_(assembler) {} + : assembler_(assembler) { +#ifdef ENABLE_GDB_JIT_INTERFACE + gdbjit_lineinfo_ = NULL; +#endif + } + +#ifdef ENABLE_GDB_JIT_INTERFACE + ~PositionsRecorder() { + delete gdbjit_lineinfo_; + } + + void StartGDBJITLineInfoRecording() { + if (FLAG_gdbjit) { + gdbjit_lineinfo_ = new GDBJITLineInfo(); + } + } + + GDBJITLineInfo* DetachGDBJITLineInfo() { + GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; + gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. + return lineinfo; + } +#endif // Set current position to pos. void RecordPosition(int pos); @@ -657,6 +680,9 @@ class PositionsRecorder BASE_EMBEDDED { private: Assembler* assembler_; PositionState state_; +#ifdef ENABLE_GDB_JIT_INTERFACE + GDBJITLineInfo* gdbjit_lineinfo_; +#endif friend class PreservePositionScope; diff --git a/deps/v8/src/builtins.cc b/deps/v8/src/builtins.cc index a659c461c0..c4c9fc11c8 100644 --- a/deps/v8/src/builtins.cc +++ b/deps/v8/src/builtins.cc @@ -31,6 +31,7 @@ #include "arguments.h" #include "bootstrapper.h" #include "builtins.h" +#include "gdb-jit.h" #include "ic-inl.h" #include "vm-state-inl.h" @@ -1550,7 +1551,7 @@ void Builtins::Setup(bool create_heap_objects) { CodeDesc desc; masm.GetCode(&desc); Code::Flags flags = functions[i].flags; - Object* code = 0; + Object* code = NULL; { // During startup it's OK to always allocate and defer GC to later. // This simplifies things because we don't need to retry. @@ -1564,7 +1565,11 @@ void Builtins::Setup(bool create_heap_objects) { } // Log the event and add the code to the builtins array. PROFILE(CodeCreateEvent(Logger::BUILTIN_TAG, - Code::cast(code), functions[i].s_name)); + Code::cast(code), + functions[i].s_name)); + GDBJIT(AddCode(GDBJITInterface::BUILTIN, + functions[i].s_name, + Code::cast(code))); builtins_[i] = code; #ifdef ENABLE_DISASSEMBLER if (FLAG_print_builtin_code) { diff --git a/deps/v8/src/code-stubs.cc b/deps/v8/src/code-stubs.cc index ba027e9332..69f8477f89 100644 --- a/deps/v8/src/code-stubs.cc +++ b/deps/v8/src/code-stubs.cc @@ -30,6 +30,7 @@ #include "bootstrapper.h" #include "code-stubs.h" #include "factory.h" +#include "gdb-jit.h" #include "macro-assembler.h" #include "oprofile-agent.h" @@ -66,6 +67,7 @@ void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { code->instruction_start(), code->instruction_size())); PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, GetName())); + GDBJIT(AddCode(GDBJITInterface::STUB, GetName(), code)); Counters::total_stubs_code_size.Increment(code->instruction_size()); #ifdef ENABLE_DISASSEMBLER diff --git a/deps/v8/src/codegen.cc b/deps/v8/src/codegen.cc index da479e8fc1..c7e6f1c83f 100644 --- a/deps/v8/src/codegen.cc +++ b/deps/v8/src/codegen.cc @@ -248,6 +248,9 @@ bool CodeGenerator::MakeCode(CompilationInfo* info) { // Generate code. const int kInitialBufferSize = 4 * KB; MacroAssembler masm(NULL, kInitialBufferSize); +#ifdef ENABLE_GDB_JIT_INTERFACE + masm.positions_recorder()->StartGDBJITLineInfoRecording(); +#endif CodeGenerator cgen(&masm); CodeGeneratorScope scope(&cgen); cgen.Generate(info); @@ -263,6 +266,14 @@ bool CodeGenerator::MakeCode(CompilationInfo* info) { code->SetNoStackCheckTable(); CodeGenerator::PrintCode(code, info); info->SetCode(code); // May be an empty handle. +#ifdef ENABLE_GDB_JIT_INTERFACE + if (!code.is_null()) { + GDBJITLineInfo* lineinfo = + masm.positions_recorder()->DetachGDBJITLineInfo(); + + GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); + } +#endif return !code.is_null(); } diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index 0bd973045a..bbe7f2fc9c 100755 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -35,6 +35,7 @@ #include "data-flow.h" #include "debug.h" #include "full-codegen.h" +#include "gdb-jit.h" #include "hydrogen.h" #include "lithium-allocator.h" #include "liveedit.h" @@ -207,7 +208,8 @@ static bool MakeCrankshaftCode(CompilationInfo* info) { // Limit the number of times we re-compile a functions with // the optimizing compiler. - const int kMaxOptCount = FLAG_deopt_every_n_times == 0 ? 10 : 1000; + const int kMaxOptCount = + FLAG_deopt_every_n_times == 0 ? Compiler::kDefaultMaxOptCount : 1000; if (info->shared_info()->opt_count() > kMaxOptCount) { AbortAndDisable(info); // True indicates the compilation pipeline is still going, not @@ -420,6 +422,9 @@ static Handle MakeFunctionInfo(CompilationInfo* info) { OPROFILE(CreateNativeCodeRegion(String::cast(script->name()), info->code()->instruction_start(), info->code()->instruction_size())); + GDBJIT(AddCode(Handle(String::cast(script->name())), + script, + info->code())); } else { PROFILE(CodeCreateEvent( info->is_eval() @@ -430,6 +435,7 @@ static Handle MakeFunctionInfo(CompilationInfo* info) { OPROFILE(CreateNativeCodeRegion(info->is_eval() ? "Eval" : "Script", info->code()->instruction_start(), info->code()->instruction_size())); + GDBJIT(AddCode(Handle(), script, info->code())); } // Allocate function. @@ -793,6 +799,10 @@ void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, code->instruction_size())); } } + + GDBJIT(AddCode(name, + Handle