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

Side by Side Diff: src/ia32/fast-codegen-ia32.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/ia32/codegen-ia32.cc ('k') | src/parser.cc » ('j') | 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 } 745 }
746 } 746 }
747 } 747 }
748 748
749 749
750 void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { 750 void FastCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
751 Comment cmnt(masm_, "[ ArrayLiteral"); 751 Comment cmnt(masm_, "[ ArrayLiteral");
752 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 752 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
753 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); 753 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
754 __ push(Immediate(Smi::FromInt(expr->literal_index()))); 754 __ push(Immediate(Smi::FromInt(expr->literal_index())));
755 __ push(Immediate(expr->literals())); 755 __ push(Immediate(expr->constant_elements()));
756 if (expr->depth() > 1) { 756 if (expr->depth() > 1) {
757 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); 757 __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
758 } else { 758 } else {
759 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); 759 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
760 } 760 }
761 761
762 bool result_saved = false; // Is the result saved to the stack? 762 bool result_saved = false; // Is the result saved to the stack?
763 763
764 // Emit code to evaluate all the non-constant subexpressions and to store 764 // Emit code to evaluate all the non-constant subexpressions and to store
765 // them into the newly cloned array. 765 // them into the newly cloned array.
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 __ add(Operand(edx), Immediate(masm_->CodeObject())); 1702 __ add(Operand(edx), Immediate(masm_->CodeObject()));
1703 __ mov(Operand(esp, 0), edx); 1703 __ mov(Operand(esp, 0), edx);
1704 // And return. 1704 // And return.
1705 __ ret(0); 1705 __ ret(0);
1706 } 1706 }
1707 1707
1708 1708
1709 #undef __ 1709 #undef __
1710 1710
1711 } } // namespace v8::internal 1711 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698