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

Side by Side Diff: src/hydrogen.cc

Issue 132063004: More efficient use of space in AllocationSite. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 ASSERT(allocation_site != NULL); 2633 ASSERT(allocation_site != NULL);
2634 HInnerAllocatedObject* allocation_memento = Add<HInnerAllocatedObject>( 2634 HInnerAllocatedObject* allocation_memento = Add<HInnerAllocatedObject>(
2635 previous_object, previous_object_size); 2635 previous_object, previous_object_size);
2636 AddStoreMapConstant( 2636 AddStoreMapConstant(
2637 allocation_memento, isolate()->factory()->allocation_memento_map()); 2637 allocation_memento, isolate()->factory()->allocation_memento_map());
2638 Add<HStoreNamedField>( 2638 Add<HStoreNamedField>(
2639 allocation_memento, 2639 allocation_memento,
2640 HObjectAccess::ForAllocationMementoSite(), 2640 HObjectAccess::ForAllocationMementoSite(),
2641 allocation_site); 2641 allocation_site);
2642 if (FLAG_allocation_site_pretenuring) { 2642 if (FLAG_allocation_site_pretenuring) {
2643 HValue* memento_create_count = Add<HLoadNamedField>( 2643 // We want to add 1 to the memento create count. The field is actually a smi
2644 // bitfield, but the memento create count is in the lower 14 bits. Therefore
2645 // we don't need to mask and shift.
2646 STATIC_ASSERT(AllocationSite::MementoCreateCountBits::kShift == 0);
2647 HValue* pretenure_data = Add<HLoadNamedField>(
2644 allocation_site, HObjectAccess::ForAllocationSiteOffset( 2648 allocation_site, HObjectAccess::ForAllocationSiteOffset(
2645 AllocationSite::kMementoCreateCountOffset)); 2649 AllocationSite::kPretenureDataOffset));
2646 memento_create_count = AddUncasted<HAdd>( 2650 pretenure_data = AddUncasted<HAdd>(
2647 memento_create_count, graph()->GetConstant1()); 2651 pretenure_data, graph()->GetConstant1());
2648 // This smi value is reset to zero after every gc, overflow isn't a problem 2652 // This smi value is reset to zero after every gc, overflow isn't a problem
2649 // since the counter is bounded by the new space size. 2653 // since the counter is bounded by the new space size.
2650 memento_create_count->ClearFlag(HValue::kCanOverflow); 2654 pretenure_data->ClearFlag(HValue::kCanOverflow);
2651 HStoreNamedField* store = Add<HStoreNamedField>( 2655 HStoreNamedField* store = Add<HStoreNamedField>(
2652 allocation_site, HObjectAccess::ForAllocationSiteOffset( 2656 allocation_site, HObjectAccess::ForAllocationSiteOffset(
2653 AllocationSite::kMementoCreateCountOffset), memento_create_count); 2657 AllocationSite::kPretenureDataOffset), pretenure_data);
2654 // No write barrier needed to store a smi. 2658 // No write barrier needed to store a smi.
2655 store->SkipWriteBarrier(); 2659 store->SkipWriteBarrier();
2656 } 2660 }
2657 } 2661 }
2658 2662
2659 2663
2660 HInstruction* HGraphBuilder::BuildGetNativeContext(HValue* closure) { 2664 HInstruction* HGraphBuilder::BuildGetNativeContext(HValue* closure) {
2661 // Get the global context, then the native context 2665 // Get the global context, then the native context
2662 HInstruction* context = 2666 HInstruction* context =
2663 Add<HLoadNamedField>(closure, HObjectAccess::ForFunctionContextPointer()); 2667 Add<HLoadNamedField>(closure, HObjectAccess::ForFunctionContextPointer());
(...skipping 8297 matching lines...) Expand 10 before | Expand all | Expand 10 after
10961 if (ShouldProduceTraceOutput()) { 10965 if (ShouldProduceTraceOutput()) {
10962 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 10966 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
10963 } 10967 }
10964 10968
10965 #ifdef DEBUG 10969 #ifdef DEBUG
10966 graph_->Verify(false); // No full verify. 10970 graph_->Verify(false); // No full verify.
10967 #endif 10971 #endif
10968 } 10972 }
10969 10973
10970 } } // namespace v8::internal 10974 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698