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

Side by Side Diff: src/third_party/vtune/vtune-jit.cc

Issue 254793002: Unbreak vtunejit=on. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 This file is provided under a dual BSD/GPLv2 license. When using or 2 This file is provided under a dual BSD/GPLv2 license. When using or
3 redistributing this file, you may do so under either license. 3 redistributing this file, you may do so under either license.
4 4
5 GPL LICENSE SUMMARY 5 GPL LICENSE SUMMARY
6 6
7 Copyright(c) 2005-2012 Intel Corporation. All rights reserved. 7 Copyright(c) 2005-2012 Intel Corporation. All rights reserved.
8 8
9 This program is free software; you can redistribute it and/or modify 9 This program is free software; you can redistribute it and/or modify
10 it under the terms of version 2 of the GNU General Public License as 10 it under the terms of version 2 of the GNU General Public License as
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 memset(&jmethod, 0, sizeof jmethod); 189 memset(&jmethod, 0, sizeof jmethod);
190 jmethod.method_id = iJIT_GetNewMethodID(); 190 jmethod.method_id = iJIT_GetNewMethodID();
191 jmethod.method_load_address = event->code_start; 191 jmethod.method_load_address = event->code_start;
192 jmethod.method_size = static_cast<unsigned int>(event->code_len); 192 jmethod.method_size = static_cast<unsigned int>(event->code_len);
193 jmethod.method_name = temp_method_name; 193 jmethod.method_name = temp_method_name;
194 194
195 Handle<Script> script = event->script; 195 Handle<Script> script = event->script;
196 196
197 if (*script != NULL) { 197 if (*script != NULL) {
198 // Get the source file name and set it to jmethod.source_file_name 198 // Get the source file name and set it to jmethod.source_file_name
199 if ((*script->GetScriptName())->IsString()) { 199 if ((*script->GetUnboundScript()->GetScriptName())->IsString()) {
200 Handle<String> script_name = script->GetScriptName()->ToString(); 200 Handle<String> script_name =
201 script->GetUnboundScript()->GetScriptName()->ToString();
201 temp_file_name = new char[script_name->Utf8Length() + 1]; 202 temp_file_name = new char[script_name->Utf8Length() + 1];
202 script_name->WriteUtf8(temp_file_name); 203 script_name->WriteUtf8(temp_file_name);
203 jmethod.source_file_name = temp_file_name; 204 jmethod.source_file_name = temp_file_name;
204 } 205 }
205 206
206 JitInfoMap::iterator entry = 207 JitInfoMap::iterator entry =
207 GetEntries()->find(event->code_start); 208 GetEntries()->find(event->code_start);
208 if (entry != GetEntries()->end() && IsLineInfoTagged(entry->first)) { 209 if (entry != GetEntries()->end() && IsLineInfoTagged(entry->first)) {
209 JITCodeLineInfo* line_info = UntagLineInfo(entry->second); 210 JITCodeLineInfo* line_info = UntagLineInfo(entry->second);
210 // Get the line_num_info and set it to jmethod.line_number_table 211 // Get the line_num_info and set it to jmethod.line_number_table
211 std::list<JITCodeLineInfo::LineNumInfo>* vtunelineinfo = 212 std::list<JITCodeLineInfo::LineNumInfo>* vtunelineinfo =
212 line_info->GetLineNumInfo(); 213 line_info->GetLineNumInfo();
213 214
214 jmethod.line_number_size = (unsigned int)vtunelineinfo->size(); 215 jmethod.line_number_size = (unsigned int)vtunelineinfo->size();
215 jmethod.line_number_table = 216 jmethod.line_number_table =
216 reinterpret_cast<LineNumberInfo*>( 217 reinterpret_cast<LineNumberInfo*>(
217 malloc(sizeof(LineNumberInfo)*jmethod.line_number_size)); 218 malloc(sizeof(LineNumberInfo)*jmethod.line_number_size));
218 219
219 std::list<JITCodeLineInfo::LineNumInfo>::iterator Iter; 220 std::list<JITCodeLineInfo::LineNumInfo>::iterator Iter;
220 int index = 0; 221 int index = 0;
221 for (Iter = vtunelineinfo->begin(); 222 for (Iter = vtunelineinfo->begin();
222 Iter != vtunelineinfo->end(); 223 Iter != vtunelineinfo->end();
223 Iter++) { 224 Iter++) {
224 jmethod.line_number_table[index].Offset = 225 jmethod.line_number_table[index].Offset =
225 static_cast<unsigned int>(Iter->pc_); 226 static_cast<unsigned int>(Iter->pc_);
226 jmethod.line_number_table[index++].LineNumber = 227 jmethod.line_number_table[index++].LineNumber =
227 » » » » script->GetLineNumber(Iter->pos_)+1; 228 script->GetUnboundScript()->GetLineNumber(Iter->pos_)+1;
228 } 229 }
229 GetEntries()->erase(event->code_start); 230 GetEntries()->erase(event->code_start);
230 } 231 }
231 } 232 }
232 233
233 iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, 234 iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED,
234 reinterpret_cast<void*>(&jmethod)); 235 reinterpret_cast<void*>(&jmethod));
235 if (temp_method_name) 236 if (temp_method_name)
236 delete []temp_method_name; 237 delete []temp_method_name;
237 if (temp_file_name) 238 if (temp_file_name)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 void InitializeVtuneForV8() { 275 void InitializeVtuneForV8() {
275 if (v8::V8::Initialize()) { 276 if (v8::V8::Initialize()) {
276 v8::V8::SetFlagsFromString("--nocompact_code_space", 277 v8::V8::SetFlagsFromString("--nocompact_code_space",
277 (int)strlen("--nocompact_code_space")); 278 (int)strlen("--nocompact_code_space"));
278 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault, 279 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault,
279 vTune::internal::VTUNEJITInterface::event_handler); 280 vTune::internal::VTUNEJITInterface::event_handler);
280 } 281 }
281 } 282 }
282 283
283 } // namespace vTune 284 } // namespace vTune
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698