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

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

Issue 341081: Begin using the top-level code generator for code that is inside... (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/ast.h » ('j') | src/ast.h » ('J')
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 3204)
+++ src/arm/fast-codegen-arm.cc (working copy)
@@ -92,7 +92,9 @@
}
{ Comment cmnt(masm_, "[ Body");
+ ASSERT(loop_depth() == 0);
VisitStatements(fun->body());
+ ASSERT(loop_depth() == 0);
fschneider 2009/11/03 14:10:13 Why this duplicate ASSERT? (also on ia32, x64)
Kevin Millikin (Chromium) 2009/11/03 14:16:09 We should not be in a loop before we compile the b
}
{ Comment cmnt(masm_, "[ return <undefined>;");
@@ -323,7 +325,7 @@
void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
- Comment cmnt(masm_, "[ RegExp Literal");
+ Comment cmnt(masm_, "[ RegExpLiteral");
Label done;
// Registers will be used as follows:
// r4 = JS function, literals array
@@ -818,8 +820,16 @@
EmitCallWithStub(expr);
}
} else {
- // Call to some other function expression.
- Visit(expr->expression());
+ // Call to some other expression. If the expression is an anonymous
+ // function literal not called in a loop, mark it as one that should
+ // also use the fast code generator.
+ FunctionLiteral* lit = fun->AsFunctionLiteral();
+ if (lit != NULL &&
+ lit->name()->Equals(Heap::empty_string()) &&
+ loop_depth() == 0) {
+ lit->mark_as_fast();
Søren Thygesen Gjesse 2009/11/03 13:57:47 As this logic is duplicated in all three code gene
Kevin Millikin (Chromium) 2009/11/03 14:16:09 That's a good idea. For now the check is pretty s
+ }
+ Visit(fun);
// Load global receiver object.
__ ldr(r1, CodeGenerator::GlobalObject());
__ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
@@ -890,7 +900,6 @@
void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
Comment cmnt(masm_, "[ UnaryOperation");
-
switch (expr->op()) {
case Token::VOID:
Visit(expr->expression());
@@ -988,12 +997,12 @@
void FastCodeGenerator::VisitCountOperation(CountOperation* expr) {
- VariableProxy* v = expr->expression()->AsVariableProxy();
- ASSERT(v->AsVariable() != NULL);
- ASSERT(v->AsVariable()->is_global());
+ Comment cmnt(masm_, "[ CountOperation");
+ VariableProxy* proxy = expr->expression()->AsVariableProxy();
+ ASSERT(proxy->AsVariable() != NULL);
+ ASSERT(proxy->AsVariable()->is_global());
- Visit(v);
-
+ Visit(proxy);
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS);
switch (expr->context()) {
@@ -1020,7 +1029,7 @@
__ CallRuntime(Runtime::kNumberSub, 2);
}
// Call Store IC.
- __ mov(r2, Operand(v->AsVariable()->name()));
+ __ mov(r2, Operand(proxy->AsVariable()->name()));
__ ldr(ip, CodeGenerator::GlobalObject());
__ push(ip);
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
@@ -1063,6 +1072,7 @@
void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
+ Comment cmnt(masm_, "[ BinaryOperation");
switch (expr->op()) {
case Token::COMMA:
ASSERT_EQ(Expression::kEffect, expr->left()->context());
@@ -1108,6 +1118,7 @@
void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
+ Comment cmnt(masm_, "[ CompareOperation");
ASSERT_EQ(Expression::kValue, expr->left()->context());
ASSERT_EQ(Expression::kValue, expr->right()->context());
Visit(expr->left());
« no previous file with comments | « no previous file | src/ast.h » ('j') | src/ast.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698