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

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

Issue 22915007: Clear next map word when folding allocations into js arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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.h ('k') | test/mjsunit/allocation-folding.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 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 #if DEBUG 1305 #if DEBUG
1306 if (FLAG_enable_slow_asserts) { 1306 if (FLAG_enable_slow_asserts) {
1307 ElementsAccessor* accessor = GetElementsAccessor(); 1307 ElementsAccessor* accessor = GetElementsAccessor();
1308 accessor->Validate(this); 1308 accessor->Validate(this);
1309 } 1309 }
1310 #endif 1310 #endif
1311 } 1311 }
1312 1312
1313 1313
1314 bool JSObject::ShouldTrackAllocationInfo() { 1314 bool JSObject::ShouldTrackAllocationInfo() {
1315 if (map()->CanTrackAllocationSite()) { 1315 if (AllocationSite::CanTrack(map()->instance_type())) {
1316 if (!IsJSArray()) { 1316 if (!IsJSArray()) {
1317 return true; 1317 return true;
1318 } 1318 }
1319 1319
1320 return AllocationSite::GetMode(GetElementsKind()) == 1320 return AllocationSite::GetMode(GetElementsKind()) ==
1321 TRACK_ALLOCATION_SITE; 1321 TRACK_ALLOCATION_SITE;
1322 } 1322 }
1323 return false; 1323 return false;
1324 } 1324 }
1325 1325
(...skipping 16 matching lines...) Expand all
1342 if (FLAG_track_allocation_sites && 1342 if (FLAG_track_allocation_sites &&
1343 IsFastSmiElementsKind(from) && 1343 IsFastSmiElementsKind(from) &&
1344 IsMoreGeneralElementsKindTransition(from, to)) { 1344 IsMoreGeneralElementsKindTransition(from, to)) {
1345 return TRACK_ALLOCATION_SITE; 1345 return TRACK_ALLOCATION_SITE;
1346 } 1346 }
1347 1347
1348 return DONT_TRACK_ALLOCATION_SITE; 1348 return DONT_TRACK_ALLOCATION_SITE;
1349 } 1349 }
1350 1350
1351 1351
1352 inline bool AllocationSite::CanTrack(InstanceType type) {
1353 return type == JS_ARRAY_TYPE;
1354 }
1355
1356
1352 MaybeObject* JSObject::EnsureCanContainHeapObjectElements() { 1357 MaybeObject* JSObject::EnsureCanContainHeapObjectElements() {
1353 ValidateElements(); 1358 ValidateElements();
1354 ElementsKind elements_kind = map()->elements_kind(); 1359 ElementsKind elements_kind = map()->elements_kind();
1355 if (!IsFastObjectElementsKind(elements_kind)) { 1360 if (!IsFastObjectElementsKind(elements_kind)) {
1356 if (IsFastHoleyElementsKind(elements_kind)) { 1361 if (IsFastHoleyElementsKind(elements_kind)) {
1357 return TransitionElementsKind(FAST_HOLEY_ELEMENTS); 1362 return TransitionElementsKind(FAST_HOLEY_ELEMENTS);
1358 } else { 1363 } else {
1359 return TransitionElementsKind(FAST_ELEMENTS); 1364 return TransitionElementsKind(FAST_ELEMENTS);
1360 } 1365 }
1361 } 1366 }
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 bool Map::is_dictionary_map() { 3591 bool Map::is_dictionary_map() {
3587 return DictionaryMap::decode(bit_field3()); 3592 return DictionaryMap::decode(bit_field3());
3588 } 3593 }
3589 3594
3590 3595
3591 Code::Flags Code::flags() { 3596 Code::Flags Code::flags() {
3592 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); 3597 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset));
3593 } 3598 }
3594 3599
3595 3600
3596 inline bool Map::CanTrackAllocationSite() {
3597 return instance_type() == JS_ARRAY_TYPE;
3598 }
3599
3600
3601 void Map::set_owns_descriptors(bool is_shared) { 3601 void Map::set_owns_descriptors(bool is_shared) {
3602 set_bit_field3(OwnsDescriptors::update(bit_field3(), is_shared)); 3602 set_bit_field3(OwnsDescriptors::update(bit_field3(), is_shared));
3603 } 3603 }
3604 3604
3605 3605
3606 bool Map::owns_descriptors() { 3606 bool Map::owns_descriptors() {
3607 return OwnsDescriptors::decode(bit_field3()); 3607 return OwnsDescriptors::decode(bit_field3());
3608 } 3608 }
3609 3609
3610 3610
(...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
6292 #undef WRITE_UINT32_FIELD 6292 #undef WRITE_UINT32_FIELD
6293 #undef READ_SHORT_FIELD 6293 #undef READ_SHORT_FIELD
6294 #undef WRITE_SHORT_FIELD 6294 #undef WRITE_SHORT_FIELD
6295 #undef READ_BYTE_FIELD 6295 #undef READ_BYTE_FIELD
6296 #undef WRITE_BYTE_FIELD 6296 #undef WRITE_BYTE_FIELD
6297 6297
6298 6298
6299 } } // namespace v8::internal 6299 } } // namespace v8::internal
6300 6300
6301 #endif // V8_OBJECTS_INL_H_ 6301 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/allocation-folding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698