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

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

Issue 24704005: Merged r16393 into 3.20 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.20
Patch Set: Created 7 years, 2 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') | src/property.h » ('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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3571 bool Map::is_dictionary_map() { 3576 bool Map::is_dictionary_map() {
3572 return DictionaryMap::decode(bit_field3()); 3577 return DictionaryMap::decode(bit_field3());
3573 } 3578 }
3574 3579
3575 3580
3576 Code::Flags Code::flags() { 3581 Code::Flags Code::flags() {
3577 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); 3582 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset));
3578 } 3583 }
3579 3584
3580 3585
3581 inline bool Map::CanTrackAllocationSite() {
3582 return instance_type() == JS_ARRAY_TYPE;
3583 }
3584
3585
3586 void Map::set_owns_descriptors(bool is_shared) { 3586 void Map::set_owns_descriptors(bool is_shared) {
3587 set_bit_field3(OwnsDescriptors::update(bit_field3(), is_shared)); 3587 set_bit_field3(OwnsDescriptors::update(bit_field3(), is_shared));
3588 } 3588 }
3589 3589
3590 3590
3591 bool Map::owns_descriptors() { 3591 bool Map::owns_descriptors() {
3592 return OwnsDescriptors::decode(bit_field3()); 3592 return OwnsDescriptors::decode(bit_field3());
3593 } 3593 }
3594 3594
3595 3595
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
6244 #undef WRITE_UINT32_FIELD 6244 #undef WRITE_UINT32_FIELD
6245 #undef READ_SHORT_FIELD 6245 #undef READ_SHORT_FIELD
6246 #undef WRITE_SHORT_FIELD 6246 #undef WRITE_SHORT_FIELD
6247 #undef READ_BYTE_FIELD 6247 #undef READ_BYTE_FIELD
6248 #undef WRITE_BYTE_FIELD 6248 #undef WRITE_BYTE_FIELD
6249 6249
6250 6250
6251 } } // namespace v8::internal 6251 } } // namespace v8::internal
6252 6252
6253 #endif // V8_OBJECTS_INL_H_ 6253 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698