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

Unified Diff: src/x64/fast-codegen-x64.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
« src/fast-codegen.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/fast-codegen-x64.cc
===================================================================
--- src/x64/fast-codegen-x64.cc (revision 3204)
+++ src/x64/fast-codegen-x64.cc (working copy)
@@ -84,7 +84,9 @@
}
{ Comment cmnt(masm_, "[ Body");
+ ASSERT(loop_depth() == 0);
VisitStatements(fun->body());
+ ASSERT(loop_depth() == 0);
}
{ Comment cmnt(masm_, "[ return <undefined>;");
@@ -360,7 +362,7 @@
void FastCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
- Comment cmnt(masm_, "[ RegExp Literal");
+ Comment cmnt(masm_, "[ RegExpLiteral");
Label done;
// Registers will be used as follows:
// rdi = JS function.
@@ -855,8 +857,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();
+ }
+ Visit(fun);
// Load global receiver object.
__ movq(rbx, CodeGenerator::GlobalObject());
__ push(FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
@@ -925,12 +935,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_FUNCTION);
switch (expr->context()) {
@@ -956,7 +966,7 @@
__ CallRuntime(Runtime::kNumberSub, 2);
}
// Call Store IC.
- __ Move(rcx, v->AsVariable()->name());
+ __ Move(rcx, proxy->AsVariable()->name());
__ push(CodeGenerator::GlobalObject());
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
__ call(ic, RelocInfo::CODE_TARGET);
@@ -999,7 +1009,6 @@
void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
Comment cmnt(masm_, "[ UnaryOperation");
-
switch (expr->op()) {
case Token::VOID:
Visit(expr->expression());
@@ -1092,6 +1101,7 @@
void FastCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
+ Comment cmnt(masm_, "[ BinaryOperation");
switch (expr->op()) {
case Token::COMMA:
ASSERT_EQ(Expression::kEffect, expr->left()->context());
@@ -1136,6 +1146,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());
« src/fast-codegen.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698