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

Unified Diff: src/codegen-ia32.cc

Issue 11023: Begin using the virtual frame for variable proxies and slots. Loading... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 12 years 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 | src/virtual-frame-ia32.h » ('j') | 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 960)
+++ src/codegen-ia32.cc (working copy)
@@ -2497,6 +2497,7 @@
ASSERT(slot->var()->mode() == Variable::DYNAMIC);
// For now, just do a runtime call.
+ frame_->SpillAll();
frame_->EmitPush(esi);
frame_->EmitPush(Immediate(slot->var()->name()));
@@ -2515,6 +2516,7 @@
// Const slots may contain 'the hole' value (the constant hasn't been
// initialized yet) which needs to be converted into the 'undefined'
// value.
+ frame_->SpillAll();
Comment cmnt(masm_, "[ Load const");
JumpTarget exit(this);
__ mov(eax, SlotOperand(slot, ecx));
@@ -2524,7 +2526,17 @@
exit.Bind();
frame_->EmitPush(eax);
} else {
- frame_->EmitPush(SlotOperand(slot, ecx));
+ if (slot->type() == Slot::PARAMETER) {
+ frame_->LoadParameterAt(slot->index());
+ } else if (slot->type() == Slot::LOCAL) {
+ frame_->LoadLocalAt(slot->index());
+ } else {
+ // The other remaining slot types (LOOKUP and GLOBAL) cannot reach
+ // here.
+ ASSERT(slot->type() == Slot::CONTEXT);
+ frame_->SpillAll();
+ frame_->EmitPush(SlotOperand(slot, ecx));
+ }
}
}
}
@@ -2612,14 +2624,12 @@
void CodeGenerator::VisitSlot(Slot* node) {
- frame_->SpillAll();
Comment cmnt(masm_, "[ Slot");
LoadFromSlot(node, typeof_state());
}
void CodeGenerator::VisitVariableProxy(VariableProxy* node) {
- frame_->SpillAll();
Comment cmnt(masm_, "[ VariableProxy");
Variable* var = node->var();
Expression* expr = var->rewrite();
@@ -2920,6 +2930,7 @@
} else {
frame_->SpillAll();
target.GetValue(NOT_INSIDE_TYPEOF);
+ frame_->SpillAll();
Literal* literal = node->value()->AsLiteral();
if (IsInlineSmi(literal)) {
SmiOperation(node->binary_op(), node->type(), literal->handle(), false,
@@ -3083,6 +3094,7 @@
// Load the function to call from the property through a reference.
Reference ref(this, property);
ref.GetValue(NOT_INSIDE_TYPEOF);
+ frame_->SpillAll();
// Pass receiver to called function.
// The reference's size is non-negative.
@@ -3244,20 +3256,18 @@
JumpTarget ascii_string(this);
JumpTarget got_char_code(this);
- // Load the string into eax.
+ // Load the string into eax and the index into ebx.
Load(args->at(0));
frame_->SpillAll();
+ Load(args->at(1));
+ frame_->SpillAll();
+ frame_->EmitPop(ebx);
frame_->EmitPop(eax);
// If the receiver is a smi return undefined.
ASSERT(kSmiTag == 0);
__ test(eax, Immediate(kSmiTagMask));
slow_case.Branch(zero, not_taken);
- // Load the index into ebx.
- Load(args->at(1));
- frame_->SpillAll();
- frame_->EmitPop(ebx);
-
// Check for negative or non-smi index.
ASSERT(kSmiTag == 0);
__ test(ebx, Immediate(kSmiTagMask | 0x80000000));
@@ -3751,6 +3761,7 @@
return;
}
target.GetValue(NOT_INSIDE_TYPEOF);
+ frame_->SpillAll();
CountOperationDeferred* deferred =
new CountOperationDeferred(this, is_postfix, is_increment,
@@ -3957,7 +3968,6 @@
void CodeGenerator::VisitCompareOperation(CompareOperation* node) {
- frame_->SpillAll();
Comment cmnt(masm_, "[ CompareOperation");
// Get the expressions from the node.
@@ -4016,6 +4026,7 @@
// Load the operand and move it to register edx.
LoadTypeofExpression(operation->expression());
+ frame_->SpillAll();
frame_->EmitPop(edx);
if (check->Equals(Heap::number_symbol())) {
@@ -4225,6 +4236,7 @@
// there is a chance that reference errors can be thrown below, we
// must distinguish between the two kinds of loads (typeof expression
// loads must not throw a reference error).
+ frame->SpillAll();
Comment cmnt(masm, "[ Load from named Property");
Handle<String> name(GetName());
Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
@@ -4245,6 +4257,7 @@
case KEYED: {
// TODO(1241834): Make sure that this it is safe to ignore the
// distinction between expressions in a typeof and not in a typeof.
+ frame->SpillAll();
Comment cmnt(masm, "[ Load from keyed Property");
Property* property = expression_->AsProperty();
ASSERT(property != NULL);
« no previous file with comments | « no previous file | src/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698