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

Side by Side Diff: src/log.cc

Issue 555072: Merge ObjectIterator::has_next and ObjectIterator::next methods.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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/heap-profiler.cc ('k') | src/mark-compact.cc » ('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 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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1230
1231 int Logger::GetLogLines(int from_pos, char* dest_buf, int max_size) { 1231 int Logger::GetLogLines(int from_pos, char* dest_buf, int max_size) {
1232 return Log::GetLogLines(from_pos, dest_buf, max_size); 1232 return Log::GetLogLines(from_pos, dest_buf, max_size);
1233 } 1233 }
1234 1234
1235 1235
1236 static int EnumerateCompiledFunctions(Handle<SharedFunctionInfo>* sfis) { 1236 static int EnumerateCompiledFunctions(Handle<SharedFunctionInfo>* sfis) {
1237 AssertNoAllocation no_alloc; 1237 AssertNoAllocation no_alloc;
1238 int compiled_funcs_count = 0; 1238 int compiled_funcs_count = 0;
1239 HeapIterator iterator; 1239 HeapIterator iterator;
1240 while (iterator.has_next()) { 1240 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1241 HeapObject* obj = iterator.next();
1242 ASSERT(obj != NULL);
1243 if (!obj->IsSharedFunctionInfo()) continue; 1241 if (!obj->IsSharedFunctionInfo()) continue;
1244 SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); 1242 SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj);
1245 if (sfi->is_compiled() 1243 if (sfi->is_compiled()
1246 && (!sfi->script()->IsScript() 1244 && (!sfi->script()->IsScript()
1247 || Script::cast(sfi->script())->HasValidSource())) { 1245 || Script::cast(sfi->script())->HasValidSource())) {
1248 if (sfis != NULL) 1246 if (sfis != NULL)
1249 sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi); 1247 sfis[compiled_funcs_count] = Handle<SharedFunctionInfo>(sfi);
1250 ++compiled_funcs_count; 1248 ++compiled_funcs_count;
1251 } 1249 }
1252 } 1250 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 } 1343 }
1346 } 1344 }
1347 1345
1348 DeleteArray(sfis); 1346 DeleteArray(sfis);
1349 } 1347 }
1350 1348
1351 1349
1352 void Logger::LogFunctionObjects() { 1350 void Logger::LogFunctionObjects() {
1353 AssertNoAllocation no_alloc; 1351 AssertNoAllocation no_alloc;
1354 HeapIterator iterator; 1352 HeapIterator iterator;
1355 while (iterator.has_next()) { 1353 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1356 HeapObject* obj = iterator.next();
1357 ASSERT(obj != NULL);
1358 if (!obj->IsJSFunction()) continue; 1354 if (!obj->IsJSFunction()) continue;
1359 JSFunction* jsf = JSFunction::cast(obj); 1355 JSFunction* jsf = JSFunction::cast(obj);
1360 if (!jsf->is_compiled()) continue; 1356 if (!jsf->is_compiled()) continue;
1361 LOG(FunctionCreateEvent(jsf)); 1357 LOG(FunctionCreateEvent(jsf));
1362 } 1358 }
1363 } 1359 }
1364 1360
1365 1361
1366 void Logger::LogAccessorCallbacks() { 1362 void Logger::LogAccessorCallbacks() {
1367 AssertNoAllocation no_alloc; 1363 AssertNoAllocation no_alloc;
1368 HeapIterator iterator; 1364 HeapIterator iterator;
1369 while (iterator.has_next()) { 1365 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1370 HeapObject* obj = iterator.next();
1371 ASSERT(obj != NULL);
1372 if (!obj->IsAccessorInfo()) continue; 1366 if (!obj->IsAccessorInfo()) continue;
1373 AccessorInfo* ai = AccessorInfo::cast(obj); 1367 AccessorInfo* ai = AccessorInfo::cast(obj);
1374 if (!ai->name()->IsString()) continue; 1368 if (!ai->name()->IsString()) continue;
1375 String* name = String::cast(ai->name()); 1369 String* name = String::cast(ai->name());
1376 Address getter_entry = v8::ToCData<Address>(ai->getter()); 1370 Address getter_entry = v8::ToCData<Address>(ai->getter());
1377 if (getter_entry != 0) { 1371 if (getter_entry != 0) {
1378 LOG(GetterCallbackEvent(name, getter_entry)); 1372 LOG(GetterCallbackEvent(name, getter_entry));
1379 } 1373 }
1380 Address setter_entry = v8::ToCData<Address>(ai->setter()); 1374 Address setter_entry = v8::ToCData<Address>(ai->setter());
1381 if (setter_entry != 0) { 1375 if (setter_entry != 0) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 // Otherwise, if the sliding state window computation has not been 1532 // Otherwise, if the sliding state window computation has not been
1539 // started we do it now. 1533 // started we do it now.
1540 if (sliding_state_window_ == NULL) { 1534 if (sliding_state_window_ == NULL) {
1541 sliding_state_window_ = new SlidingStateWindow(); 1535 sliding_state_window_ = new SlidingStateWindow();
1542 } 1536 }
1543 #endif 1537 #endif
1544 } 1538 }
1545 1539
1546 1540
1547 } } // namespace v8::internal 1541 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap-profiler.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698