Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: src/x64/fast-codegen-x64.cc

Issue 507036: Use one runtime call for creating object/array literals in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698