OLD | NEW |
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 9326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9337 AllocationSiteUsageContext* site_context) { | 9337 AllocationSiteUsageContext* site_context) { |
9338 NoObservableSideEffectsScope no_effects(this); | 9338 NoObservableSideEffectsScope no_effects(this); |
9339 InstanceType instance_type = boilerplate_object->map()->instance_type(); | 9339 InstanceType instance_type = boilerplate_object->map()->instance_type(); |
9340 ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE); | 9340 ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE); |
9341 | 9341 |
9342 HType type = instance_type == JS_ARRAY_TYPE | 9342 HType type = instance_type == JS_ARRAY_TYPE |
9343 ? HType::JSArray() : HType::JSObject(); | 9343 ? HType::JSArray() : HType::JSObject(); |
9344 HValue* object_size_constant = Add<HConstant>( | 9344 HValue* object_size_constant = Add<HConstant>( |
9345 boilerplate_object->map()->instance_size()); | 9345 boilerplate_object->map()->instance_size()); |
9346 | 9346 |
9347 // We should pull pre-tenure mode from the allocation site. | 9347 PretenureFlag pretenure_flag = site_context->current()->GetPretenureMode(); |
9348 // For now, just see what it says, and remark on it if it sez | 9348 |
9349 // we should pretenure. That means the rudimentary counting in the garbage | 9349 site_context->current()->AddDependentCompilationInfo( |
9350 // collector is having an effect. | 9350 AllocationSite::TENURING, top_info()); |
9351 PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode(); | |
9352 if (FLAG_allocation_site_pretenuring) { | |
9353 pretenure_flag = site_context->current()->GetPretenureMode() | |
9354 ? TENURED | |
9355 : NOT_TENURED; | |
9356 } | |
9357 | 9351 |
9358 HInstruction* object = Add<HAllocate>(object_size_constant, type, | 9352 HInstruction* object = Add<HAllocate>(object_size_constant, type, |
9359 pretenure_flag, instance_type, site_context->current()); | 9353 pretenure_flag, instance_type, site_context->current()); |
9360 | 9354 |
9361 BuildEmitObjectHeader(boilerplate_object, object); | 9355 BuildEmitObjectHeader(boilerplate_object, object); |
9362 | 9356 |
9363 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | 9357 Handle<FixedArrayBase> elements(boilerplate_object->elements()); |
9364 int elements_size = (elements->length() > 0 && | 9358 int elements_size = (elements->length() > 0 && |
9365 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? | 9359 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? |
9366 elements->Size() : 0; | 9360 elements->Size() : 0; |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10808 if (ShouldProduceTraceOutput()) { | 10802 if (ShouldProduceTraceOutput()) { |
10809 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10803 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10810 } | 10804 } |
10811 | 10805 |
10812 #ifdef DEBUG | 10806 #ifdef DEBUG |
10813 graph_->Verify(false); // No full verify. | 10807 graph_->Verify(false); // No full verify. |
10814 #endif | 10808 #endif |
10815 } | 10809 } |
10816 | 10810 |
10817 } } // namespace v8::internal | 10811 } } // namespace v8::internal |
OLD | NEW |