OLD | NEW |
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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 #endif | 1297 #endif |
1298 } | 1298 } |
1299 | 1299 |
1300 | 1300 |
1301 bool JSObject::ShouldTrackAllocationInfo() { | 1301 bool JSObject::ShouldTrackAllocationInfo() { |
1302 if (map()->CanTrackAllocationSite()) { | 1302 if (map()->CanTrackAllocationSite()) { |
1303 if (!IsJSArray()) { | 1303 if (!IsJSArray()) { |
1304 return true; | 1304 return true; |
1305 } | 1305 } |
1306 | 1306 |
1307 return AllocationSiteInfo::GetMode(GetElementsKind()) == | 1307 return AllocationSite::GetMode(GetElementsKind()) == |
1308 TRACK_ALLOCATION_SITE; | 1308 TRACK_ALLOCATION_SITE; |
1309 } | 1309 } |
1310 return false; | 1310 return false; |
1311 } | 1311 } |
1312 | 1312 |
1313 | 1313 |
1314 // Heuristic: We only need to create allocation site info if the boilerplate | 1314 // Heuristic: We only need to create allocation site info if the boilerplate |
1315 // elements kind is the initial elements kind. | 1315 // elements kind is the initial elements kind. |
1316 AllocationSiteMode AllocationSiteInfo::GetMode( | 1316 AllocationSiteMode AllocationSite::GetMode( |
1317 ElementsKind boilerplate_elements_kind) { | 1317 ElementsKind boilerplate_elements_kind) { |
1318 if (FLAG_track_allocation_sites && | 1318 if (FLAG_track_allocation_sites && |
1319 IsFastSmiElementsKind(boilerplate_elements_kind)) { | 1319 IsFastSmiElementsKind(boilerplate_elements_kind)) { |
1320 return TRACK_ALLOCATION_SITE; | 1320 return TRACK_ALLOCATION_SITE; |
1321 } | 1321 } |
1322 | 1322 |
1323 return DONT_TRACK_ALLOCATION_SITE; | 1323 return DONT_TRACK_ALLOCATION_SITE; |
1324 } | 1324 } |
1325 | 1325 |
1326 | 1326 |
1327 AllocationSiteMode AllocationSiteInfo::GetMode(ElementsKind from, | 1327 AllocationSiteMode AllocationSite::GetMode(ElementsKind from, |
1328 ElementsKind to) { | 1328 ElementsKind to) { |
1329 if (FLAG_track_allocation_sites && | 1329 if (FLAG_track_allocation_sites && |
1330 IsFastSmiElementsKind(from) && | 1330 IsFastSmiElementsKind(from) && |
1331 (IsFastObjectElementsKind(to) || IsFastDoubleElementsKind(to))) { | 1331 (IsFastObjectElementsKind(to) || IsFastDoubleElementsKind(to))) { |
1332 return TRACK_ALLOCATION_SITE; | 1332 return TRACK_ALLOCATION_SITE; |
1333 } | 1333 } |
1334 | 1334 |
1335 return DONT_TRACK_ALLOCATION_SITE; | 1335 return DONT_TRACK_ALLOCATION_SITE; |
1336 } | 1336 } |
1337 | 1337 |
1338 | 1338 |
(...skipping 3089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4428 | 4428 |
4429 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) | 4429 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) |
4430 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, | 4430 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, |
4431 kInternalFieldCountOffset) | 4431 kInternalFieldCountOffset) |
4432 | 4432 |
4433 ACCESSORS(SignatureInfo, receiver, Object, kReceiverOffset) | 4433 ACCESSORS(SignatureInfo, receiver, Object, kReceiverOffset) |
4434 ACCESSORS(SignatureInfo, args, Object, kArgsOffset) | 4434 ACCESSORS(SignatureInfo, args, Object, kArgsOffset) |
4435 | 4435 |
4436 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) | 4436 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset) |
4437 | 4437 |
| 4438 ACCESSORS(AllocationSite, payload, Object, kPayloadOffset) |
4438 ACCESSORS(AllocationSiteInfo, payload, Object, kPayloadOffset) | 4439 ACCESSORS(AllocationSiteInfo, payload, Object, kPayloadOffset) |
4439 | 4440 |
4440 ACCESSORS(Script, source, Object, kSourceOffset) | 4441 ACCESSORS(Script, source, Object, kSourceOffset) |
4441 ACCESSORS(Script, name, Object, kNameOffset) | 4442 ACCESSORS(Script, name, Object, kNameOffset) |
4442 ACCESSORS(Script, id, Object, kIdOffset) | 4443 ACCESSORS(Script, id, Object, kIdOffset) |
4443 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 4444 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) |
4444 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 4445 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) |
4445 ACCESSORS(Script, data, Object, kDataOffset) | 4446 ACCESSORS(Script, data, Object, kDataOffset) |
4446 ACCESSORS(Script, context_data, Object, kContextOffset) | 4447 ACCESSORS(Script, context_data, Object, kContextOffset) |
4447 ACCESSORS(Script, wrapper, Foreign, kWrapperOffset) | 4448 ACCESSORS(Script, wrapper, Foreign, kWrapperOffset) |
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6231 #undef WRITE_UINT32_FIELD | 6232 #undef WRITE_UINT32_FIELD |
6232 #undef READ_SHORT_FIELD | 6233 #undef READ_SHORT_FIELD |
6233 #undef WRITE_SHORT_FIELD | 6234 #undef WRITE_SHORT_FIELD |
6234 #undef READ_BYTE_FIELD | 6235 #undef READ_BYTE_FIELD |
6235 #undef WRITE_BYTE_FIELD | 6236 #undef WRITE_BYTE_FIELD |
6236 | 6237 |
6237 | 6238 |
6238 } } // namespace v8::internal | 6239 } } // namespace v8::internal |
6239 | 6240 |
6240 #endif // V8_OBJECTS_INL_H_ | 6241 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |