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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 7824038: Remove variable rewrites and the unneccesary Slot class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 __ CallRuntime(Runtime::kNewFunctionContext, 1); 187 __ CallRuntime(Runtime::kNewFunctionContext, 1);
188 } 188 }
189 RecordSafepoint(Safepoint::kNoDeoptimizationIndex); 189 RecordSafepoint(Safepoint::kNoDeoptimizationIndex);
190 // Context is returned in both eax and esi. It replaces the context 190 // Context is returned in both eax and esi. It replaces the context
191 // passed to us. It's saved in the stack and kept live in esi. 191 // passed to us. It's saved in the stack and kept live in esi.
192 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); 192 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
193 193
194 // Copy parameters into context if necessary. 194 // Copy parameters into context if necessary.
195 int num_parameters = scope()->num_parameters(); 195 int num_parameters = scope()->num_parameters();
196 for (int i = 0; i < num_parameters; i++) { 196 for (int i = 0; i < num_parameters; i++) {
197 Slot* slot = scope()->parameter(i)->AsSlot(); 197 Variable* var = scope()->parameter(i);
198 if (slot != NULL && slot->type() == Slot::CONTEXT) { 198 if (var->IsContextSlot()) {
199 int parameter_offset = StandardFrameConstants::kCallerSPOffset + 199 int parameter_offset = StandardFrameConstants::kCallerSPOffset +
200 (num_parameters - 1 - i) * kPointerSize; 200 (num_parameters - 1 - i) * kPointerSize;
201 // Load parameter from stack. 201 // Load parameter from stack.
202 __ mov(eax, Operand(ebp, parameter_offset)); 202 __ mov(eax, Operand(ebp, parameter_offset));
203 // Store it in the context. 203 // Store it in the context.
204 int context_offset = Context::SlotOffset(slot->index()); 204 int context_offset = Context::SlotOffset(var->index());
205 __ mov(Operand(esi, context_offset), eax); 205 __ mov(Operand(esi, context_offset), eax);
206 // Update the write barrier. This clobbers all involved 206 // Update the write barrier. This clobbers all involved
207 // registers, so we have to use a third register to avoid 207 // registers, so we have to use a third register to avoid
208 // clobbering esi. 208 // clobbering esi.
209 __ mov(ecx, esi); 209 __ mov(ecx, esi);
210 __ RecordWrite(ecx, context_offset, eax, ebx); 210 __ RecordWrite(ecx, context_offset, eax, ebx);
211 } 211 }
212 } 212 }
213 Comment(";;; End allocate local context"); 213 Comment(";;; End allocate local context");
214 } 214 }
(...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4378 env->deoptimization_index()); 4378 env->deoptimization_index());
4379 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4379 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4380 } 4380 }
4381 4381
4382 4382
4383 #undef __ 4383 #undef __
4384 4384
4385 } } // namespace v8::internal 4385 } } // namespace v8::internal
4386 4386
4387 #endif // V8_TARGET_ARCH_IA32 4387 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698