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

Side by Side Diff: src/objects.cc

Issue 12315077: Zap holes in dependent code array after deoptimizing a code group. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 9583 matching lines...) Expand 10 before | Expand all | Expand 10 after
9594 AssertNoAllocation no_allocation_scope; 9594 AssertNoAllocation no_allocation_scope;
9595 DependentCode::GroupStartIndexes starts(this); 9595 DependentCode::GroupStartIndexes starts(this);
9596 int start = starts.at(group); 9596 int start = starts.at(group);
9597 int end = starts.at(group + 1); 9597 int end = starts.at(group + 1);
9598 int number_of_entries = starts.at(DependentCode::kGroupCount); 9598 int number_of_entries = starts.at(DependentCode::kGroupCount);
9599 if (start == end) return; 9599 if (start == end) return;
9600 for (int i = start; i < end; i++) { 9600 for (int i = start; i < end; i++) {
9601 Code* code = code_at(i); 9601 Code* code = code_at(i);
9602 code->set_marked_for_deoptimization(true); 9602 code->set_marked_for_deoptimization(true);
9603 } 9603 }
9604 // Compact the array by moving all subsequent groups to fill in the new holes.
9604 for (int src = end, dst = start; src < number_of_entries; src++, dst++) { 9605 for (int src = end, dst = start; src < number_of_entries; src++, dst++) {
9605 set_code_at(dst, code_at(src)); 9606 set_code_at(dst, code_at(src));
9606 } 9607 }
9608 // Now the holes are at the end of the array, zap them.
Michael Starzinger 2013/02/25 12:18:22 Maybe we should add a comment saying that this is
9609 int removed = end - start;
9610 for (int i = number_of_entries - removed; i < number_of_entries; i++) {
9611 clear_code_at(i);
9612 }
9607 set_number_of_entries(group, 0); 9613 set_number_of_entries(group, 0);
9608 DeoptimizeDependentCodeFilter filter; 9614 DeoptimizeDependentCodeFilter filter;
9609 Deoptimizer::DeoptimizeAllFunctionsWith(&filter); 9615 Deoptimizer::DeoptimizeAllFunctionsWith(&filter);
9610 } 9616 }
9611 9617
9612 9618
9613 MaybeObject* JSReceiver::SetPrototype(Object* value, 9619 MaybeObject* JSReceiver::SetPrototype(Object* value,
9614 bool skip_hidden_prototypes) { 9620 bool skip_hidden_prototypes) {
9615 #ifdef DEBUG 9621 #ifdef DEBUG
9616 int size = Size(); 9622 int size = Size();
(...skipping 4367 matching lines...) Expand 10 before | Expand all | Expand 10 after
13984 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13990 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13985 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13991 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13986 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13992 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13987 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13993 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13988 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13994 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13989 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13995 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13990 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13996 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13991 } 13997 }
13992 13998
13993 } } // namespace v8::internal 13999 } } // namespace v8::internal
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