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 9459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9470 AllocationSiteUsageContext* site_context) { | 9470 AllocationSiteUsageContext* site_context) { |
9471 NoObservableSideEffectsScope no_effects(this); | 9471 NoObservableSideEffectsScope no_effects(this); |
9472 InstanceType instance_type = boilerplate_object->map()->instance_type(); | 9472 InstanceType instance_type = boilerplate_object->map()->instance_type(); |
9473 ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE); | 9473 ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE); |
9474 | 9474 |
9475 HType type = instance_type == JS_ARRAY_TYPE | 9475 HType type = instance_type == JS_ARRAY_TYPE |
9476 ? HType::JSArray() : HType::JSObject(); | 9476 ? HType::JSArray() : HType::JSObject(); |
9477 HValue* object_size_constant = Add<HConstant>( | 9477 HValue* object_size_constant = Add<HConstant>( |
9478 boilerplate_object->map()->instance_size()); | 9478 boilerplate_object->map()->instance_size()); |
9479 | 9479 |
9480 // We should pull pre-tenure mode from the allocation site. | |
9481 // For now, just see what it says, and remark on it if it sez | |
9482 // we should pretenure. That means the rudimentary counting in the garbage | |
9483 // collector is having an effect. | |
9484 PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode(); | 9480 PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode(); |
9485 if (FLAG_allocation_site_pretenuring) { | 9481 if (FLAG_allocation_site_pretenuring) { |
9486 pretenure_flag = site_context->current()->GetPretenureMode() | 9482 pretenure_flag = site_context->current()->GetPretenureMode(); |
9487 ? TENURED | 9483 site_context->current()->AddDependentCompilationInfo( |
9488 : NOT_TENURED; | 9484 AllocationSite::TENURING, top_info()); |
9489 } | 9485 } |
9490 | 9486 |
9491 HInstruction* object = Add<HAllocate>(object_size_constant, type, | 9487 HInstruction* object = Add<HAllocate>(object_size_constant, type, |
9492 pretenure_flag, instance_type, site_context->current()); | 9488 pretenure_flag, instance_type, site_context->current()); |
9493 | 9489 |
9494 BuildEmitObjectHeader(boilerplate_object, object); | 9490 BuildEmitObjectHeader(boilerplate_object, object); |
9495 | 9491 |
9496 Handle<FixedArrayBase> elements(boilerplate_object->elements()); | 9492 Handle<FixedArrayBase> elements(boilerplate_object->elements()); |
9497 int elements_size = (elements->length() > 0 && | 9493 int elements_size = (elements->length() > 0 && |
9498 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? | 9494 elements->map() != isolate()->heap()->fixed_cow_array_map()) ? |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10944 if (ShouldProduceTraceOutput()) { | 10940 if (ShouldProduceTraceOutput()) { |
10945 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10941 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10946 } | 10942 } |
10947 | 10943 |
10948 #ifdef DEBUG | 10944 #ifdef DEBUG |
10949 graph_->Verify(false); // No full verify. | 10945 graph_->Verify(false); // No full verify. |
10950 #endif | 10946 #endif |
10951 } | 10947 } |
10952 | 10948 |
10953 } } // namespace v8::internal | 10949 } } // namespace v8::internal |
OLD | NEW |