| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 former_start[new_start_index + 1] = Smi::FromInt(len - to_trim); | 266 former_start[new_start_index + 1] = Smi::FromInt(len - to_trim); |
| 267 | 267 |
| 268 // Maintain marking consistency for HeapObjectIterator and | 268 // Maintain marking consistency for HeapObjectIterator and |
| 269 // IncrementalMarking. | 269 // IncrementalMarking. |
| 270 int size_delta = to_trim * entry_size; | 270 int size_delta = to_trim * entry_size; |
| 271 if (heap->marking()->TransferMark(elms->address(), | 271 if (heap->marking()->TransferMark(elms->address(), |
| 272 elms->address() + size_delta)) { | 272 elms->address() + size_delta)) { |
| 273 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); | 273 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); |
| 274 } | 274 } |
| 275 | 275 |
| 276 HEAP_PROFILE(heap, ObjectMoveEvent(elms->address(), | 276 FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress( |
| 277 elms->address() + size_delta)); | 277 elms->address() + size_delta)); |
| 278 return FixedArrayBase::cast(HeapObject::FromAddress( | 278 HeapProfiler* profiler = heap->isolate()->heap_profiler(); |
| 279 elms->address() + to_trim * entry_size)); | 279 if (profiler->is_profiling()) { |
| 280 profiler->ObjectMoveEvent(elms->address(), |
| 281 new_elms->address(), |
| 282 new_elms->Size()); |
| 283 if (profiler->is_tracking_allocations()) { |
| 284 // Report filler object as a new allocation. |
| 285 // Otherwise it will become an untracked object. |
| 286 profiler->NewObjectEvent(elms->address(), elms->Size()); |
| 287 } |
| 288 } |
| 289 return new_elms; |
| 280 } | 290 } |
| 281 | 291 |
| 282 | 292 |
| 283 static bool ArrayPrototypeHasNoElements(Heap* heap, | 293 static bool ArrayPrototypeHasNoElements(Heap* heap, |
| 284 Context* native_context, | 294 Context* native_context, |
| 285 JSObject* array_proto) { | 295 JSObject* array_proto) { |
| 286 // This method depends on non writability of Object and Array prototype | 296 // This method depends on non writability of Object and Array prototype |
| 287 // fields. | 297 // fields. |
| 288 if (array_proto->elements() != heap->empty_fixed_array()) return false; | 298 if (array_proto->elements() != heap->empty_fixed_array()) return false; |
| 289 // Object.prototype | 299 // Object.prototype |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 LoadIC::GenerateMegamorphic(masm); | 1322 LoadIC::GenerateMegamorphic(masm); |
| 1313 } | 1323 } |
| 1314 | 1324 |
| 1315 | 1325 |
| 1316 static void Generate_LoadIC_Normal(MacroAssembler* masm) { | 1326 static void Generate_LoadIC_Normal(MacroAssembler* masm) { |
| 1317 LoadIC::GenerateNormal(masm); | 1327 LoadIC::GenerateNormal(masm); |
| 1318 } | 1328 } |
| 1319 | 1329 |
| 1320 | 1330 |
| 1321 static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { | 1331 static void Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { |
| 1322 LoadStubCompiler::GenerateLoadViaGetter(masm, Handle<JSFunction>()); | 1332 LoadStubCompiler::GenerateLoadViaGetter( |
| 1333 masm, LoadStubCompiler::registers()[0], Handle<JSFunction>()); |
| 1323 } | 1334 } |
| 1324 | 1335 |
| 1325 | 1336 |
| 1326 static void Generate_LoadIC_Slow(MacroAssembler* masm) { | 1337 static void Generate_LoadIC_Slow(MacroAssembler* masm) { |
| 1327 LoadIC::GenerateRuntimeGetProperty(masm); | 1338 LoadIC::GenerateRuntimeGetProperty(masm); |
| 1328 } | 1339 } |
| 1329 | 1340 |
| 1330 | 1341 |
| 1331 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { | 1342 static void Generate_KeyedLoadIC_Initialize(MacroAssembler* masm) { |
| 1332 KeyedLoadIC::GenerateInitialize(masm); | 1343 KeyedLoadIC::GenerateInitialize(masm); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 static void Generate_KeyedLoadIC_NonStrictArguments(MacroAssembler* masm) { | 1382 static void Generate_KeyedLoadIC_NonStrictArguments(MacroAssembler* masm) { |
| 1372 KeyedLoadIC::GenerateNonStrictArguments(masm); | 1383 KeyedLoadIC::GenerateNonStrictArguments(masm); |
| 1373 } | 1384 } |
| 1374 | 1385 |
| 1375 | 1386 |
| 1376 static void Generate_StoreIC_Slow(MacroAssembler* masm) { | 1387 static void Generate_StoreIC_Slow(MacroAssembler* masm) { |
| 1377 StoreIC::GenerateSlow(masm); | 1388 StoreIC::GenerateSlow(masm); |
| 1378 } | 1389 } |
| 1379 | 1390 |
| 1380 | 1391 |
| 1392 static void Generate_StoreIC_Slow_Strict(MacroAssembler* masm) { |
| 1393 StoreIC::GenerateSlow(masm); |
| 1394 } |
| 1395 |
| 1396 |
| 1381 static void Generate_StoreIC_Initialize(MacroAssembler* masm) { | 1397 static void Generate_StoreIC_Initialize(MacroAssembler* masm) { |
| 1382 StoreIC::GenerateInitialize(masm); | 1398 StoreIC::GenerateInitialize(masm); |
| 1383 } | 1399 } |
| 1384 | 1400 |
| 1385 | 1401 |
| 1386 static void Generate_StoreIC_Initialize_Strict(MacroAssembler* masm) { | 1402 static void Generate_StoreIC_Initialize_Strict(MacroAssembler* masm) { |
| 1387 StoreIC::GenerateInitialize(masm); | 1403 StoreIC::GenerateInitialize(masm); |
| 1388 } | 1404 } |
| 1389 | 1405 |
| 1390 | 1406 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 static void Generate_KeyedStoreIC_MissForceGeneric(MacroAssembler* masm) { | 1482 static void Generate_KeyedStoreIC_MissForceGeneric(MacroAssembler* masm) { |
| 1467 KeyedStoreIC::GenerateMiss(masm, MISS_FORCE_GENERIC); | 1483 KeyedStoreIC::GenerateMiss(masm, MISS_FORCE_GENERIC); |
| 1468 } | 1484 } |
| 1469 | 1485 |
| 1470 | 1486 |
| 1471 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { | 1487 static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { |
| 1472 KeyedStoreIC::GenerateSlow(masm); | 1488 KeyedStoreIC::GenerateSlow(masm); |
| 1473 } | 1489 } |
| 1474 | 1490 |
| 1475 | 1491 |
| 1492 static void Generate_KeyedStoreIC_Slow_Strict(MacroAssembler* masm) { |
| 1493 KeyedStoreIC::GenerateSlow(masm); |
| 1494 } |
| 1495 |
| 1496 |
| 1476 static void Generate_KeyedStoreIC_Initialize(MacroAssembler* masm) { | 1497 static void Generate_KeyedStoreIC_Initialize(MacroAssembler* masm) { |
| 1477 KeyedStoreIC::GenerateInitialize(masm); | 1498 KeyedStoreIC::GenerateInitialize(masm); |
| 1478 } | 1499 } |
| 1479 | 1500 |
| 1480 | 1501 |
| 1481 static void Generate_KeyedStoreIC_Initialize_Strict(MacroAssembler* masm) { | 1502 static void Generate_KeyedStoreIC_Initialize_Strict(MacroAssembler* masm) { |
| 1482 KeyedStoreIC::GenerateInitialize(masm); | 1503 KeyedStoreIC::GenerateInitialize(masm); |
| 1483 } | 1504 } |
| 1484 | 1505 |
| 1485 | 1506 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 } | 1821 } |
| 1801 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1822 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1802 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1823 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1803 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1824 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1804 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1825 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1805 #undef DEFINE_BUILTIN_ACCESSOR_C | 1826 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1806 #undef DEFINE_BUILTIN_ACCESSOR_A | 1827 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1807 | 1828 |
| 1808 | 1829 |
| 1809 } } // namespace v8::internal | 1830 } } // namespace v8::internal |
| OLD | NEW |