OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 12 matching lines...) Expand all Loading... |
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-stubs.h" | 31 #include "code-stubs.h" |
32 #include "factory.h" | 32 #include "factory.h" |
| 33 #include "gdb-jit.h" |
33 #include "macro-assembler.h" | 34 #include "macro-assembler.h" |
34 #include "oprofile-agent.h" | 35 #include "oprofile-agent.h" |
35 | 36 |
36 namespace v8 { | 37 namespace v8 { |
37 namespace internal { | 38 namespace internal { |
38 | 39 |
39 bool CodeStub::FindCodeInCache(Code** code_out) { | 40 bool CodeStub::FindCodeInCache(Code** code_out) { |
40 int index = Heap::code_stubs()->FindEntry(GetKey()); | 41 int index = Heap::code_stubs()->FindEntry(GetKey()); |
41 if (index != NumberDictionary::kNotFound) { | 42 if (index != NumberDictionary::kNotFound) { |
42 *code_out = Code::cast(Heap::code_stubs()->ValueAt(index)); | 43 *code_out = Code::cast(Heap::code_stubs()->ValueAt(index)); |
(...skipping 16 matching lines...) Expand all Loading... |
59 } | 60 } |
60 | 61 |
61 | 62 |
62 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { | 63 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { |
63 code->set_major_key(MajorKey()); | 64 code->set_major_key(MajorKey()); |
64 | 65 |
65 OPROFILE(CreateNativeCodeRegion(GetName(), | 66 OPROFILE(CreateNativeCodeRegion(GetName(), |
66 code->instruction_start(), | 67 code->instruction_start(), |
67 code->instruction_size())); | 68 code->instruction_size())); |
68 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, GetName())); | 69 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, GetName())); |
| 70 GDBJIT(AddCode(GDBJITInterface::STUB, GetName(), code)); |
69 Counters::total_stubs_code_size.Increment(code->instruction_size()); | 71 Counters::total_stubs_code_size.Increment(code->instruction_size()); |
70 | 72 |
71 #ifdef ENABLE_DISASSEMBLER | 73 #ifdef ENABLE_DISASSEMBLER |
72 if (FLAG_print_code_stubs) { | 74 if (FLAG_print_code_stubs) { |
73 #ifdef DEBUG | 75 #ifdef DEBUG |
74 Print(); | 76 Print(); |
75 #endif | 77 #endif |
76 code->Disassemble(GetName()); | 78 code->Disassemble(GetName()); |
77 PrintF("\n"); | 79 PrintF("\n"); |
78 } | 80 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), | 225 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), |
224 "InstanceofStub%s%s%s", | 226 "InstanceofStub%s%s%s", |
225 args, | 227 args, |
226 inline_check, | 228 inline_check, |
227 return_true_false_object); | 229 return_true_false_object); |
228 return name_; | 230 return name_; |
229 } | 231 } |
230 | 232 |
231 | 233 |
232 } } // namespace v8::internal | 234 } } // namespace v8::internal |
OLD | NEW |