OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
(...skipping 3228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 DCHECK(allocation_site != NULL); | 3239 DCHECK(allocation_site != NULL); |
3240 HInnerAllocatedObject* allocation_memento = Add<HInnerAllocatedObject>( | 3240 HInnerAllocatedObject* allocation_memento = Add<HInnerAllocatedObject>( |
3241 previous_object, previous_object_size, HType::HeapObject()); | 3241 previous_object, previous_object_size, HType::HeapObject()); |
3242 AddStoreMapConstant( | 3242 AddStoreMapConstant( |
3243 allocation_memento, isolate()->factory()->allocation_memento_map()); | 3243 allocation_memento, isolate()->factory()->allocation_memento_map()); |
3244 Add<HStoreNamedField>( | 3244 Add<HStoreNamedField>( |
3245 allocation_memento, | 3245 allocation_memento, |
3246 HObjectAccess::ForAllocationMementoSite(), | 3246 HObjectAccess::ForAllocationMementoSite(), |
3247 allocation_site); | 3247 allocation_site); |
3248 if (FLAG_allocation_site_pretenuring) { | 3248 if (FLAG_allocation_site_pretenuring) { |
3249 HValue* memento_create_count = | 3249 // The memento created counter is embedded in the first 26 bits of pretenure |
3250 Add<HLoadNamedField>(allocation_site, nullptr, | 3250 // data. The value itself is bounded by new space size and cleared after |
3251 HObjectAccess::ForAllocationSiteOffset( | 3251 // every GC cycle. Overflow into the higher bits is thus not an issue. |
3252 AllocationSite::kPretenureCreateCountOffset)); | 3252 HValue* memento_create_count = Add<HLoadNamedField>( |
| 3253 allocation_site, nullptr, HObjectAccess::ForAllocationSiteOffset( |
| 3254 AllocationSite::kPretenureDataOffset)); |
3253 memento_create_count = AddUncasted<HAdd>( | 3255 memento_create_count = AddUncasted<HAdd>( |
3254 memento_create_count, graph()->GetConstant1()); | 3256 memento_create_count, graph()->GetConstant1()); |
3255 // This smi value is reset to zero after every gc, overflow isn't a problem | |
3256 // since the counter is bounded by the new space size. | |
3257 memento_create_count->ClearFlag(HValue::kCanOverflow); | 3257 memento_create_count->ClearFlag(HValue::kCanOverflow); |
3258 Add<HStoreNamedField>( | 3258 Add<HStoreNamedField>(allocation_site, |
3259 allocation_site, HObjectAccess::ForAllocationSiteOffset( | 3259 HObjectAccess::ForAllocationSiteOffset( |
3260 AllocationSite::kPretenureCreateCountOffset), memento_create_count); | 3260 AllocationSite::kPretenureDataOffset), |
| 3261 memento_create_count); |
3261 } | 3262 } |
3262 } | 3263 } |
3263 | 3264 |
3264 | 3265 |
3265 HInstruction* HGraphBuilder::BuildGetNativeContext() { | 3266 HInstruction* HGraphBuilder::BuildGetNativeContext() { |
3266 return Add<HLoadNamedField>( | 3267 return Add<HLoadNamedField>( |
3267 context(), nullptr, | 3268 context(), nullptr, |
3268 HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX)); | 3269 HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX)); |
3269 } | 3270 } |
3270 | 3271 |
(...skipping 10349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13620 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13621 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13621 } | 13622 } |
13622 | 13623 |
13623 #ifdef DEBUG | 13624 #ifdef DEBUG |
13624 graph_->Verify(false); // No full verify. | 13625 graph_->Verify(false); // No full verify. |
13625 #endif | 13626 #endif |
13626 } | 13627 } |
13627 | 13628 |
13628 } // namespace internal | 13629 } // namespace internal |
13629 } // namespace v8 | 13630 } // namespace v8 |
OLD | NEW |