Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 23567003: Added a DependentCode field to AllocationSite. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | src/objects-inl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(), 467 Handle<Map> allocation_site_map(isolate()->heap()->allocation_site_map(),
468 isolate()); 468 isolate());
469 AddStoreMapConstant(object, allocation_site_map); 469 AddStoreMapConstant(object, allocation_site_map);
470 470
471 // Store the payload (smi elements kind) 471 // Store the payload (smi elements kind)
472 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind()); 472 HValue* initial_elements_kind = Add<HConstant>(GetInitialFastElementsKind());
473 Add<HStoreNamedField>(object, 473 Add<HStoreNamedField>(object,
474 HObjectAccess::ForAllocationSiteTransitionInfo(), 474 HObjectAccess::ForAllocationSiteTransitionInfo(),
475 initial_elements_kind); 475 initial_elements_kind);
476 476
477 // Store an empty fixed array for the code dependency.
478 HConstant* empty_fixed_array =
479 Add<HConstant>(isolate()->factory()->empty_fixed_array());
480 ASSERT(!isolate()->heap()->InNewSpace(
481 isolate()->heap()->empty_fixed_array()));
Michael Starzinger 2013/09/19 13:56:17 nit: Let's drop this assert, see comment below.
mvstanton 2013/09/19 14:06:11 Done.
482 HStoreNamedField* store = Add<HStoreNamedField>(
483 object,
484 HObjectAccess::ForAllocationSiteDependentCode(),
485 empty_fixed_array);
486 // SkipWriteBarrier because we just created this object, and because
487 // empty_fixed_array won't be in new space
488 store->SkipWriteBarrier();
Michael Starzinger 2013/09/19 13:56:17 We should just add the empty fixed array to the li
mvstanton 2013/09/19 14:06:11 Right on, done!
489
477 // Link the object to the allocation site list 490 // Link the object to the allocation site list
478 HValue* site_list = Add<HConstant>( 491 HValue* site_list = Add<HConstant>(
479 ExternalReference::allocation_sites_list_address(isolate())); 492 ExternalReference::allocation_sites_list_address(isolate()));
480 HValue* site = Add<HLoadNamedField>(site_list, 493 HValue* site = Add<HLoadNamedField>(site_list,
481 HObjectAccess::ForAllocationSiteList()); 494 HObjectAccess::ForAllocationSiteList());
482 HStoreNamedField* store = 495 store = Add<HStoreNamedField>(object,
483 Add<HStoreNamedField>(object, HObjectAccess::ForAllocationSiteWeakNext(), 496 HObjectAccess::ForAllocationSiteWeakNext(),
484 site); 497 site);
485 store->SkipWriteBarrier(); 498 store->SkipWriteBarrier();
486 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), 499 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
487 object); 500 object);
488 501
489 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input 502 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input
490 // cell is really a Cell, and so no write barrier is needed. 503 // cell is really a Cell, and so no write barrier is needed.
491 // TODO(mvstanton): Add a debug_code check to verify the input cell is really 504 // TODO(mvstanton): Add a debug_code check to verify the input cell is really
492 // a cell. (perhaps with a new instruction, HAssert). 505 // a cell. (perhaps with a new instruction, HAssert).
493 HInstruction* cell = GetParameter(0); 506 HInstruction* cell = GetParameter(0);
494 HObjectAccess access = HObjectAccess::ForCellValue(); 507 HObjectAccess access = HObjectAccess::ForCellValue();
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 return js_function; 1114 return js_function;
1102 } 1115 }
1103 1116
1104 1117
1105 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { 1118 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
1106 return DoGenerateCode(isolate, this); 1119 return DoGenerateCode(isolate, this);
1107 } 1120 }
1108 1121
1109 1122
1110 } } // namespace v8::internal 1123 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698