OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 } | 754 } |
755 } | 755 } |
756 } | 756 } |
757 | 757 |
758 | 758 |
759 void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 759 void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
760 Comment cmnt(masm_, "[ ArrayLiteral"); | 760 Comment cmnt(masm_, "[ ArrayLiteral"); |
761 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 761 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
762 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 762 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
763 __ Push(Smi::FromInt(expr->literal_index())); | 763 __ Push(Smi::FromInt(expr->literal_index())); |
764 __ Push(expr->literals()); | 764 __ Push(expr->constant_elements()); |
765 if (expr->depth() > 1) { | 765 if (expr->depth() > 1) { |
766 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 766 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
767 } else { | 767 } else { |
768 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 768 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
769 } | 769 } |
770 | 770 |
771 bool result_saved = false; // Is the result saved to the stack? | 771 bool result_saved = false; // Is the result saved to the stack? |
772 | 772 |
773 // Emit code to evaluate all the non-constant subexpressions and to store | 773 // Emit code to evaluate all the non-constant subexpressions and to store |
774 // them into the newly cloned array. | 774 // them into the newly cloned array. |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 __ movq(Operand(rsp, 0), rdx); | 1720 __ movq(Operand(rsp, 0), rdx); |
1721 // And return. | 1721 // And return. |
1722 __ ret(0); | 1722 __ ret(0); |
1723 } | 1723 } |
1724 | 1724 |
1725 | 1725 |
1726 #undef __ | 1726 #undef __ |
1727 | 1727 |
1728 | 1728 |
1729 } } // namespace v8::internal | 1729 } } // namespace v8::internal |
OLD | NEW |