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

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

Issue 113455: Clean up the Result class. Reduce the size of Result from four words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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
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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 Result temp = cgen_->allocator()->Allocate(); 1066 Result temp = cgen_->allocator()->Allocate();
1067 ASSERT(temp.is_valid()); 1067 ASSERT(temp.is_valid());
1068 Use(temp.reg(), index); 1068 Use(temp.reg(), index);
1069 FrameElement new_element = 1069 FrameElement new_element =
1070 FrameElement::RegisterElement(temp.reg(), FrameElement::SYNCED); 1070 FrameElement::RegisterElement(temp.reg(), FrameElement::SYNCED);
1071 // Preserve the copy flag on the element. 1071 // Preserve the copy flag on the element.
1072 if (element.is_copied()) new_element.set_copied(); 1072 if (element.is_copied()) new_element.set_copied();
1073 new_element.set_static_type(element.static_type()); 1073 new_element.set_static_type(element.static_type());
1074 elements_[index] = new_element; 1074 elements_[index] = new_element;
1075 __ mov(temp.reg(), Operand(ebp, fp_relative(index))); 1075 __ mov(temp.reg(), Operand(ebp, fp_relative(index)));
1076 return Result(temp.reg(), cgen_, element.static_type()); 1076 return Result(temp.reg(), element.static_type());
1077 } else if (element.is_register()) { 1077 } else if (element.is_register()) {
1078 return Result(element.reg(), cgen_, element.static_type()); 1078 return Result(element.reg(), element.static_type());
1079 } else { 1079 } else {
1080 ASSERT(element.is_constant()); 1080 ASSERT(element.is_constant());
1081 return Result(element.handle(), cgen_); 1081 return Result(element.handle());
1082 } 1082 }
1083 } 1083 }
1084 1084
1085 1085
1086 void VirtualFrame::EmitPop(Register reg) { 1086 void VirtualFrame::EmitPop(Register reg) {
1087 ASSERT(stack_pointer_ == elements_.length() - 1); 1087 ASSERT(stack_pointer_ == elements_.length() - 1);
1088 stack_pointer_--; 1088 stack_pointer_--;
1089 elements_.RemoveLast(); 1089 elements_.RemoveLast();
1090 __ pop(reg); 1090 __ pop(reg);
1091 } 1091 }
(...skipping 27 matching lines...) Expand all
1119 ASSERT(stack_pointer_ == elements_.length() - 1); 1119 ASSERT(stack_pointer_ == elements_.length() - 1);
1120 elements_.Add(FrameElement::MemoryElement()); 1120 elements_.Add(FrameElement::MemoryElement());
1121 stack_pointer_++; 1121 stack_pointer_++;
1122 __ push(immediate); 1122 __ push(immediate);
1123 } 1123 }
1124 1124
1125 1125
1126 #undef __ 1126 #undef __
1127 1127
1128 } } // namespace v8::internal 1128 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698