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

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

Issue 10822011: Limited the size of transition arrays so they never end up in the large object space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/objects.cc ('k') | 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 3564 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 bool Map::HasTransitionArray() { 3575 bool Map::HasTransitionArray() {
3576 return instance_descriptors()->HasTransitionArray(); 3576 return instance_descriptors()->HasTransitionArray();
3577 } 3577 }
3578 3578
3579 3579
3580 Map* Map::elements_transition_map() { 3580 Map* Map::elements_transition_map() {
3581 return transitions()->elements_transition(); 3581 return transitions()->elements_transition();
3582 } 3582 }
3583 3583
3584 3584
3585 bool Map::CanHaveMoreTransitions() {
3586 if (!HasTransitionArray()) return true;
3587 return FixedArray::SizeFor(transitions()->length() +
3588 TransitionArray::kTransitionSize)
3589 <= Page::kMaxNonCodeHeapObjectSize;
3590 }
3591
3592
3585 MaybeObject* Map::AddTransition(String* key, Map* target) { 3593 MaybeObject* Map::AddTransition(String* key, Map* target) {
3586 if (HasTransitionArray()) return transitions()->CopyInsert(key, target); 3594 if (HasTransitionArray()) return transitions()->CopyInsert(key, target);
3587 return TransitionArray::NewWith(key, target); 3595 return TransitionArray::NewWith(key, target);
3588 } 3596 }
3589 3597
3590 3598
3591 void Map::SetTransition(int transition_index, Map* target) { 3599 void Map::SetTransition(int transition_index, Map* target) {
3592 transitions()->SetTarget(transition_index, target); 3600 transitions()->SetTarget(transition_index, target);
3593 } 3601 }
3594 3602
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
5382 #undef WRITE_UINT32_FIELD 5390 #undef WRITE_UINT32_FIELD
5383 #undef READ_SHORT_FIELD 5391 #undef READ_SHORT_FIELD
5384 #undef WRITE_SHORT_FIELD 5392 #undef WRITE_SHORT_FIELD
5385 #undef READ_BYTE_FIELD 5393 #undef READ_BYTE_FIELD
5386 #undef WRITE_BYTE_FIELD 5394 #undef WRITE_BYTE_FIELD
5387 5395
5388 5396
5389 } } // namespace v8::internal 5397 } } // namespace v8::internal
5390 5398
5391 #endif // V8_OBJECTS_INL_H_ 5399 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698