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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7 | 125 // have just generated "movq rsp, rbp; pop rbp; ret k" with length 7 |
126 // (3 + 1 + 3). | 126 // (3 + 1 + 3). |
127 const int kPadding = Debug::kX64JSReturnSequenceLength - 7; | 127 const int kPadding = Debug::kX64JSReturnSequenceLength - 7; |
128 for (int i = 0; i < kPadding; ++i) { | 128 for (int i = 0; i < kPadding; ++i) { |
129 masm_->int3(); | 129 masm_->int3(); |
130 } | 130 } |
131 #endif | 131 #endif |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 void FastCodeGenerator::VisitSlot(Slot* expr) { | 135 void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
136 Comment cmnt(masm_, "[ Slot"); | 136 Comment cmnt(masm_, "[ VariableProxy"); |
137 if (expr->location().is_temporary()) { | 137 Expression* rewrite = expr->var()->rewrite(); |
138 __ push(Operand(rbp, SlotOffset(expr))); | 138 ASSERT(rewrite != NULL); |
139 } else { | 139 |
140 ASSERT(expr->location().is_nowhere()); | 140 Slot* slot = rewrite->AsSlot(); |
| 141 ASSERT(slot != NULL); |
| 142 { Comment cmnt(masm_, "[ Slot"); |
| 143 if (expr->location().is_temporary()) { |
| 144 __ push(Operand(rbp, SlotOffset(slot))); |
| 145 } else { |
| 146 ASSERT(expr->location().is_nowhere()); |
| 147 } |
141 } | 148 } |
142 } | 149 } |
143 | 150 |
144 | 151 |
145 void FastCodeGenerator::VisitLiteral(Literal* expr) { | 152 void FastCodeGenerator::VisitLiteral(Literal* expr) { |
146 Comment cmnt(masm_, "[ Literal"); | 153 Comment cmnt(masm_, "[ Literal"); |
147 if (expr->location().is_temporary()) { | 154 if (expr->location().is_temporary()) { |
148 __ Push(expr->handle()); | 155 __ Push(expr->handle()); |
149 } else { | 156 } else { |
150 ASSERT(expr->location().is_nowhere()); | 157 ASSERT(expr->location().is_nowhere()); |
(...skipping 14 matching lines...) Expand all Loading... |
165 __ movq(rax, Operand(rsp, 0)); | 172 __ movq(rax, Operand(rsp, 0)); |
166 __ movq(Operand(rbp, SlotOffset(var->slot())), rax); | 173 __ movq(Operand(rbp, SlotOffset(var->slot())), rax); |
167 } else { | 174 } else { |
168 ASSERT(expr->location().is_nowhere()); | 175 ASSERT(expr->location().is_nowhere()); |
169 __ pop(Operand(rbp, SlotOffset(var->slot()))); | 176 __ pop(Operand(rbp, SlotOffset(var->slot()))); |
170 } | 177 } |
171 } | 178 } |
172 | 179 |
173 | 180 |
174 } } // namespace v8::internal | 181 } } // namespace v8::internal |
OLD | NEW |