Chromium Code Reviews| 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 5750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5761 ASSERT(current_block()->HasPredecessor()); | 5761 ASSERT(current_block()->HasPredecessor()); |
| 5762 ZoneList<Expression*>* subexprs = expr->values(); | 5762 ZoneList<Expression*>* subexprs = expr->values(); |
| 5763 int length = subexprs->length(); | 5763 int length = subexprs->length(); |
| 5764 HValue* context = environment()->LookupContext(); | 5764 HValue* context = environment()->LookupContext(); |
| 5765 HInstruction* literal; | 5765 HInstruction* literal; |
| 5766 | 5766 |
| 5767 Handle<FixedArray> literals(environment()->closure()->literals(), isolate()); | 5767 Handle<FixedArray> literals(environment()->closure()->literals(), isolate()); |
| 5768 Handle<Object> raw_boilerplate(literals->get(expr->literal_index()), | 5768 Handle<Object> raw_boilerplate(literals->get(expr->literal_index()), |
| 5769 isolate()); | 5769 isolate()); |
| 5770 | 5770 |
| 5771 bool uninitialized= false; | |
|
Jakob Kummerow
2013/07/01 13:42:57
nit: spaces around '='
| |
| 5771 if (raw_boilerplate->IsUndefined()) { | 5772 if (raw_boilerplate->IsUndefined()) { |
| 5773 uninitialized = true; | |
| 5772 raw_boilerplate = Runtime::CreateArrayLiteralBoilerplate( | 5774 raw_boilerplate = Runtime::CreateArrayLiteralBoilerplate( |
| 5773 isolate(), literals, expr->constant_elements()); | 5775 isolate(), literals, expr->constant_elements()); |
| 5774 if (raw_boilerplate.is_null()) { | 5776 if (raw_boilerplate.is_null()) { |
| 5775 return Bailout("array boilerplate creation failed"); | 5777 return Bailout("array boilerplate creation failed"); |
| 5776 } | 5778 } |
| 5777 literals->set(expr->literal_index(), *raw_boilerplate); | 5779 literals->set(expr->literal_index(), *raw_boilerplate); |
| 5778 if (JSObject::cast(*raw_boilerplate)->elements()->map() == | 5780 if (JSObject::cast(*raw_boilerplate)->elements()->map() == |
| 5779 isolate()->heap()->fixed_cow_array_map()) { | 5781 isolate()->heap()->fixed_cow_array_map()) { |
| 5780 isolate()->counters()->cow_arrays_created_runtime()->Increment(); | 5782 isolate()->counters()->cow_arrays_created_runtime()->Increment(); |
| 5781 } | 5783 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5858 | 5860 |
| 5859 HValue* key = Add<HConstant>(i); | 5861 HValue* key = Add<HConstant>(i); |
| 5860 | 5862 |
| 5861 switch (boilerplate_elements_kind) { | 5863 switch (boilerplate_elements_kind) { |
| 5862 case FAST_SMI_ELEMENTS: | 5864 case FAST_SMI_ELEMENTS: |
| 5863 case FAST_HOLEY_SMI_ELEMENTS: | 5865 case FAST_HOLEY_SMI_ELEMENTS: |
| 5864 case FAST_ELEMENTS: | 5866 case FAST_ELEMENTS: |
| 5865 case FAST_HOLEY_ELEMENTS: | 5867 case FAST_HOLEY_ELEMENTS: |
| 5866 case FAST_DOUBLE_ELEMENTS: | 5868 case FAST_DOUBLE_ELEMENTS: |
| 5867 case FAST_HOLEY_DOUBLE_ELEMENTS: | 5869 case FAST_HOLEY_DOUBLE_ELEMENTS: |
| 5868 Add<HStoreKeyed>(elements, key, value, | 5870 { |
|
Jakob Kummerow
2013/07/01 13:42:57
nit: the opening '{' can go on the line before, re
| |
| 5869 boilerplate_elements_kind); | 5871 HStoreKeyed* instr = Add<HStoreKeyed>(elements, key, value, |
| 5870 break; | 5872 boilerplate_elements_kind); |
| 5873 instr->SetUninitialized(uninitialized); | |
| 5874 break; | |
| 5875 } | |
| 5871 default: | 5876 default: |
| 5872 UNREACHABLE(); | 5877 UNREACHABLE(); |
| 5873 break; | 5878 break; |
| 5874 } | 5879 } |
| 5875 | 5880 |
| 5876 AddSimulate(expr->GetIdForElement(i)); | 5881 AddSimulate(expr->GetIdForElement(i)); |
| 5877 } | 5882 } |
| 5878 | 5883 |
| 5879 Drop(1); // array literal index | 5884 Drop(1); // array literal index |
| 5880 return ast_context()->ReturnValue(Pop()); | 5885 return ast_context()->ReturnValue(Pop()); |
| (...skipping 5363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11244 if (ShouldProduceTraceOutput()) { | 11249 if (ShouldProduceTraceOutput()) { |
| 11245 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11250 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11246 } | 11251 } |
| 11247 | 11252 |
| 11248 #ifdef DEBUG | 11253 #ifdef DEBUG |
| 11249 graph_->Verify(false); // No full verify. | 11254 graph_->Verify(false); // No full verify. |
| 11250 #endif | 11255 #endif |
| 11251 } | 11256 } |
| 11252 | 11257 |
| 11253 } } // namespace v8::internal | 11258 } } // namespace v8::internal |
| OLD | NEW |