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

Side by Side Diff: src/x64/virtual-frame-x64.cc

Issue 1736023: Cut-and-paste port from ia32 to x64: Delay load of trivial left operand of bi... (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/x64/virtual-frame-x64.h ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 220
221 void VirtualFrame::EmitPush(Heap::RootListIndex index, TypeInfo info) { 221 void VirtualFrame::EmitPush(Heap::RootListIndex index, TypeInfo info) {
222 ASSERT(stack_pointer_ == element_count() - 1); 222 ASSERT(stack_pointer_ == element_count() - 1);
223 elements_.Add(FrameElement::MemoryElement(info)); 223 elements_.Add(FrameElement::MemoryElement(info));
224 stack_pointer_++; 224 stack_pointer_++;
225 __ PushRoot(index); 225 __ PushRoot(index);
226 } 226 }
227 227
228 228
229 void VirtualFrame::Push(Expression* expr) {
230 ASSERT(expr->IsTrivial());
231
232 Literal* lit = expr->AsLiteral();
233 if (lit != NULL) {
234 Push(lit->handle());
235 return;
236 }
237
238 VariableProxy* proxy = expr->AsVariableProxy();
239 if (proxy != NULL) {
240 Slot* slot = proxy->var()->slot();
241 if (slot->type() == Slot::LOCAL) {
242 PushLocalAt(slot->index());
243 return;
244 }
245 if (slot->type() == Slot::PARAMETER) {
246 PushParameterAt(slot->index());
247 return;
248 }
249 }
250 UNREACHABLE();
251 }
252
253
229 void VirtualFrame::Drop(int count) { 254 void VirtualFrame::Drop(int count) {
230 ASSERT(count >= 0); 255 ASSERT(count >= 0);
231 ASSERT(height() >= count); 256 ASSERT(height() >= count);
232 int num_virtual_elements = (element_count() - 1) - stack_pointer_; 257 int num_virtual_elements = (element_count() - 1) - stack_pointer_;
233 258
234 // Emit code to lower the stack pointer if necessary. 259 // Emit code to lower the stack pointer if necessary.
235 if (num_virtual_elements < count) { 260 if (num_virtual_elements < count) {
236 int num_dropped = count - num_virtual_elements; 261 int num_dropped = count - num_virtual_elements;
237 stack_pointer_ -= num_dropped; 262 stack_pointer_ -= num_dropped;
238 __ addq(rsp, Immediate(num_dropped * kPointerSize)); 263 __ addq(rsp, Immediate(num_dropped * kPointerSize));
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 // Grow the expression stack by handler size less one (the return 1156 // Grow the expression stack by handler size less one (the return
1132 // address is already pushed by a call instruction). 1157 // address is already pushed by a call instruction).
1133 Adjust(kHandlerSize - 1); 1158 Adjust(kHandlerSize - 1);
1134 __ PushTryHandler(IN_JAVASCRIPT, type); 1159 __ PushTryHandler(IN_JAVASCRIPT, type);
1135 } 1160 }
1136 1161
1137 1162
1138 #undef __ 1163 #undef __
1139 1164
1140 } } // namespace v8::internal 1165 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/virtual-frame-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698