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

Side by Side Diff: src/cpu-profiler.cc

Issue 6683022: [Isolates] Merge 7111:7152 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 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
« no previous file with comments | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 String* name, 63 String* name,
64 Address start) { 64 Address start) {
65 if (FilterOutCodeCreateEvent(tag)) return; 65 if (FilterOutCodeCreateEvent(tag)) return;
66 CodeEventsContainer evt_rec; 66 CodeEventsContainer evt_rec;
67 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 67 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
68 rec->type = CodeEventRecord::CODE_CREATION; 68 rec->type = CodeEventRecord::CODE_CREATION;
69 rec->order = ++enqueue_order_; 69 rec->order = ++enqueue_order_;
70 rec->start = start; 70 rec->start = start;
71 rec->entry = generator_->NewCodeEntry(tag, prefix, name); 71 rec->entry = generator_->NewCodeEntry(tag, prefix, name);
72 rec->size = 1; 72 rec->size = 1;
73 rec->sfi_address = NULL; 73 rec->shared = NULL;
74 events_buffer_.Enqueue(evt_rec); 74 events_buffer_.Enqueue(evt_rec);
75 } 75 }
76 76
77 77
78 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, 78 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
79 String* name, 79 String* name,
80 String* resource_name, 80 String* resource_name,
81 int line_number, 81 int line_number,
82 Address start, 82 Address start,
83 unsigned size, 83 unsigned size,
84 Address sfi_address) { 84 Address shared) {
85 if (FilterOutCodeCreateEvent(tag)) return; 85 if (FilterOutCodeCreateEvent(tag)) return;
86 CodeEventsContainer evt_rec; 86 CodeEventsContainer evt_rec;
87 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 87 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
88 rec->type = CodeEventRecord::CODE_CREATION; 88 rec->type = CodeEventRecord::CODE_CREATION;
89 rec->order = ++enqueue_order_; 89 rec->order = ++enqueue_order_;
90 rec->start = start; 90 rec->start = start;
91 rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number); 91 rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number);
92 rec->size = size; 92 rec->size = size;
93 rec->sfi_address = sfi_address; 93 rec->shared = shared;
94 events_buffer_.Enqueue(evt_rec); 94 events_buffer_.Enqueue(evt_rec);
95 } 95 }
96 96
97 97
98 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, 98 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
99 const char* name, 99 const char* name,
100 Address start, 100 Address start,
101 unsigned size) { 101 unsigned size) {
102 if (FilterOutCodeCreateEvent(tag)) return; 102 if (FilterOutCodeCreateEvent(tag)) return;
103 CodeEventsContainer evt_rec; 103 CodeEventsContainer evt_rec;
104 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 104 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
105 rec->type = CodeEventRecord::CODE_CREATION; 105 rec->type = CodeEventRecord::CODE_CREATION;
106 rec->order = ++enqueue_order_; 106 rec->order = ++enqueue_order_;
107 rec->start = start; 107 rec->start = start;
108 rec->entry = generator_->NewCodeEntry(tag, name); 108 rec->entry = generator_->NewCodeEntry(tag, name);
109 rec->size = size; 109 rec->size = size;
110 rec->sfi_address = NULL; 110 rec->shared = NULL;
111 events_buffer_.Enqueue(evt_rec); 111 events_buffer_.Enqueue(evt_rec);
112 } 112 }
113 113
114 114
115 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, 115 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
116 int args_count, 116 int args_count,
117 Address start, 117 Address start,
118 unsigned size) { 118 unsigned size) {
119 if (FilterOutCodeCreateEvent(tag)) return; 119 if (FilterOutCodeCreateEvent(tag)) return;
120 CodeEventsContainer evt_rec; 120 CodeEventsContainer evt_rec;
121 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; 121 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
122 rec->type = CodeEventRecord::CODE_CREATION; 122 rec->type = CodeEventRecord::CODE_CREATION;
123 rec->order = ++enqueue_order_; 123 rec->order = ++enqueue_order_;
124 rec->start = start; 124 rec->start = start;
125 rec->entry = generator_->NewCodeEntry(tag, args_count); 125 rec->entry = generator_->NewCodeEntry(tag, args_count);
126 rec->size = size; 126 rec->size = size;
127 rec->sfi_address = NULL; 127 rec->shared = NULL;
128 events_buffer_.Enqueue(evt_rec); 128 events_buffer_.Enqueue(evt_rec);
129 } 129 }
130 130
131 131
132 void ProfilerEventsProcessor::CodeMoveEvent(Address from, Address to) { 132 void ProfilerEventsProcessor::CodeMoveEvent(Address from, Address to) {
133 CodeEventsContainer evt_rec; 133 CodeEventsContainer evt_rec;
134 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_; 134 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_;
135 rec->type = CodeEventRecord::CODE_MOVE; 135 rec->type = CodeEventRecord::CODE_MOVE;
136 rec->order = ++enqueue_order_; 136 rec->order = ++enqueue_order_;
137 rec->from = from; 137 rec->from = from;
138 rec->to = to; 138 rec->to = to;
139 events_buffer_.Enqueue(evt_rec); 139 events_buffer_.Enqueue(evt_rec);
140 } 140 }
141 141
142 142
143 void ProfilerEventsProcessor::CodeDeleteEvent(Address from) { 143 void ProfilerEventsProcessor::CodeDeleteEvent(Address from) {
144 CodeEventsContainer evt_rec; 144 CodeEventsContainer evt_rec;
145 CodeDeleteEventRecord* rec = &evt_rec.CodeDeleteEventRecord_; 145 CodeDeleteEventRecord* rec = &evt_rec.CodeDeleteEventRecord_;
146 rec->type = CodeEventRecord::CODE_DELETE; 146 rec->type = CodeEventRecord::CODE_DELETE;
147 rec->order = ++enqueue_order_; 147 rec->order = ++enqueue_order_;
148 rec->start = from; 148 rec->start = from;
149 events_buffer_.Enqueue(evt_rec); 149 events_buffer_.Enqueue(evt_rec);
150 } 150 }
151 151
152 152
153 void ProfilerEventsProcessor::SFIMoveEvent(Address from, Address to) { 153 void ProfilerEventsProcessor::SharedFunctionInfoMoveEvent(Address from,
154 Address to) {
154 CodeEventsContainer evt_rec; 155 CodeEventsContainer evt_rec;
155 SFIMoveEventRecord* rec = &evt_rec.SFIMoveEventRecord_; 156 SharedFunctionInfoMoveEventRecord* rec =
156 rec->type = CodeEventRecord::SFI_MOVE; 157 &evt_rec.SharedFunctionInfoMoveEventRecord_;
158 rec->type = CodeEventRecord::SHARED_FUNC_MOVE;
157 rec->order = ++enqueue_order_; 159 rec->order = ++enqueue_order_;
158 rec->from = from; 160 rec->from = from;
159 rec->to = to; 161 rec->to = to;
160 events_buffer_.Enqueue(evt_rec); 162 events_buffer_.Enqueue(evt_rec);
161 } 163 }
162 164
163 165
164 void ProfilerEventsProcessor::RegExpCodeCreateEvent( 166 void ProfilerEventsProcessor::RegExpCodeCreateEvent(
165 Logger::LogEventsAndTags tag, 167 Logger::LogEventsAndTags tag,
166 const char* prefix, 168 const char* prefix,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 void CpuProfiler::CodeMoveEvent(Address from, Address to) { 400 void CpuProfiler::CodeMoveEvent(Address from, Address to) {
399 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to); 401 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to);
400 } 402 }
401 403
402 404
403 void CpuProfiler::CodeDeleteEvent(Address from) { 405 void CpuProfiler::CodeDeleteEvent(Address from) {
404 Isolate::Current()->cpu_profiler()->processor_->CodeDeleteEvent(from); 406 Isolate::Current()->cpu_profiler()->processor_->CodeDeleteEvent(from);
405 } 407 }
406 408
407 409
408 void CpuProfiler::SFIMoveEvent(Address from, Address to) { 410 void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) {
409 CpuProfiler* profiler = Isolate::Current()->cpu_profiler(); 411 CpuProfiler* profiler = Isolate::Current()->cpu_profiler();
410 profiler->processor_->SFIMoveEvent(from, to); 412 profiler->processor_->SharedFunctionInfoMoveEvent(from, to);
411 } 413 }
412 414
413 415
414 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) { 416 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) {
415 Isolate::Current()->cpu_profiler()->processor_->CallbackCreateEvent( 417 Isolate::Current()->cpu_profiler()->processor_->CallbackCreateEvent(
416 Logger::CALLBACK_TAG, "get ", name, entry_point); 418 Logger::CALLBACK_TAG, "get ", name, entry_point);
417 } 419 }
418 420
419 421
420 void CpuProfiler::RegExpCodeCreateEvent(Code* code, String* source) { 422 void CpuProfiler::RegExpCodeCreateEvent(Code* code, String* source) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 #ifdef ENABLE_LOGGING_AND_PROFILING 553 #ifdef ENABLE_LOGGING_AND_PROFILING
552 Isolate* isolate = Isolate::Current(); 554 Isolate* isolate = Isolate::Current();
553 if (isolate->cpu_profiler() != NULL) { 555 if (isolate->cpu_profiler() != NULL) {
554 delete isolate->cpu_profiler(); 556 delete isolate->cpu_profiler();
555 } 557 }
556 isolate->set_cpu_profiler(NULL); 558 isolate->set_cpu_profiler(NULL);
557 #endif 559 #endif
558 } 560 }
559 561
560 } } // namespace v8::internal 562 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698