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

Side by Side Diff: src/objects-visiting-inl.h

Issue 12995020: Merged r14027 into 3.16 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.16
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 | src/version.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 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // fields of this map are visited. 390 // fields of this map are visited.
391 TransitionArray* transitions = map->unchecked_transition_array(); 391 TransitionArray* transitions = map->unchecked_transition_array();
392 if (transitions->IsTransitionArray()) { 392 if (transitions->IsTransitionArray()) {
393 MarkTransitionArray(heap, transitions); 393 MarkTransitionArray(heap, transitions);
394 } else { 394 } else {
395 // Already marked by marking map->GetBackPointer() above. 395 // Already marked by marking map->GetBackPointer() above.
396 ASSERT(transitions->IsMap() || transitions->IsUndefined()); 396 ASSERT(transitions->IsMap() || transitions->IsUndefined());
397 } 397 }
398 398
399 // Since descriptor arrays are potentially shared, ensure that only the 399 // Since descriptor arrays are potentially shared, ensure that only the
400 // descriptors that appeared for this map are marked. The first time a 400 // descriptors that belong to this map are marked. The first time a
401 // non-empty descriptor array is marked, its header is also visited. The slot 401 // non-empty descriptor array is marked, its header is also visited. The slot
402 // holding the descriptor array will be implicitly recorded when the pointer 402 // holding the descriptor array will be implicitly recorded when the pointer
403 // fields of this map are visited. 403 // fields of this map are visited.
404 DescriptorArray* descriptors = map->instance_descriptors(); 404 DescriptorArray* descriptors = map->instance_descriptors();
405 if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) && 405 if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) &&
406 descriptors->length() > 0) { 406 descriptors->length() > 0) {
407 StaticVisitor::VisitPointers(heap, 407 StaticVisitor::VisitPointers(heap,
408 descriptors->GetFirstElementAddress(), 408 descriptors->GetFirstElementAddress(),
409 descriptors->GetDescriptorEndSlot(0)); 409 descriptors->GetDescriptorEndSlot(0));
410 } 410 }
411 int start = 0; 411 int start = 0;
412 int end = map->NumberOfOwnDescriptors(); 412 int end = map->NumberOfOwnDescriptors();
413 Object* back_pointer = map->GetBackPointer();
414 if (!back_pointer->IsUndefined()) {
415 Map* parent_map = Map::cast(back_pointer);
416 if (descriptors == parent_map->instance_descriptors()) {
417 start = parent_map->NumberOfOwnDescriptors();
418 }
419 }
420 if (start < end) { 413 if (start < end) {
421 StaticVisitor::VisitPointers(heap, 414 StaticVisitor::VisitPointers(heap,
422 descriptors->GetDescriptorStartSlot(start), 415 descriptors->GetDescriptorStartSlot(start),
423 descriptors->GetDescriptorEndSlot(end)); 416 descriptors->GetDescriptorEndSlot(end));
424 } 417 }
425 418
426 // Mark prototype dependent codes array but do not push it onto marking 419 // Mark prototype dependent codes array but do not push it onto marking
427 // stack, this will make references from it weak. We will clean dead 420 // stack, this will make references from it weak. We will clean dead
428 // codes when we iterate over maps in ClearNonLiveTransitions. 421 // codes when we iterate over maps in ClearNonLiveTransitions.
429 Object** slot = HeapObject::RawField(map, Map::kDependentCodesOffset); 422 Object** slot = HeapObject::RawField(map, Map::kDependentCodesOffset);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 RelocIterator it(this, mode_mask); 709 RelocIterator it(this, mode_mask);
717 for (; !it.done(); it.next()) { 710 for (; !it.done(); it.next()) {
718 it.rinfo()->template Visit<StaticVisitor>(heap); 711 it.rinfo()->template Visit<StaticVisitor>(heap);
719 } 712 }
720 } 713 }
721 714
722 715
723 } } // namespace v8::internal 716 } } // namespace v8::internal
724 717
725 #endif // V8_OBJECTS_VISITING_INL_H_ 718 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698