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 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 } | 1827 } |
1828 | 1828 |
1829 bool result_saved = false; // Is the result saved to the stack? | 1829 bool result_saved = false; // Is the result saved to the stack? |
1830 | 1830 |
1831 // Emit code to evaluate all the non-constant subexpressions and to store | 1831 // Emit code to evaluate all the non-constant subexpressions and to store |
1832 // them into the newly cloned array. | 1832 // them into the newly cloned array. |
1833 for (int i = 0; i < length; i++) { | 1833 for (int i = 0; i < length; i++) { |
1834 Expression* subexpr = subexprs->at(i); | 1834 Expression* subexpr = subexprs->at(i); |
1835 // If the subexpression is a literal or a simple materialized literal it | 1835 // If the subexpression is a literal or a simple materialized literal it |
1836 // is already set in the cloned array. | 1836 // is already set in the cloned array. |
1837 if (subexpr->AsLiteral() != NULL || | 1837 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
1838 CompileTimeValue::IsCompileTimeValue(subexpr)) { | |
1839 continue; | |
1840 } | |
1841 | 1838 |
1842 if (!result_saved) { | 1839 if (!result_saved) { |
1843 __ push(v0); // array literal | 1840 __ push(v0); // array literal |
1844 __ Push(Smi::FromInt(expr->literal_index())); | 1841 __ Push(Smi::FromInt(expr->literal_index())); |
1845 result_saved = true; | 1842 result_saved = true; |
1846 } | 1843 } |
1847 | 1844 |
1848 VisitForAccumulatorValue(subexpr); | 1845 VisitForAccumulatorValue(subexpr); |
1849 | 1846 |
1850 if (IsFastObjectElementsKind(constant_elements_kind)) { | 1847 if (IsFastObjectElementsKind(constant_elements_kind)) { |
(...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4951 *context_length = 0; | 4948 *context_length = 0; |
4952 return previous_; | 4949 return previous_; |
4953 } | 4950 } |
4954 | 4951 |
4955 | 4952 |
4956 #undef __ | 4953 #undef __ |
4957 | 4954 |
4958 } } // namespace v8::internal | 4955 } } // namespace v8::internal |
4959 | 4956 |
4960 #endif // V8_TARGET_ARCH_MIPS | 4957 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |