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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), | 456 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), |
457 isolate()); | 457 isolate()); |
458 AddStoreMapConstant(object, allocation_site_map); | 458 AddStoreMapConstant(object, allocation_site_map); |
459 | 459 |
460 // Store the payload (smi elements kind) | 460 // Store the payload (smi elements kind) |
461 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); | 461 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); |
462 Add<HStoreNamedField>(object, | 462 Add<HStoreNamedField>(object, |
463 HObjectAccess::ForAllocationSiteTransitionInfo(), | 463 HObjectAccess::ForAllocationSiteTransitionInfo(), |
464 initial_elements_kind); | 464 initial_elements_kind); |
465 | 465 |
466 // Store an empty fixed array for the code dependency. | |
467 HConstant* empty_fixed_array = | |
468 Add<HConstant>(isolate()->factory()->empty_fixed_array()); | |
469 ASSERT(!isolate()->heap()->InNewSpace( | |
470 isolate()->heap()->empty_fixed_array())); | |
Hannes Payer (out of office)
2013/09/19 13:57:08
This assert can go, empty fixed array is always in
mvstanton
2013/09/19 14:06:11
Done.
| |
471 HStoreNamedField* store = Add<HStoreNamedField>( | |
472 object, | |
473 HObjectAccess::ForAllocationSiteDependentCode(), | |
474 empty_fixed_array); | |
475 // TODO(mvstanton): Can I improve on using SkipWriteBarrier()? Should the | |
476 // empty fixed array be an "immortal immovable?" | |
Hannes Payer (out of office)
2013/09/19 13:57:08
The write barrier should be skipped there by defau
mvstanton
2013/09/19 14:06:11
I did verify, it was there, but now I've added the
| |
477 store->SkipWriteBarrier(); | |
478 | |
466 // Link the object to the allocation site list | 479 // Link the object to the allocation site list |
467 HValue* site_list = Add<HConstant>( | 480 HValue* site_list = Add<HConstant>( |
468 ExternalReference::allocation_sites_list_address(isolate())); | 481 ExternalReference::allocation_sites_list_address(isolate())); |
469 HValue* site = Add<HLoadNamedField>(site_list, | 482 HValue* site = Add<HLoadNamedField>(site_list, |
470 HObjectAccess::ForAllocationSiteList()); | 483 HObjectAccess::ForAllocationSiteList()); |
471 HStoreNamedField* store = | 484 store = Add<HStoreNamedField>(object, |
472 Add<HStoreNamedField>(object, HObjectAccess::ForAllocationSiteWeakNext(), | 485 HObjectAccess::ForAllocationSiteWeakNext(), |
473 site); | 486 site); |
474 store->SkipWriteBarrier(); | 487 store->SkipWriteBarrier(); |
475 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), | 488 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), |
476 object); | 489 object); |
477 | 490 |
478 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input | 491 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input |
479 // cell is really a Cell, and so no write barrier is needed. | 492 // cell is really a Cell, and so no write barrier is needed. |
480 // TODO(mvstanton): Add a debug_code check to verify the input cell is really | 493 // TODO(mvstanton): Add a debug_code check to verify the input cell is really |
481 // a cell. (perhaps with a new instruction, HAssert). | 494 // a cell. (perhaps with a new instruction, HAssert). |
482 HInstruction* cell = GetParameter(0); | 495 HInstruction* cell = GetParameter(0); |
483 HObjectAccess access = HObjectAccess::ForCellValue(); | 496 HObjectAccess access = HObjectAccess::ForCellValue(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
898 return value; | 911 return value; |
899 } | 912 } |
900 | 913 |
901 | 914 |
902 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { | 915 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { |
903 return DoGenerateCode(this); | 916 return DoGenerateCode(this); |
904 } | 917 } |
905 | 918 |
906 | 919 |
907 } } // namespace v8::internal | 920 } } // namespace v8::internal |
OLD | NEW |