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

Unified Diff: src/codegen-ia32.cc

Issue 13001: Fix eval, which was broken by merging from bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 869)
+++ src/codegen-ia32.cc (working copy)
@@ -3107,6 +3107,7 @@
void CodeGenerator::VisitCallEval(CallEval* node) {
+ frame_->SpillAll();
Comment cmnt(masm_, "[ CallEval");
// In a call to eval, we first call %ResolvePossiblyDirectEval to resolve
@@ -3120,33 +3121,37 @@
// Prepare stack for call to resolved function.
Load(function);
- __ push(Immediate(Factory::undefined_value())); // Slot for receiver
- for (int i = 0; i < args->length(); i++) {
+ frame_->SpillAll();
+ // Allocate a frame slot for the receiver.
+ frame_->EmitPush(Immediate(Factory::undefined_value()));
+ int arg_count = args->length();
+ for (int i = 0; i < arg_count; i++) {
Load(args->at(i));
+ frame_->SpillAll();
}
// Prepare stack for call to ResolvePossiblyDirectEval.
- __ push(Operand(esp, args->length() * kPointerSize + kPointerSize));
- if (args->length() > 0) {
- __ push(Operand(esp, args->length() * kPointerSize));
+ frame_->EmitPush(frame_->ElementAt(arg_count + 1));
+ if (arg_count > 0) {
+ frame_->EmitPush(frame_->ElementAt(arg_count));
} else {
- __ push(Immediate(Factory::undefined_value()));
+ frame_->EmitPush(Immediate(Factory::undefined_value()));
}
// Resolve the call.
- __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 2);
+ frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 2);
// Touch up stack with the right values for the function and the receiver.
__ mov(edx, FieldOperand(eax, FixedArray::kHeaderSize));
- __ mov(Operand(esp, (args->length() + 1) * kPointerSize), edx);
+ __ mov(frame_->ElementAt(arg_count + 1), edx);
__ mov(edx, FieldOperand(eax, FixedArray::kHeaderSize + kPointerSize));
- __ mov(Operand(esp, args->length() * kPointerSize), edx);
+ __ mov(frame_->ElementAt(arg_count), edx);
// Call the function.
__ RecordPosition(node->position());
- CallFunctionStub call_function(args->length());
- __ CallStub(&call_function);
+ CallFunctionStub call_function(arg_count);
+ frame_->CallStub(&call_function, arg_count + 1);
// Restore context and pop function from the stack.
__ mov(esi, frame_->Context());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698