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

Side by Side Diff: src/ia32/cfg-ia32.cc

Issue 165127: Factor out some platform-independent code into the shared cfg.cc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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/cfg.cc ('k') | src/x64/cfg-x64.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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 __ CallRuntime(Runtime::kTraceExit, 1); 106 __ CallRuntime(Runtime::kTraceExit, 1);
107 } 107 }
108 __ RecordJSReturn(); 108 __ RecordJSReturn();
109 __ mov(esp, ebp); 109 __ mov(esp, ebp);
110 __ pop(ebp); 110 __ pop(ebp);
111 int count = CfgGlobals::current()->fun()->scope()->num_parameters(); 111 int count = CfgGlobals::current()->fun()->scope()->num_parameters();
112 __ ret((count + 1) * kPointerSize); 112 __ ret((count + 1) * kPointerSize);
113 } 113 }
114 114
115 115
116 void PositionInstr::Compile(MacroAssembler* masm) {
117 if (FLAG_debug_info && pos_ != RelocInfo::kNoPosition) {
118 __ RecordStatementPosition(pos_);
119 __ RecordPosition(pos_);
120 }
121 }
122
123
124 void MoveInstr::Compile(MacroAssembler* masm) {
125 location()->Move(masm, value());
126 }
127
128
129 void BinaryOpInstr::Compile(MacroAssembler* masm) { 116 void BinaryOpInstr::Compile(MacroAssembler* masm) {
130 // The right-hand value should not be on the stack---if it is a 117 // The right-hand value should not be on the stack---if it is a
131 // compiler-generated temporary it is in the accumulator. 118 // compiler-generated temporary it is in the accumulator.
132 ASSERT(!value1()->is_on_stack()); 119 ASSERT(!value1()->is_on_stack());
133 120
134 Comment cmnt(masm, "[ BinaryOpInstr"); 121 Comment cmnt(masm, "[ BinaryOpInstr");
135 // We can overwrite one of the operands if it is a temporary. 122 // We can overwrite one of the operands if it is a temporary.
136 OverwriteMode mode = NO_OVERWRITE; 123 OverwriteMode mode = NO_OVERWRITE;
137 if (value0()->is_temporary()) { 124 if (value0()->is_temporary()) {
138 mode = OVERWRITE_LEFT; 125 mode = OVERWRITE_LEFT;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 __ push(ToOperand(this)); 192 __ push(ToOperand(this));
206 } 193 }
207 194
208 195
209 void SlotLocation::Move(MacroAssembler* masm, Value* value) { 196 void SlotLocation::Move(MacroAssembler* masm, Value* value) {
210 // We dispatch to the value because in some cases (temp or constant) 197 // We dispatch to the value because in some cases (temp or constant)
211 // we can use a single instruction. 198 // we can use a single instruction.
212 value->MoveToSlot(masm, this); 199 value->MoveToSlot(masm, this);
213 } 200 }
214 201
202
215 void SlotLocation::MoveToSlot(MacroAssembler* masm, SlotLocation* loc) { 203 void SlotLocation::MoveToSlot(MacroAssembler* masm, SlotLocation* loc) {
216 // The accumulator is not live across a MoveInstr. 204 // The accumulator is not live across a MoveInstr.
217 __ mov(eax, ToOperand(this)); 205 __ mov(eax, ToOperand(this));
218 __ mov(ToOperand(loc), eax); 206 __ mov(ToOperand(loc), eax);
219 } 207 }
220 208
221 209
222 void TempLocation::Get(MacroAssembler* masm, Register reg) { 210 void TempLocation::Get(MacroAssembler* masm, Register reg) {
223 switch (where_) { 211 switch (where_) {
224 case ACCUMULATOR: 212 case ACCUMULATOR:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 break; 271 break;
284 case NOT_ALLOCATED: 272 case NOT_ALLOCATED:
285 UNREACHABLE(); 273 UNREACHABLE();
286 } 274 }
287 } 275 }
288 276
289 277
290 #undef __ 278 #undef __
291 279
292 } } // namespace v8::internal 280 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cfg.cc ('k') | src/x64/cfg-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698