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

Side by Side Diff: test/cctest/test-api.cc

Issue 10918096: Loosen up code logging test that was sensitive to GC timing. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 3 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 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 11109 matching lines...) Expand 10 before | Expand all | Expand 10 after
11120 true); 11120 true);
11121 entry->value = reinterpret_cast<void*>(event->code_len); 11121 entry->value = reinterpret_cast<void*>(event->code_len);
11122 11122
11123 if (FunctionNameIs("bar", event)) { 11123 if (FunctionNameIs("bar", event)) {
11124 ++saw_bar; 11124 ++saw_bar;
11125 } 11125 }
11126 } 11126 }
11127 break; 11127 break;
11128 11128
11129 case v8::JitCodeEvent::CODE_MOVED: { 11129 case v8::JitCodeEvent::CODE_MOVED: {
11130 ++move_events;
11131
11132 uint32_t hash = i::ComputePointerHash(event->code_start); 11130 uint32_t hash = i::ComputePointerHash(event->code_start);
11133 // We should never see code move that we haven't seen before. 11131 // We would like to never see code move that we haven't seen before,
11132 // but the code creation event does not happen until the line endings
11133 // have been calculated (this is so that we can report the line in the
11134 // script at which the function source is found, see
11135 // Compiler::RecordFunctionCompilation) and the line endings
11136 // calculations can cause a GC, which can move the newly created code
11137 // before its existence can be logged.
11134 i::HashMap::Entry* entry = 11138 i::HashMap::Entry* entry =
11135 code_map->Lookup(event->code_start, hash, false); 11139 code_map->Lookup(event->code_start, hash, false);
11136 CHECK(entry != NULL); 11140 if (entry != NULL) {
11137 CHECK_EQ(reinterpret_cast<void*>(event->code_len), entry->value); 11141 ++move_events;
11138 code_map->Remove(event->code_start, hash);
11139 11142
11140 entry = code_map->Lookup(event->new_code_start, 11143 CHECK_EQ(reinterpret_cast<void*>(event->code_len), entry->value);
11141 i::ComputePointerHash(event->new_code_start), 11144 code_map->Remove(event->code_start, hash);
11142 true); 11145
11143 CHECK(entry != NULL); 11146 entry = code_map->Lookup(event->new_code_start,
11144 entry->value = reinterpret_cast<void*>(event->code_len); 11147 i::ComputePointerHash(event->new_code_start),
11148 true);
11149 CHECK(entry != NULL);
11150 entry->value = reinterpret_cast<void*>(event->code_len);
11151 }
11145 } 11152 }
11146 break; 11153 break;
11147 11154
11148 case v8::JitCodeEvent::CODE_REMOVED: 11155 case v8::JitCodeEvent::CODE_REMOVED:
11149 // Object/code removal events are currently not dispatched from the GC. 11156 // Object/code removal events are currently not dispatched from the GC.
11150 CHECK(false); 11157 CHECK(false);
11151 break; 11158 break;
11152 default: 11159 default:
11153 // Impossible event. 11160 // Impossible event.
11154 CHECK(false); 11161 CHECK(false);
(...skipping 6282 matching lines...) Expand 10 before | Expand all | Expand 10 after
17437 17444
17438 i::Semaphore* sem_; 17445 i::Semaphore* sem_;
17439 volatile int sem_value_; 17446 volatile int sem_value_;
17440 }; 17447 };
17441 17448
17442 17449
17443 THREADED_TEST(SemaphoreInterruption) { 17450 THREADED_TEST(SemaphoreInterruption) {
17444 ThreadInterruptTest().RunTest(); 17451 ThreadInterruptTest().RunTest();
17445 } 17452 }
17446 #endif // WIN32 17453 #endif // WIN32
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