| 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-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 6056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6067 Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; | 6067 Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; |
| 6068 literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); | 6068 literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); |
| 6069 | 6069 |
| 6070 // Register to deopt if the boilerplate ElementsKind changes. | 6070 // Register to deopt if the boilerplate ElementsKind changes. |
| 6071 top_info()->dependencies()->AssumeTransitionStable(site); | 6071 top_info()->dependencies()->AssumeTransitionStable(site); |
| 6072 } | 6072 } |
| 6073 | 6073 |
| 6074 // The array is expected in the bailout environment during computation | 6074 // The array is expected in the bailout environment during computation |
| 6075 // of the property values and is the value of the entire expression. | 6075 // of the property values and is the value of the entire expression. |
| 6076 Push(literal); | 6076 Push(literal); |
| 6077 // The literal index is on the stack, too. | |
| 6078 Push(Add<HConstant>(expr->literal_index())); | |
| 6079 | 6077 |
| 6080 HInstruction* elements = NULL; | 6078 HInstruction* elements = NULL; |
| 6081 | 6079 |
| 6082 for (int i = 0; i < length; i++) { | 6080 for (int i = 0; i < length; i++) { |
| 6083 Expression* subexpr = subexprs->at(i); | 6081 Expression* subexpr = subexprs->at(i); |
| 6084 if (subexpr->IsSpread()) { | 6082 if (subexpr->IsSpread()) { |
| 6085 return Bailout(kSpread); | 6083 return Bailout(kSpread); |
| 6086 } | 6084 } |
| 6087 | 6085 |
| 6088 // If the subexpression is a literal or a simple materialized literal it | 6086 // If the subexpression is a literal or a simple materialized literal it |
| (...skipping 21 matching lines...) Expand all Loading... |
| 6110 break; | 6108 break; |
| 6111 } | 6109 } |
| 6112 default: | 6110 default: |
| 6113 UNREACHABLE(); | 6111 UNREACHABLE(); |
| 6114 break; | 6112 break; |
| 6115 } | 6113 } |
| 6116 | 6114 |
| 6117 Add<HSimulate>(expr->GetIdForElement(i)); | 6115 Add<HSimulate>(expr->GetIdForElement(i)); |
| 6118 } | 6116 } |
| 6119 | 6117 |
| 6120 Drop(1); // array literal index | |
| 6121 return ast_context()->ReturnValue(Pop()); | 6118 return ast_context()->ReturnValue(Pop()); |
| 6122 } | 6119 } |
| 6123 | 6120 |
| 6124 | 6121 |
| 6125 HCheckMaps* HOptimizedGraphBuilder::AddCheckMap(HValue* object, | 6122 HCheckMaps* HOptimizedGraphBuilder::AddCheckMap(HValue* object, |
| 6126 Handle<Map> map) { | 6123 Handle<Map> map) { |
| 6127 BuildCheckHeapObject(object); | 6124 BuildCheckHeapObject(object); |
| 6128 return Add<HCheckMaps>(object, map); | 6125 return Add<HCheckMaps>(object, map); |
| 6129 } | 6126 } |
| 6130 | 6127 |
| (...skipping 7506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13637 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13634 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13638 } | 13635 } |
| 13639 | 13636 |
| 13640 #ifdef DEBUG | 13637 #ifdef DEBUG |
| 13641 graph_->Verify(false); // No full verify. | 13638 graph_->Verify(false); // No full verify. |
| 13642 #endif | 13639 #endif |
| 13643 } | 13640 } |
| 13644 | 13641 |
| 13645 } // namespace internal | 13642 } // namespace internal |
| 13646 } // namespace v8 | 13643 } // namespace v8 |
| OLD | NEW |