| Index: src/code-stubs.cc
|
| ===================================================================
|
| --- src/code-stubs.cc (revision 6800)
|
| +++ src/code-stubs.cc (working copy)
|
| @@ -30,8 +30,8 @@
|
| #include "bootstrapper.h"
|
| #include "code-stubs.h"
|
| #include "factory.h"
|
| +#include "gdb-jit.h"
|
| #include "macro-assembler.h"
|
| -#include "oprofile-agent.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -49,8 +49,10 @@
|
| void CodeStub::GenerateCode(MacroAssembler* masm) {
|
| // Update the static counter each time a new code stub is generated.
|
| Counters::code_stubs.Increment();
|
| +
|
| // Nested stubs are not allowed for leafs.
|
| - masm->set_allow_stub_calls(AllowsStubCalls());
|
| + AllowStubCallsScope allow_scope(masm, AllowsStubCalls());
|
| +
|
| // Generate the code for the stub.
|
| masm->set_generating_stub(true);
|
| Generate(masm);
|
| @@ -60,10 +62,8 @@
|
| void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) {
|
| code->set_major_key(MajorKey());
|
|
|
| - OPROFILE(CreateNativeCodeRegion(GetName(),
|
| - 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
|
| @@ -197,4 +197,34 @@
|
| }
|
|
|
|
|
| +const char* InstanceofStub::GetName() {
|
| + if (name_ != NULL) return name_;
|
| + const int kMaxNameLength = 100;
|
| + name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength);
|
| + if (name_ == NULL) return "OOM";
|
| +
|
| + const char* args = "";
|
| + if (HasArgsInRegisters()) {
|
| + args = "_REGS";
|
| + }
|
| +
|
| + const char* inline_check = "";
|
| + if (HasCallSiteInlineCheck()) {
|
| + inline_check = "_INLINE";
|
| + }
|
| +
|
| + const char* return_true_false_object = "";
|
| + if (ReturnTrueFalseObject()) {
|
| + return_true_false_object = "_TRUEFALSE";
|
| + }
|
| +
|
| + OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
|
| + "InstanceofStub%s%s%s",
|
| + args,
|
| + inline_check,
|
| + return_true_false_object);
|
| + return name_;
|
| +}
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|