| 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 } | 1799 } |
| 1800 | 1800 |
| 1801 bool result_saved = false; // Is the result saved to the stack? | 1801 bool result_saved = false; // Is the result saved to the stack? |
| 1802 | 1802 |
| 1803 // Emit code to evaluate all the non-constant subexpressions and to store | 1803 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1804 // them into the newly cloned array. | 1804 // them into the newly cloned array. |
| 1805 for (int i = 0; i < length; i++) { | 1805 for (int i = 0; i < length; i++) { |
| 1806 Expression* subexpr = subexprs->at(i); | 1806 Expression* subexpr = subexprs->at(i); |
| 1807 // If the subexpression is a literal or a simple materialized literal it | 1807 // If the subexpression is a literal or a simple materialized literal it |
| 1808 // is already set in the cloned array. | 1808 // is already set in the cloned array. |
| 1809 if (subexpr->AsLiteral() != NULL || | 1809 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1810 CompileTimeValue::IsCompileTimeValue(subexpr)) { | |
| 1811 continue; | |
| 1812 } | |
| 1813 | 1810 |
| 1814 if (!result_saved) { | 1811 if (!result_saved) { |
| 1815 __ push(rax); // array literal | 1812 __ push(rax); // array literal |
| 1816 __ Push(Smi::FromInt(expr->literal_index())); | 1813 __ Push(Smi::FromInt(expr->literal_index())); |
| 1817 result_saved = true; | 1814 result_saved = true; |
| 1818 } | 1815 } |
| 1819 VisitForAccumulatorValue(subexpr); | 1816 VisitForAccumulatorValue(subexpr); |
| 1820 | 1817 |
| 1821 if (IsFastObjectElementsKind(constant_elements_kind)) { | 1818 if (IsFastObjectElementsKind(constant_elements_kind)) { |
| 1822 // Fast-case array literal with ElementsKind of FAST_*_ELEMENTS, they | 1819 // Fast-case array literal with ElementsKind of FAST_*_ELEMENTS, they |
| (...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4909 *context_length = 0; | 4906 *context_length = 0; |
| 4910 return previous_; | 4907 return previous_; |
| 4911 } | 4908 } |
| 4912 | 4909 |
| 4913 | 4910 |
| 4914 #undef __ | 4911 #undef __ |
| 4915 | 4912 |
| 4916 } } // namespace v8::internal | 4913 } } // namespace v8::internal |
| 4917 | 4914 |
| 4918 #endif // V8_TARGET_ARCH_X64 | 4915 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |