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

Side by Side Diff: src/mark-compact.cc

Issue 15691017: Make assertion scopes thread safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 // from a live map to a dead path and in case clear transitions of parent. 2471 // from a live map to a dead path and in case clear transitions of parent.
2472 bool current_is_alive = map_mark.Get(); 2472 bool current_is_alive = map_mark.Get();
2473 bool parent_is_alive = Marking::MarkBitFrom(parent).Get(); 2473 bool parent_is_alive = Marking::MarkBitFrom(parent).Get();
2474 if (!current_is_alive && parent_is_alive) { 2474 if (!current_is_alive && parent_is_alive) {
2475 parent->ClearNonLiveTransitions(heap()); 2475 parent->ClearNonLiveTransitions(heap());
2476 } 2476 }
2477 } 2477 }
2478 2478
2479 2479
2480 void MarkCompactCollector::ClearAndDeoptimizeDependentCode(Map* map) { 2480 void MarkCompactCollector::ClearAndDeoptimizeDependentCode(Map* map) {
2481 AssertNoAllocation no_allocation_scope; 2481 DisallowHeapAllocation no_allocation;
2482 DependentCode* entries = map->dependent_code(); 2482 DependentCode* entries = map->dependent_code();
2483 DependentCode::GroupStartIndexes starts(entries); 2483 DependentCode::GroupStartIndexes starts(entries);
2484 int number_of_entries = starts.number_of_entries(); 2484 int number_of_entries = starts.number_of_entries();
2485 if (number_of_entries == 0) return; 2485 if (number_of_entries == 0) return;
2486 for (int i = 0; i < number_of_entries; i++) { 2486 for (int i = 0; i < number_of_entries; i++) {
2487 Code* code = entries->code_at(i); 2487 Code* code = entries->code_at(i);
2488 if (IsMarked(code) && !code->marked_for_deoptimization()) { 2488 if (IsMarked(code) && !code->marked_for_deoptimization()) {
2489 code->set_marked_for_deoptimization(true); 2489 code->set_marked_for_deoptimization(true);
2490 } 2490 }
2491 entries->clear_code_at(i); 2491 entries->clear_code_at(i);
2492 } 2492 }
2493 map->set_dependent_code(DependentCode::cast(heap()->empty_fixed_array())); 2493 map->set_dependent_code(DependentCode::cast(heap()->empty_fixed_array()));
2494 } 2494 }
2495 2495
2496 2496
2497 void MarkCompactCollector::ClearNonLiveDependentCode(Map* map) { 2497 void MarkCompactCollector::ClearNonLiveDependentCode(Map* map) {
2498 AssertNoAllocation no_allocation_scope; 2498 DisallowHeapAllocation no_allocation;
2499 DependentCode* entries = map->dependent_code(); 2499 DependentCode* entries = map->dependent_code();
2500 DependentCode::GroupStartIndexes starts(entries); 2500 DependentCode::GroupStartIndexes starts(entries);
2501 int number_of_entries = starts.number_of_entries(); 2501 int number_of_entries = starts.number_of_entries();
2502 if (number_of_entries == 0) return; 2502 if (number_of_entries == 0) return;
2503 int new_number_of_entries = 0; 2503 int new_number_of_entries = 0;
2504 // Go through all groups, remove dead codes and compact. 2504 // Go through all groups, remove dead codes and compact.
2505 for (int g = 0; g < DependentCode::kGroupCount; g++) { 2505 for (int g = 0; g < DependentCode::kGroupCount; g++) {
2506 int group_number_of_entries = 0; 2506 int group_number_of_entries = 0;
2507 for (int i = starts.at(g); i < starts.at(g + 1); i++) { 2507 for (int i = starts.at(g); i < starts.at(g + 1); i++) {
2508 Code* code = entries->code_at(i); 2508 Code* code = entries->code_at(i);
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 while (buffer != NULL) { 4243 while (buffer != NULL) {
4244 SlotsBuffer* next_buffer = buffer->next(); 4244 SlotsBuffer* next_buffer = buffer->next();
4245 DeallocateBuffer(buffer); 4245 DeallocateBuffer(buffer);
4246 buffer = next_buffer; 4246 buffer = next_buffer;
4247 } 4247 }
4248 *buffer_address = NULL; 4248 *buffer_address = NULL;
4249 } 4249 }
4250 4250
4251 4251
4252 } } // namespace v8::internal 4252 } } // namespace v8::internal
OLDNEW
« src/api.cc ('K') | « src/log-utils.cc ('k') | src/marking-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698