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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 2116003: ARM: Pass arguments to keyed store IC in registers... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 7 months 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/arm/debug-arm.cc ('k') | src/arm/ic-arm.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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 VisitForValue(prop->obj(), kStack); 635 VisitForValue(prop->obj(), kStack);
636 VisitForValue(prop->key(), kStack); 636 VisitForValue(prop->key(), kStack);
637 637
638 if (decl->fun() != NULL) { 638 if (decl->fun() != NULL) {
639 VisitForValue(decl->fun(), kAccumulator); 639 VisitForValue(decl->fun(), kAccumulator);
640 } else { 640 } else {
641 __ LoadRoot(result_register(), Heap::kTheHoleValueRootIndex); 641 __ LoadRoot(result_register(), Heap::kTheHoleValueRootIndex);
642 } 642 }
643 643
644 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 644 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
645 __ pop(r1); // Key.
646 __ pop(r2); // Receiver.
645 __ Call(ic, RelocInfo::CODE_TARGET); 647 __ Call(ic, RelocInfo::CODE_TARGET);
646 648
647 // Value in r0 is ignored (declarations are statements). Receiver 649 // Value in r0 is ignored (declarations are statements).
648 // and key on stack are discarded.
649 __ Drop(2);
650 } 650 }
651 } 651 }
652 } 652 }
653 653
654 654
655 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 655 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
656 // Call the runtime to declare the globals. 656 // Call the runtime to declare the globals.
657 // The context is the first argument. 657 // The context is the first argument.
658 __ mov(r1, Operand(pairs)); 658 __ mov(r1, Operand(pairs));
659 __ mov(r0, Operand(Smi::FromInt(is_eval() ? 1 : 0))); 659 __ mov(r0, Operand(Smi::FromInt(is_eval() ? 1 : 0)));
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 __ push(result_register()); 1098 __ push(result_register());
1099 __ ldr(ip, MemOperand(sp, kPointerSize)); // Receiver is now under value. 1099 __ ldr(ip, MemOperand(sp, kPointerSize)); // Receiver is now under value.
1100 __ push(ip); 1100 __ push(ip);
1101 __ CallRuntime(Runtime::kToSlowProperties, 1); 1101 __ CallRuntime(Runtime::kToSlowProperties, 1);
1102 __ pop(result_register()); 1102 __ pop(result_register());
1103 } 1103 }
1104 1104
1105 // Record source code position before IC call. 1105 // Record source code position before IC call.
1106 SetSourcePosition(expr->position()); 1106 SetSourcePosition(expr->position());
1107 __ mov(r2, Operand(prop->key()->AsLiteral()->handle())); 1107 __ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
1108 // Load receiver to r1. Leave a copy in the stack if needed for turning the
1109 // receiver into fast case.
1108 if (expr->ends_initialization_block()) { 1110 if (expr->ends_initialization_block()) {
1109 __ ldr(r1, MemOperand(sp)); 1111 __ ldr(r1, MemOperand(sp));
1110 } else { 1112 } else {
1111 __ pop(r1); 1113 __ pop(r1);
1112 } 1114 }
1113 1115
1114 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 1116 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
1115 __ Call(ic, RelocInfo::CODE_TARGET); 1117 __ Call(ic, RelocInfo::CODE_TARGET);
1116 1118
1117 // If the assignment ends an initialization block, revert to fast case. 1119 // If the assignment ends an initialization block, revert to fast case.
1118 if (expr->ends_initialization_block()) { 1120 if (expr->ends_initialization_block()) {
1119 __ push(r0); // Result of assignment, saved even if not needed. 1121 __ push(r0); // Result of assignment, saved even if not needed.
1120 __ ldr(ip, MemOperand(sp, kPointerSize)); // Receiver is under value. 1122 // Receiver is under the result value.
1123 __ ldr(ip, MemOperand(sp, kPointerSize));
1121 __ push(ip); 1124 __ push(ip);
1122 __ CallRuntime(Runtime::kToFastProperties, 1); 1125 __ CallRuntime(Runtime::kToFastProperties, 1);
1123 __ pop(r0); 1126 __ pop(r0);
1124 DropAndApply(1, context_, r0); 1127 DropAndApply(1, context_, r0);
1125 } else { 1128 } else {
1126 Apply(context_, r0); 1129 Apply(context_, r0);
1127 } 1130 }
1128 } 1131 }
1129 1132
1130 1133
1131 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { 1134 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
1132 // Assignment to a property, using a keyed store IC. 1135 // Assignment to a property, using a keyed store IC.
1133 1136
1134 // If the assignment starts a block of assignments to the same object, 1137 // If the assignment starts a block of assignments to the same object,
1135 // change to slow case to avoid the quadratic behavior of repeatedly 1138 // change to slow case to avoid the quadratic behavior of repeatedly
1136 // adding fast properties. 1139 // adding fast properties.
1137 if (expr->starts_initialization_block()) { 1140 if (expr->starts_initialization_block()) {
1138 __ push(result_register()); 1141 __ push(result_register());
1139 // Receiver is now under the key and value. 1142 // Receiver is now under the key and value.
1140 __ ldr(ip, MemOperand(sp, 2 * kPointerSize)); 1143 __ ldr(ip, MemOperand(sp, 2 * kPointerSize));
1141 __ push(ip); 1144 __ push(ip);
1142 __ CallRuntime(Runtime::kToSlowProperties, 1); 1145 __ CallRuntime(Runtime::kToSlowProperties, 1);
1143 __ pop(result_register()); 1146 __ pop(result_register());
1144 } 1147 }
1145 1148
1146 // Record source code position before IC call. 1149 // Record source code position before IC call.
1147 SetSourcePosition(expr->position()); 1150 SetSourcePosition(expr->position());
1151 __ pop(r1); // Key.
1152 // Load receiver to r2. Leave a copy in the stack if needed for turning the
1153 // receiver into fast case.
1154 if (expr->ends_initialization_block()) {
1155 __ ldr(r2, MemOperand(sp));
1156 } else {
1157 __ pop(r2);
1158 }
1159
1148 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 1160 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
1149 __ Call(ic, RelocInfo::CODE_TARGET); 1161 __ Call(ic, RelocInfo::CODE_TARGET);
1150 1162
1151 // If the assignment ends an initialization block, revert to fast case. 1163 // If the assignment ends an initialization block, revert to fast case.
1152 if (expr->ends_initialization_block()) { 1164 if (expr->ends_initialization_block()) {
1153 __ push(r0); // Result of assignment, saved even if not needed. 1165 __ push(r0); // Result of assignment, saved even if not needed.
1154 // Receiver is under the key and value. 1166 // Receiver is under the result value.
1155 __ ldr(ip, MemOperand(sp, 2 * kPointerSize)); 1167 __ ldr(ip, MemOperand(sp, kPointerSize));
1156 __ push(ip); 1168 __ push(ip);
1157 __ CallRuntime(Runtime::kToFastProperties, 1); 1169 __ CallRuntime(Runtime::kToFastProperties, 1);
1158 __ pop(r0); 1170 __ pop(r0);
1171 DropAndApply(1, context_, r0);
1172 } else {
1173 Apply(context_, r0);
1159 } 1174 }
1160
1161 // Receiver and key are still on stack.
1162 DropAndApply(2, context_, r0);
1163 } 1175 }
1164 1176
1165 1177
1166 void FullCodeGenerator::VisitProperty(Property* expr) { 1178 void FullCodeGenerator::VisitProperty(Property* expr) {
1167 Comment cmnt(masm_, "[ Property"); 1179 Comment cmnt(masm_, "[ Property");
1168 Expression* key = expr->key(); 1180 Expression* key = expr->key();
1169 1181
1170 // Evaluate receiver. 1182 // Evaluate receiver.
1171 VisitForValue(expr->obj(), kStack); 1183 VisitForValue(expr->obj(), kStack);
1172 1184
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 if (expr->is_postfix()) { 1664 if (expr->is_postfix()) {
1653 if (context_ != Expression::kEffect) { 1665 if (context_ != Expression::kEffect) {
1654 ApplyTOS(context_); 1666 ApplyTOS(context_);
1655 } 1667 }
1656 } else { 1668 } else {
1657 Apply(context_, r0); 1669 Apply(context_, r0);
1658 } 1670 }
1659 break; 1671 break;
1660 } 1672 }
1661 case KEYED_PROPERTY: { 1673 case KEYED_PROPERTY: {
1674 __ pop(r1); // Key.
1675 __ pop(r2); // Receiver.
1662 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 1676 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
1663 __ Call(ic, RelocInfo::CODE_TARGET); 1677 __ Call(ic, RelocInfo::CODE_TARGET);
1664 if (expr->is_postfix()) { 1678 if (expr->is_postfix()) {
1665 __ Drop(2); // Result is on the stack under the key and the receiver.
1666 if (context_ != Expression::kEffect) { 1679 if (context_ != Expression::kEffect) {
1667 ApplyTOS(context_); 1680 ApplyTOS(context_);
1668 } 1681 }
1669 } else { 1682 } else {
1670 DropAndApply(2, context_, r0); 1683 Apply(context_, r0);
1671 } 1684 }
1672 break; 1685 break;
1673 } 1686 }
1674 } 1687 }
1675 } 1688 }
1676 1689
1677 1690
1678 void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) { 1691 void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
1679 Comment cmnt(masm_, "[ BinaryOperation"); 1692 Comment cmnt(masm_, "[ BinaryOperation");
1680 switch (expr->op()) { 1693 switch (expr->op()) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 1887 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
1875 __ add(pc, r1, Operand(masm_->CodeObject())); 1888 __ add(pc, r1, Operand(masm_->CodeObject()));
1876 } 1889 }
1877 1890
1878 1891
1879 #undef __ 1892 #undef __
1880 1893
1881 } } // namespace v8::internal 1894 } } // namespace v8::internal
1882 1895
1883 #endif // V8_TARGET_ARCH_ARM 1896 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/debug-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698