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

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: Comment updates 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') | no next file with comments »
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 HStoreNamedField* store = Add<HStoreNamedField>(
481 object,
482 HObjectAccess::ForAllocationSiteDependentCode(),
483 empty_fixed_array);
484
477 // Link the object to the allocation site list 485 // Link the object to the allocation site list
478 HValue* site_list = Add<HConstant>( 486 HValue* site_list = Add<HConstant>(
479 ExternalReference::allocation_sites_list_address(isolate())); 487 ExternalReference::allocation_sites_list_address(isolate()));
480 HValue* site = Add<HLoadNamedField>(site_list, 488 HValue* site = Add<HLoadNamedField>(site_list,
481 HObjectAccess::ForAllocationSiteList()); 489 HObjectAccess::ForAllocationSiteList());
482 HStoreNamedField* store = 490 store = Add<HStoreNamedField>(object,
483 Add<HStoreNamedField>(object, HObjectAccess::ForAllocationSiteWeakNext(), 491 HObjectAccess::ForAllocationSiteWeakNext(),
484 site); 492 site);
485 store->SkipWriteBarrier(); 493 store->SkipWriteBarrier();
486 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(), 494 Add<HStoreNamedField>(site_list, HObjectAccess::ForAllocationSiteList(),
487 object); 495 object);
488 496
489 // We use a hammer (SkipWriteBarrier()) to indicate that we know the input 497 // 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. 498 // 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 499 // TODO(mvstanton): Add a debug_code check to verify the input cell is really
492 // a cell. (perhaps with a new instruction, HAssert). 500 // a cell. (perhaps with a new instruction, HAssert).
493 HInstruction* cell = GetParameter(0); 501 HInstruction* cell = GetParameter(0);
494 HObjectAccess access = HObjectAccess::ForCellValue(); 502 HObjectAccess access = HObjectAccess::ForCellValue();
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 return js_function; 1109 return js_function;
1102 } 1110 }
1103 1111
1104 1112
1105 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { 1113 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
1106 return DoGenerateCode(isolate, this); 1114 return DoGenerateCode(isolate, this);
1107 } 1115 }
1108 1116
1109 1117
1110 } } // namespace v8::internal 1118 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698