| 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 5102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5113 AllocationSiteUsageContext usage_context(isolate(), site, false); | 5113 AllocationSiteUsageContext usage_context(isolate(), site, false); |
| 5114 usage_context.EnterNewScope(); | 5114 usage_context.EnterNewScope(); |
| 5115 literal = BuildFastLiteral(boilerplate_object, &usage_context); | 5115 literal = BuildFastLiteral(boilerplate_object, &usage_context); |
| 5116 usage_context.ExitScope(site, boilerplate_object); | 5116 usage_context.ExitScope(site, boilerplate_object); |
| 5117 } else { | 5117 } else { |
| 5118 NoObservableSideEffectsScope no_effects(this); | 5118 NoObservableSideEffectsScope no_effects(this); |
| 5119 // Boilerplate already exists and constant elements are never accessed, | 5119 // Boilerplate already exists and constant elements are never accessed, |
| 5120 // pass an empty fixed array to the runtime function instead. | 5120 // pass an empty fixed array to the runtime function instead. |
| 5121 Handle<FixedArray> constants = isolate()->factory()->empty_fixed_array(); | 5121 Handle<FixedArray> constants = isolate()->factory()->empty_fixed_array(); |
| 5122 int literal_index = expr->literal_index(); | 5122 int literal_index = expr->literal_index(); |
| 5123 int flags = expr->depth() == 1 |
| 5124 ? ArrayLiteral::kShallowElements |
| 5125 : ArrayLiteral::kNoFlags; |
| 5126 flags |= ArrayLiteral::kDisableMementos; |
| 5123 | 5127 |
| 5124 Add<HPushArgument>(Add<HConstant>(literals)); | 5128 Add<HPushArgument>(Add<HConstant>(literals)); |
| 5125 Add<HPushArgument>(Add<HConstant>(literal_index)); | 5129 Add<HPushArgument>(Add<HConstant>(literal_index)); |
| 5126 Add<HPushArgument>(Add<HConstant>(constants)); | 5130 Add<HPushArgument>(Add<HConstant>(constants)); |
| 5131 Add<HPushArgument>(Add<HConstant>(flags)); |
| 5127 | 5132 |
| 5128 // TODO(mvstanton): Consider a flag to turn off creation of any | 5133 // TODO(mvstanton): Consider a flag to turn off creation of any |
| 5129 // AllocationMementos for this call: we are in crankshaft and should have | 5134 // AllocationMementos for this call: we are in crankshaft and should have |
| 5130 // learned enough about transition behavior to stop emitting mementos. | 5135 // learned enough about transition behavior to stop emitting mementos. |
| 5131 Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; | 5136 Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; |
| 5132 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), | 5137 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| 5133 Runtime::FunctionForId(function_id), | 5138 Runtime::FunctionForId(function_id), |
| 5134 3); | 5139 4); |
| 5135 | 5140 |
| 5136 // De-opt if elements kind changed from boilerplate_elements_kind. | 5141 // De-opt if elements kind changed from boilerplate_elements_kind. |
| 5137 Handle<Map> map = Handle<Map>(boilerplate_object->map(), isolate()); | 5142 Handle<Map> map = Handle<Map>(boilerplate_object->map(), isolate()); |
| 5138 literal = Add<HCheckMaps>(literal, map, top_info()); | 5143 literal = Add<HCheckMaps>(literal, map, top_info()); |
| 5139 } | 5144 } |
| 5140 | 5145 |
| 5141 // The array is expected in the bailout environment during computation | 5146 // The array is expected in the bailout environment during computation |
| 5142 // of the property values and is the value of the entire expression. | 5147 // of the property values and is the value of the entire expression. |
| 5143 Push(literal); | 5148 Push(literal); |
| 5144 // The literal index is on the stack, too. | 5149 // The literal index is on the stack, too. |
| (...skipping 5525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10670 if (ShouldProduceTraceOutput()) { | 10675 if (ShouldProduceTraceOutput()) { |
| 10671 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10676 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 10672 } | 10677 } |
| 10673 | 10678 |
| 10674 #ifdef DEBUG | 10679 #ifdef DEBUG |
| 10675 graph_->Verify(false); // No full verify. | 10680 graph_->Verify(false); // No full verify. |
| 10676 #endif | 10681 #endif |
| 10677 } | 10682 } |
| 10678 | 10683 |
| 10679 } } // namespace v8::internal | 10684 } } // namespace v8::internal |
| OLD | NEW |