| OLD | NEW |
| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 char* temp_method_name = | 185 char* temp_method_name = |
| 186 GetFunctionNameFromMixedName(event->name.str, | 186 GetFunctionNameFromMixedName(event->name.str, |
| 187 static_cast<int>(event->name.len)); | 187 static_cast<int>(event->name.len)); |
| 188 iJIT_Method_Load jmethod; | 188 iJIT_Method_Load jmethod; |
| 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<UnboundScript> script = event->script; | 195 Local<UnboundScript> 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->GetScriptName())->IsString()) { |
| 200 Handle<String> script_name = script->GetScriptName()->ToString(); | 200 Local<String> script_name = |
| 201 Local<String>::Cast(script->GetScriptName()); |
| 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 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 272 |
| 272 } // namespace internal | 273 } // namespace internal |
| 273 | 274 |
| 274 v8::JitCodeEventHandler GetVtuneCodeEventHandler() { | 275 v8::JitCodeEventHandler GetVtuneCodeEventHandler() { |
| 275 v8::V8::SetFlagsFromString("--nocompact_code_space", | 276 v8::V8::SetFlagsFromString("--nocompact_code_space", |
| 276 (int)strlen("--nocompact_code_space")); | 277 (int)strlen("--nocompact_code_space")); |
| 277 return vTune::internal::VTUNEJITInterface::event_handler; | 278 return vTune::internal::VTUNEJITInterface::event_handler; |
| 278 } | 279 } |
| 279 | 280 |
| 280 } // namespace vTune | 281 } // namespace vTune |
| OLD | NEW |