OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6066 literal = AddInstruction( | 6066 literal = AddInstruction( |
6067 new(zone()) HCallRuntime(context, | 6067 new(zone()) HCallRuntime(context, |
6068 isolate()->factory()->empty_string(), | 6068 isolate()->factory()->empty_string(), |
6069 Runtime::FunctionForId(function_id), | 6069 Runtime::FunctionForId(function_id), |
6070 3)); | 6070 3)); |
6071 } | 6071 } |
6072 | 6072 |
6073 // The array is expected in the bailout environment during computation | 6073 // The array is expected in the bailout environment during computation |
6074 // of the property values and is the value of the entire expression. | 6074 // of the property values and is the value of the entire expression. |
6075 Push(literal); | 6075 Push(literal); |
| 6076 // The literal index is on the stack, too. |
| 6077 Push(AddInstruction(new(zone()) HConstant(expr->literal_index()))); |
6076 | 6078 |
6077 HInstruction* elements = NULL; | 6079 HInstruction* elements = NULL; |
6078 | 6080 |
6079 for (int i = 0; i < length; i++) { | 6081 for (int i = 0; i < length; i++) { |
6080 Expression* subexpr = subexprs->at(i); | 6082 Expression* subexpr = subexprs->at(i); |
6081 // If the subexpression is a literal or a simple materialized literal it | 6083 // If the subexpression is a literal or a simple materialized literal it |
6082 // is already set in the cloned array. | 6084 // is already set in the cloned array. |
6083 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 6085 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
6084 | 6086 |
6085 CHECK_ALIVE(VisitForValue(subexpr)); | 6087 CHECK_ALIVE(VisitForValue(subexpr)); |
(...skipping 17 matching lines...) Expand all Loading... |
6103 value, | 6105 value, |
6104 boilerplate_elements_kind)); | 6106 boilerplate_elements_kind)); |
6105 break; | 6107 break; |
6106 default: | 6108 default: |
6107 UNREACHABLE(); | 6109 UNREACHABLE(); |
6108 break; | 6110 break; |
6109 } | 6111 } |
6110 | 6112 |
6111 AddSimulate(expr->GetIdForElement(i)); | 6113 AddSimulate(expr->GetIdForElement(i)); |
6112 } | 6114 } |
| 6115 |
| 6116 Drop(1); // array literal index |
6113 return ast_context()->ReturnValue(Pop()); | 6117 return ast_context()->ReturnValue(Pop()); |
6114 } | 6118 } |
6115 | 6119 |
6116 | 6120 |
6117 // Sets the lookup result and returns true if the load/store can be inlined. | 6121 // Sets the lookup result and returns true if the load/store can be inlined. |
6118 static bool ComputeLoadStoreField(Handle<Map> type, | 6122 static bool ComputeLoadStoreField(Handle<Map> type, |
6119 Handle<String> name, | 6123 Handle<String> name, |
6120 LookupResult* lookup, | 6124 LookupResult* lookup, |
6121 bool is_store) { | 6125 bool is_store) { |
6122 if (type->has_named_interceptor()) { | 6126 if (type->has_named_interceptor()) { |
(...skipping 5448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11571 } | 11575 } |
11572 } | 11576 } |
11573 | 11577 |
11574 #ifdef DEBUG | 11578 #ifdef DEBUG |
11575 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11579 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
11576 if (allocator_ != NULL) allocator_->Verify(); | 11580 if (allocator_ != NULL) allocator_->Verify(); |
11577 #endif | 11581 #endif |
11578 } | 11582 } |
11579 | 11583 |
11580 } } // namespace v8::internal | 11584 } } // namespace v8::internal |
OLD | NEW |