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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 Push(Add<HLoadKeyed>(number_string_cache, value_index, | 1747 Push(Add<HLoadKeyed>(number_string_cache, value_index, |
1748 static_cast<HValue*>(NULL), | 1748 static_cast<HValue*>(NULL), |
1749 FAST_ELEMENTS, ALLOW_RETURN_HOLE)); | 1749 FAST_ELEMENTS, ALLOW_RETURN_HOLE)); |
1750 } | 1750 } |
1751 if_found.Else(); | 1751 if_found.Else(); |
1752 { | 1752 { |
1753 // Cache miss, fallback to runtime. | 1753 // Cache miss, fallback to runtime. |
1754 Add<HPushArgument>(object); | 1754 Add<HPushArgument>(object); |
1755 Push(Add<HCallRuntime>( | 1755 Push(Add<HCallRuntime>( |
1756 isolate()->factory()->empty_string(), | 1756 isolate()->factory()->empty_string(), |
1757 Runtime::FunctionForId(Runtime::kNumberToStringSkipCache), | 1757 Runtime::FunctionForId(Runtime::kHiddenNumberToStringSkipCache), |
1758 1)); | 1758 1)); |
1759 } | 1759 } |
1760 if_found.End(); | 1760 if_found.End(); |
1761 | 1761 |
1762 return Pop(); | 1762 return Pop(); |
1763 } | 1763 } |
1764 | 1764 |
1765 | 1765 |
1766 HAllocate* HGraphBuilder::BuildAllocate( | 1766 HAllocate* HGraphBuilder::BuildAllocate( |
1767 HValue* object_size, | 1767 HValue* object_size, |
(...skipping 3333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5101 ? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags; | 5101 ? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags; |
5102 | 5102 |
5103 Add<HPushArgument>(Add<HConstant>(closure_literals)); | 5103 Add<HPushArgument>(Add<HConstant>(closure_literals)); |
5104 Add<HPushArgument>(Add<HConstant>(literal_index)); | 5104 Add<HPushArgument>(Add<HConstant>(literal_index)); |
5105 Add<HPushArgument>(Add<HConstant>(constant_properties)); | 5105 Add<HPushArgument>(Add<HConstant>(constant_properties)); |
5106 Add<HPushArgument>(Add<HConstant>(flags)); | 5106 Add<HPushArgument>(Add<HConstant>(flags)); |
5107 | 5107 |
5108 // TODO(mvstanton): Add a flag to turn off creation of any | 5108 // TODO(mvstanton): Add a flag to turn off creation of any |
5109 // AllocationMementos for this call: we are in crankshaft and should have | 5109 // AllocationMementos for this call: we are in crankshaft and should have |
5110 // learned enough about transition behavior to stop emitting mementos. | 5110 // learned enough about transition behavior to stop emitting mementos. |
5111 Runtime::FunctionId function_id = Runtime::kCreateObjectLiteral; | 5111 Runtime::FunctionId function_id = Runtime::kHiddenCreateObjectLiteral; |
5112 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), | 5112 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
5113 Runtime::FunctionForId(function_id), | 5113 Runtime::FunctionForId(function_id), |
5114 4); | 5114 4); |
5115 } | 5115 } |
5116 | 5116 |
5117 // The object is expected in the bailout environment during computation | 5117 // The object is expected in the bailout environment during computation |
5118 // of the property values and is the value of the entire expression. | 5118 // of the property values and is the value of the entire expression. |
5119 Push(literal); | 5119 Push(literal); |
5120 | 5120 |
5121 expr->CalculateEmitStore(zone()); | 5121 expr->CalculateEmitStore(zone()); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5258 flags |= ArrayLiteral::kDisableMementos; | 5258 flags |= ArrayLiteral::kDisableMementos; |
5259 | 5259 |
5260 Add<HPushArgument>(Add<HConstant>(literals)); | 5260 Add<HPushArgument>(Add<HConstant>(literals)); |
5261 Add<HPushArgument>(Add<HConstant>(literal_index)); | 5261 Add<HPushArgument>(Add<HConstant>(literal_index)); |
5262 Add<HPushArgument>(Add<HConstant>(constants)); | 5262 Add<HPushArgument>(Add<HConstant>(constants)); |
5263 Add<HPushArgument>(Add<HConstant>(flags)); | 5263 Add<HPushArgument>(Add<HConstant>(flags)); |
5264 | 5264 |
5265 // TODO(mvstanton): Consider a flag to turn off creation of any | 5265 // TODO(mvstanton): Consider a flag to turn off creation of any |
5266 // AllocationMementos for this call: we are in crankshaft and should have | 5266 // AllocationMementos for this call: we are in crankshaft and should have |
5267 // learned enough about transition behavior to stop emitting mementos. | 5267 // learned enough about transition behavior to stop emitting mementos. |
5268 Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; | 5268 Runtime::FunctionId function_id = Runtime::kHiddenCreateArrayLiteral; |
5269 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), | 5269 literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
5270 Runtime::FunctionForId(function_id), | 5270 Runtime::FunctionForId(function_id), |
5271 4); | 5271 4); |
5272 | 5272 |
5273 // De-opt if elements kind changed from boilerplate_elements_kind. | 5273 // De-opt if elements kind changed from boilerplate_elements_kind. |
5274 Handle<Map> map = Handle<Map>(boilerplate_object->map(), isolate()); | 5274 Handle<Map> map = Handle<Map>(boilerplate_object->map(), isolate()); |
5275 literal = Add<HCheckMaps>(literal, map, top_info()); | 5275 literal = Add<HCheckMaps>(literal, map, top_info()); |
5276 } | 5276 } |
5277 | 5277 |
5278 // The array is expected in the bailout environment during computation | 5278 // The array is expected in the bailout environment during computation |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6176 // We don't optimize functions with invalid left-hand sides in | 6176 // We don't optimize functions with invalid left-hand sides in |
6177 // assignments, count operations, or for-in. Consequently throw can | 6177 // assignments, count operations, or for-in. Consequently throw can |
6178 // currently only occur in an effect context. | 6178 // currently only occur in an effect context. |
6179 ASSERT(ast_context()->IsEffect()); | 6179 ASSERT(ast_context()->IsEffect()); |
6180 CHECK_ALIVE(VisitForValue(expr->exception())); | 6180 CHECK_ALIVE(VisitForValue(expr->exception())); |
6181 | 6181 |
6182 HValue* value = environment()->Pop(); | 6182 HValue* value = environment()->Pop(); |
6183 if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position()); | 6183 if (!FLAG_hydrogen_track_positions) SetSourcePosition(expr->position()); |
6184 Add<HPushArgument>(value); | 6184 Add<HPushArgument>(value); |
6185 Add<HCallRuntime>(isolate()->factory()->empty_string(), | 6185 Add<HCallRuntime>(isolate()->factory()->empty_string(), |
6186 Runtime::FunctionForId(Runtime::kThrow), 1); | 6186 Runtime::FunctionForId(Runtime::kHiddenThrow), 1); |
6187 Add<HSimulate>(expr->id()); | 6187 Add<HSimulate>(expr->id()); |
6188 | 6188 |
6189 // If the throw definitely exits the function, we can finish with a dummy | 6189 // If the throw definitely exits the function, we can finish with a dummy |
6190 // control flow at this point. This is not the case if the throw is inside | 6190 // control flow at this point. This is not the case if the throw is inside |
6191 // an inlined function which may be replaced. | 6191 // an inlined function which may be replaced. |
6192 if (call_context() == NULL) { | 6192 if (call_context() == NULL) { |
6193 FinishExitCurrentBlock(New<HAbnormalExit>()); | 6193 FinishExitCurrentBlock(New<HAbnormalExit>()); |
6194 } | 6194 } |
6195 } | 6195 } |
6196 | 6196 |
(...skipping 5114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11311 if (ShouldProduceTraceOutput()) { | 11311 if (ShouldProduceTraceOutput()) { |
11312 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11312 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11313 } | 11313 } |
11314 | 11314 |
11315 #ifdef DEBUG | 11315 #ifdef DEBUG |
11316 graph_->Verify(false); // No full verify. | 11316 graph_->Verify(false); // No full verify. |
11317 #endif | 11317 #endif |
11318 } | 11318 } |
11319 | 11319 |
11320 } } // namespace v8::internal | 11320 } } // namespace v8::internal |
OLD | NEW |