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

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

Issue 17418003: Short-circuit embedded cons strings. (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
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-embedded-cons-string.js » ('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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); 226 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
227 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); 227 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code);
228 StaticVisitor::MarkObject(heap, code); 228 StaticVisitor::MarkObject(heap, code);
229 } 229 }
230 230
231 231
232 template<typename StaticVisitor> 232 template<typename StaticVisitor>
233 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer( 233 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer(
234 Heap* heap, RelocInfo* rinfo) { 234 Heap* heap, RelocInfo* rinfo) {
235 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); 235 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
236 ASSERT(!rinfo->target_object()->IsConsString());
237 HeapObject* object = HeapObject::cast(rinfo->target_object()); 236 HeapObject* object = HeapObject::cast(rinfo->target_object());
237 if (object->IsConsString() && ConsString::cast(object)->IsFlat()) {
Michael Starzinger 2013/06/20 10:04:13 I don't think this is the correct place to do the
238 // Short-circuit flattened cons-strings.
239 object = ConsString::cast(object)->first();
240 rinfo->set_target_object(object);
241 }
238 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps || 242 if (!FLAG_weak_embedded_maps_in_optimized_code || !FLAG_collect_maps ||
239 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || 243 rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION ||
240 !object->IsMap() || !Map::cast(object)->CanTransition()) { 244 !object->IsMap() || !Map::cast(object)->CanTransition()) {
241 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); 245 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
242 StaticVisitor::MarkObject(heap, object); 246 StaticVisitor::MarkObject(heap, object);
243 } 247 }
244 } 248 }
245 249
246 250
247 template<typename StaticVisitor> 251 template<typename StaticVisitor>
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 RelocIterator it(this, mode_mask); 821 RelocIterator it(this, mode_mask);
818 for (; !it.done(); it.next()) { 822 for (; !it.done(); it.next()) {
819 it.rinfo()->template Visit<StaticVisitor>(heap); 823 it.rinfo()->template Visit<StaticVisitor>(heap);
820 } 824 }
821 } 825 }
822 826
823 827
824 } } // namespace v8::internal 828 } } // namespace v8::internal
825 829
826 #endif // V8_OBJECTS_VISITING_INL_H_ 830 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-embedded-cons-string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698