Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: src/code-stubs.cc

Issue 10795074: Add a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ready for review Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 10 matching lines...) Expand all
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "bootstrapper.h" 30 #include "bootstrapper.h"
31 #include "code-events.h"
31 #include "code-stubs.h" 32 #include "code-stubs.h"
32 #include "stub-cache.h" 33 #include "stub-cache.h"
33 #include "factory.h" 34 #include "factory.h"
34 #include "gdb-jit.h"
35 #include "macro-assembler.h" 35 #include "macro-assembler.h"
36 36
37 namespace v8 { 37 namespace v8 {
38 namespace internal { 38 namespace internal {
39 39
40 bool CodeStub::FindCodeInCache(Code** code_out) { 40 bool CodeStub::FindCodeInCache(Code** code_out) {
41 Heap* heap = Isolate::Current()->heap(); 41 Heap* heap = Isolate::Current()->heap();
42 int index = heap->code_stubs()->FindEntry(GetKey()); 42 int index = heap->code_stubs()->FindEntry(GetKey());
43 if (index != UnseededNumberDictionary::kNotFound) { 43 if (index != UnseededNumberDictionary::kNotFound) {
44 *code_out = Code::cast(heap->code_stubs()->ValueAt(index)); 44 *code_out = Code::cast(heap->code_stubs()->ValueAt(index));
(...skipping 24 matching lines...) Expand all
69 StringStream stream(&allocator); 69 StringStream stream(&allocator);
70 PrintName(&stream); 70 PrintName(&stream);
71 return stream.ToCString(); 71 return stream.ToCString();
72 } 72 }
73 73
74 74
75 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { 75 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) {
76 Isolate* isolate = masm->isolate(); 76 Isolate* isolate = masm->isolate();
77 SmartArrayPointer<const char> name = GetName(); 77 SmartArrayPointer<const char> name = GetName();
78 PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, code, *name)); 78 PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, code, *name));
79 GDBJIT(AddCode(GDBJITInterface::STUB, *name, code)); 79 JIT_CODE_EVENT(AddCode(*name, code));
80 Counters* counters = isolate->counters(); 80 Counters* counters = isolate->counters();
81 counters->total_stubs_code_size()->Increment(code->instruction_size()); 81 counters->total_stubs_code_size()->Increment(code->instruction_size());
82 } 82 }
83 83
84 84
85 int CodeStub::GetCodeKind() { 85 int CodeStub::GetCodeKind() {
86 return Code::STUB; 86 return Code::STUB;
87 } 87 }
88 88
89 89
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // already active, as the hooks won't stack. 486 // already active, as the hooks won't stack.
487 if (entry_hook != 0 && entry_hook_ != 0) 487 if (entry_hook != 0 && entry_hook_ != 0)
488 return false; 488 return false;
489 489
490 entry_hook_ = entry_hook; 490 entry_hook_ = entry_hook;
491 return true; 491 return true;
492 } 492 }
493 493
494 494
495 } } // namespace v8::internal 495 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698