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

Side by Side Diff: src/objects.cc

Issue 12094036: Fix clearing of dead dependent codes and verify weak embedded maps on full GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 9190 matching lines...) Expand 10 before | Expand all | Expand 10 after
9201 #endif 9201 #endif
9202 } 9202 }
9203 9203
9204 PrintF("RelocInfo (size = %d)\n", relocation_size()); 9204 PrintF("RelocInfo (size = %d)\n", relocation_size());
9205 for (RelocIterator it(this); !it.done(); it.next()) it.rinfo()->Print(out); 9205 for (RelocIterator it(this); !it.done(); it.next()) it.rinfo()->Print(out);
9206 PrintF(out, "\n"); 9206 PrintF(out, "\n");
9207 } 9207 }
9208 #endif // ENABLE_DISASSEMBLER 9208 #endif // ENABLE_DISASSEMBLER
9209 9209
9210 9210
9211 #ifdef VERIFY_HEAP
9212 void Code::VerifyEmbeddedMaps() {
Michael Starzinger 2013/01/31 14:27:50 This whole implementation belongs into objects-deb
ulan 2013/02/04 09:54:06 Done.
9213 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
9214 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
9215 RelocInfo::Mode mode = it.rinfo()->rmode();
9216 if (mode == RelocInfo::EMBEDDED_OBJECT &&
9217 it.rinfo()->target_object()->IsMap()) {
9218 Map* map = Map::cast(it.rinfo()->target_object());
Michael Starzinger 2013/01/31 14:27:50 Indentation is off.
ulan 2013/02/04 09:54:06 Done.
9219 if (map->CanTransition()) {
9220 CHECK(map->dependent_codes()->Contains(this));
9221 }
9222 }
9223 }
9224 }
9225 #endif
9226
9227
9211 MaybeObject* JSObject::SetFastElementsCapacityAndLength( 9228 MaybeObject* JSObject::SetFastElementsCapacityAndLength(
9212 int capacity, 9229 int capacity,
9213 int length, 9230 int length,
9214 SetFastElementsCapacitySmiMode smi_mode) { 9231 SetFastElementsCapacitySmiMode smi_mode) {
9215 Heap* heap = GetHeap(); 9232 Heap* heap = GetHeap();
9216 // We should never end in here with a pixel or external array. 9233 // We should never end in here with a pixel or external array.
9217 ASSERT(!HasExternalArrayElements()); 9234 ASSERT(!HasExternalArrayElements());
9218 ASSERT(!map()->is_observed()); 9235 ASSERT(!map()->is_observed());
9219 9236
9220 // Allocate a new fast elements backing store. 9237 // Allocate a new fast elements backing store.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
9501 codes->clear_code_at(i); 9518 codes->clear_code_at(i);
9502 } 9519 }
9503 codes = new_codes; 9520 codes = new_codes;
9504 } 9521 }
9505 codes->set_code_at(append_index, *value); 9522 codes->set_code_at(append_index, *value);
9506 codes->set_number_of_codes(append_index + 1); 9523 codes->set_number_of_codes(append_index + 1);
9507 return codes; 9524 return codes;
9508 } 9525 }
9509 9526
9510 9527
9528 bool DependentCodes::Contains(Code* code) {
9529 int limit = number_of_codes();
9530 for (int i = 0; i < limit; i++) {
9531 if (code_at(i) == code) return true;
9532 }
9533 return false;
9534 }
9535
9536
9511 MaybeObject* JSReceiver::SetPrototype(Object* value, 9537 MaybeObject* JSReceiver::SetPrototype(Object* value,
9512 bool skip_hidden_prototypes) { 9538 bool skip_hidden_prototypes) {
9513 #ifdef DEBUG 9539 #ifdef DEBUG
9514 int size = Size(); 9540 int size = Size();
9515 #endif 9541 #endif
9516 9542
9517 Heap* heap = GetHeap(); 9543 Heap* heap = GetHeap();
9518 // Silently ignore the change if value is not a JSObject or null. 9544 // Silently ignore the change if value is not a JSObject or null.
9519 // SpiderMonkey behaves this way. 9545 // SpiderMonkey behaves this way.
9520 if (!value->IsJSReceiver() && !value->IsNull()) return value; 9546 if (!value->IsJSReceiver() && !value->IsNull()) return value;
(...skipping 4334 matching lines...) Expand 10 before | Expand all | Expand 10 after
13855 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13881 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13856 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13882 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13857 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13883 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13858 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13884 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13859 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13885 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13860 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13886 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13861 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13887 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13862 } 13888 }
13863 13889
13864 } } // namespace v8::internal 13890 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698