| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 isolate()); | 470 isolate()); |
| 471 AddStoreMapConstant(object, allocation_site_map); | 471 AddStoreMapConstant(object, allocation_site_map); |
| 472 | 472 |
| 473 // Store the payload (smi elements kind) | 473 // Store the payload (smi elements kind) |
| 474 HValue* initial_elements_kind = AddInstruction(new(zone) HConstant( | 474 HValue* initial_elements_kind = AddInstruction(new(zone) HConstant( |
| 475 GetInitialFastElementsKind())); | 475 GetInitialFastElementsKind())); |
| 476 Add<HStoreNamedField>(object, | 476 Add<HStoreNamedField>(object, |
| 477 HObjectAccess::ForAllocationSiteTransitionInfo(), | 477 HObjectAccess::ForAllocationSiteTransitionInfo(), |
| 478 initial_elements_kind); | 478 initial_elements_kind); |
| 479 | 479 |
| 480 Add<HLinkObjectInList>(object, HObjectAccess::ForAllocationSiteWeakNext(), | 480 // Link the object to the allocation site list |
| 481 HLinkObjectInList::ALLOCATION_SITE_LIST); | 481 HValue* site_list = Add<HConstant>( |
| 482 ExternalReference::allocation_sites_list_address(isolate())); |
| 483 HValue* site = AddLoad(site_list, HObjectAccess::ForAllocationSiteList()); |
| 484 HStoreNamedField* store = |
| 485 AddStore(object, HObjectAccess::ForAllocationSiteWeakNext(), site); |
| 486 store->SkipWriteBarrier(); |
| 487 AddStore(site_list, HObjectAccess::ForAllocationSiteList(), object); |
| 482 | 488 |
| 483 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input | 489 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input |
| 484 // cell is really a Cell, and so no write barrier is needed. | 490 // cell is really a Cell, and so no write barrier is needed. |
| 485 // TODO(mvstanton): Add a debug_code check to verify the input cell is really | 491 // TODO(mvstanton): Add a debug_code check to verify the input cell is really |
| 486 // a cell. (perhaps with a new instruction, HAssert). | 492 // a cell. (perhaps with a new instruction, HAssert). |
| 487 HInstruction* cell = GetParameter(0); | 493 HInstruction* cell = GetParameter(0); |
| 488 HObjectAccess access = HObjectAccess::ForCellValue(); | 494 HObjectAccess access = HObjectAccess::ForCellValue(); |
| 489 HStoreNamedField* store = AddStore(cell, access, object); | 495 store = AddStore(cell, access, object); |
| 490 store->SkipWriteBarrier(); | 496 store->SkipWriteBarrier(); |
| 491 return cell; | 497 return cell; |
| 492 } | 498 } |
| 493 | 499 |
| 494 | 500 |
| 495 Handle<Code> CreateAllocationSiteStub::GenerateCode() { | 501 Handle<Code> CreateAllocationSiteStub::GenerateCode() { |
| 496 return DoGenerateCode(this); | 502 return DoGenerateCode(this); |
| 497 } | 503 } |
| 498 | 504 |
| 499 | 505 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 return value; | 951 return value; |
| 946 } | 952 } |
| 947 | 953 |
| 948 | 954 |
| 949 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { | 955 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { |
| 950 return DoGenerateCode(this); | 956 return DoGenerateCode(this); |
| 951 } | 957 } |
| 952 | 958 |
| 953 | 959 |
| 954 } } // namespace v8::internal | 960 } } // namespace v8::internal |
| OLD | NEW |