OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 HeapIterator iterator; | 1306 HeapIterator iterator; |
1307 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 1307 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
1308 if (obj->IsCode()) LogCodeObject(obj); | 1308 if (obj->IsCode()) LogCodeObject(obj); |
1309 } | 1309 } |
1310 } | 1310 } |
1311 | 1311 |
1312 | 1312 |
1313 void Logger::LogCompiledFunctions() { | 1313 void Logger::LogCompiledFunctions() { |
1314 HandleScope scope; | 1314 HandleScope scope; |
1315 const int compiled_funcs_count = EnumerateCompiledFunctions(NULL); | 1315 const int compiled_funcs_count = EnumerateCompiledFunctions(NULL); |
1316 Handle<SharedFunctionInfo>* sfis = | 1316 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); |
1317 NewArray< Handle<SharedFunctionInfo> >(compiled_funcs_count); | 1317 EnumerateCompiledFunctions(sfis.start()); |
1318 EnumerateCompiledFunctions(sfis); | |
1319 | 1318 |
1320 // During iteration, there can be heap allocation due to | 1319 // During iteration, there can be heap allocation due to |
1321 // GetScriptLineNumber call. | 1320 // GetScriptLineNumber call. |
1322 for (int i = 0; i < compiled_funcs_count; ++i) { | 1321 for (int i = 0; i < compiled_funcs_count; ++i) { |
1323 Handle<SharedFunctionInfo> shared = sfis[i]; | 1322 Handle<SharedFunctionInfo> shared = sfis[i]; |
1324 Handle<String> name(String::cast(shared->name())); | 1323 Handle<String> name(String::cast(shared->name())); |
1325 Handle<String> func_name(name->length() > 0 ? | 1324 Handle<String> func_name(name->length() > 0 ? |
1326 *name : shared->inferred_name()); | 1325 *name : shared->inferred_name()); |
1327 if (shared->script()->IsScript()) { | 1326 if (shared->script()->IsScript()) { |
1328 Handle<Script> script(Script::cast(shared->script())); | 1327 Handle<Script> script(Script::cast(shared->script())); |
(...skipping 24 matching lines...) Expand all Loading... |
1353 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); | 1352 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); |
1354 Object* callback_obj = call_data->callback(); | 1353 Object* callback_obj = call_data->callback(); |
1355 Address entry_point = v8::ToCData<Address>(callback_obj); | 1354 Address entry_point = v8::ToCData<Address>(callback_obj); |
1356 PROFILE(CallbackEvent(*func_name, entry_point)); | 1355 PROFILE(CallbackEvent(*func_name, entry_point)); |
1357 } | 1356 } |
1358 } else { | 1357 } else { |
1359 PROFILE(CodeCreateEvent( | 1358 PROFILE(CodeCreateEvent( |
1360 Logger::LAZY_COMPILE_TAG, shared->code(), *func_name)); | 1359 Logger::LAZY_COMPILE_TAG, shared->code(), *func_name)); |
1361 } | 1360 } |
1362 } | 1361 } |
1363 | |
1364 DeleteArray(sfis); | |
1365 } | 1362 } |
1366 | 1363 |
1367 | 1364 |
1368 void Logger::LogFunctionObjects() { | 1365 void Logger::LogFunctionObjects() { |
1369 AssertNoAllocation no_alloc; | 1366 AssertNoAllocation no_alloc; |
1370 HeapIterator iterator; | 1367 HeapIterator iterator; |
1371 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 1368 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
1372 if (!obj->IsJSFunction()) continue; | 1369 if (!obj->IsJSFunction()) continue; |
1373 JSFunction* jsf = JSFunction::cast(obj); | 1370 JSFunction* jsf = JSFunction::cast(obj); |
1374 if (!jsf->is_compiled()) continue; | 1371 if (!jsf->is_compiled()) continue; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 } | 1548 } |
1552 // Otherwise, if the sliding state window computation has not been | 1549 // Otherwise, if the sliding state window computation has not been |
1553 // started we do it now. | 1550 // started we do it now. |
1554 if (sliding_state_window_ == NULL) { | 1551 if (sliding_state_window_ == NULL) { |
1555 sliding_state_window_ = new SlidingStateWindow(); | 1552 sliding_state_window_ = new SlidingStateWindow(); |
1556 } | 1553 } |
1557 #endif | 1554 #endif |
1558 } | 1555 } |
1559 | 1556 |
1560 } } // namespace v8::internal | 1557 } } // namespace v8::internal |
OLD | NEW |