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

Unified Diff: src/arm/fast-codegen-arm.cc

Issue 355009: Fix a latent bug in the top-level compilation of function calls.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/fast-codegen-arm.cc
===================================================================
--- src/arm/fast-codegen-arm.cc (revision 3203)
+++ src/arm/fast-codegen-arm.cc (working copy)
@@ -769,30 +769,40 @@
void FastCodeGenerator::VisitCall(Call* expr) {
+ Comment cmnt(masm_, "[ Call");
Expression* fun = expr->expression();
Variable* var = fun->AsVariableProxy()->AsVariable();
- if (var != NULL &&
- var->is_possibly_eval()) {
- // Call to eval.
+ if (var != NULL && var->is_possibly_eval()) {
+ // Call to the identifier 'eval'.
UNREACHABLE();
+ } else if (var != NULL && !var->is_this() && var->is_global()) {
+ // Call to a global variable.
+ __ mov(r1, Operand(var->name()));
+ // Push global object as receiver for the call IC lookup.
+ __ ldr(r0, CodeGenerator::GlobalObject());
+ __ stm(db_w, sp, r1.bit() | r0.bit());
+ EmitCallWithIC(expr, RelocInfo::CODE_TARGET_CONTEXT);
+ } else if (var != NULL && var->slot() != NULL &&
+ var->slot()->type() == Slot::LOOKUP) {
+ // Call to a lookup slot.
+ UNREACHABLE();
} else if (fun->AsProperty() != NULL) {
- // Call on a property.
+ // Call to an object property.
Property* prop = fun->AsProperty();
Literal* key = prop->key()->AsLiteral();
if (key != NULL && key->handle()->IsSymbol()) {
- // Call on a named property: foo.x(1,2,3)
+ // Call to a named property, use call IC.
__ mov(r0, Operand(key->handle()));
__ push(r0);
Visit(prop->obj());
- // Use call IC.
EmitCallWithIC(expr, RelocInfo::CODE_TARGET);
} else {
- // Call on a keyed property : foo[key](1,2,3)
- // Use a keyed load IC followed by a call IC.
+ // Call to a keyed property, use keyed load IC followed by function
+ // call.
Visit(prop->obj());
Visit(prop->key());
- // Record source position of property.
+ // Record source code position for IC call.
SetSourcePosition(prop->position());
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
@@ -807,21 +817,8 @@
__ str(r1, MemOperand(sp));
EmitCallWithStub(expr);
}
- } else if (var != NULL) {
- // Call on a global variable
- ASSERT(var != NULL && !var->is_this() && var->is_global());
- ASSERT(!var->is_possibly_eval());
- __ mov(r1, Operand(var->name()));
- // Push global object as receiver.
- __ ldr(r0, CodeGenerator::GlobalObject());
- __ stm(db_w, sp, r1.bit() | r0.bit());
- EmitCallWithIC(expr, RelocInfo::CODE_TARGET_CONTEXT);
- } else if (var != NULL && var->slot() != NULL &&
- var->slot()->type() == Slot::LOOKUP) {
- // Call inside a with-statement
- UNREACHABLE();
} else {
- // Call with an arbitrary function expression.
+ // Call to some other function expression.
Visit(expr->expression());
// Load global receiver object.
__ ldr(r1, CodeGenerator::GlobalObject());
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698