| 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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 void JSObject::ValidateElements() { | 1290 void JSObject::ValidateElements() { |
| 1291 #ifdef ENABLE_SLOW_ASSERTS | 1291 #ifdef ENABLE_SLOW_ASSERTS |
| 1292 if (FLAG_enable_slow_asserts) { | 1292 if (FLAG_enable_slow_asserts) { |
| 1293 ElementsAccessor* accessor = GetElementsAccessor(); | 1293 ElementsAccessor* accessor = GetElementsAccessor(); |
| 1294 accessor->Validate(this); | 1294 accessor->Validate(this); |
| 1295 } | 1295 } |
| 1296 #endif | 1296 #endif |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 | 1299 |
| 1300 bool JSObject::ShouldTrackAllocationInfo() { | |
| 1301 if (AllocationSite::CanTrack(map()->instance_type())) { | |
| 1302 if (!IsJSArray()) { | |
| 1303 return true; | |
| 1304 } | |
| 1305 | |
| 1306 return AllocationSite::GetMode(GetElementsKind()) == | |
| 1307 TRACK_ALLOCATION_SITE; | |
| 1308 } | |
| 1309 return false; | |
| 1310 } | |
| 1311 | |
| 1312 | |
| 1313 void AllocationSite::Initialize() { | 1300 void AllocationSite::Initialize() { |
| 1314 set_transition_info(Smi::FromInt(0)); | 1301 set_transition_info(Smi::FromInt(0)); |
| 1315 SetElementsKind(GetInitialFastElementsKind()); | 1302 SetElementsKind(GetInitialFastElementsKind()); |
| 1316 set_nested_site(Smi::FromInt(0)); | 1303 set_nested_site(Smi::FromInt(0)); |
| 1317 set_memento_create_count(Smi::FromInt(0)); | 1304 set_memento_create_count(Smi::FromInt(0)); |
| 1318 set_memento_found_count(Smi::FromInt(0)); | 1305 set_memento_found_count(Smi::FromInt(0)); |
| 1319 set_pretenure_decision(Smi::FromInt(0)); | 1306 set_pretenure_decision(Smi::FromInt(0)); |
| 1320 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), | 1307 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), |
| 1321 SKIP_WRITE_BARRIER); | 1308 SKIP_WRITE_BARRIER); |
| 1322 } | 1309 } |
| (...skipping 5140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6463 #undef WRITE_UINT32_FIELD | 6450 #undef WRITE_UINT32_FIELD |
| 6464 #undef READ_SHORT_FIELD | 6451 #undef READ_SHORT_FIELD |
| 6465 #undef WRITE_SHORT_FIELD | 6452 #undef WRITE_SHORT_FIELD |
| 6466 #undef READ_BYTE_FIELD | 6453 #undef READ_BYTE_FIELD |
| 6467 #undef WRITE_BYTE_FIELD | 6454 #undef WRITE_BYTE_FIELD |
| 6468 | 6455 |
| 6469 | 6456 |
| 6470 } } // namespace v8::internal | 6457 } } // namespace v8::internal |
| 6471 | 6458 |
| 6472 #endif // V8_OBJECTS_INL_H_ | 6459 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |