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

Unified Diff: src/compiler.cc

Issue 384078: Fast-codegen: Added support for arguments in functions. (Closed)
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
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 1329cd692f17c94d57492d33439e19649eb674c4..2b30bda79a80ab82481c98258f4b6cc7495ffdc3 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -600,8 +600,8 @@ CodeGenSelector::CodeGenTag CodeGenSelector::Select(FunctionLiteral* fun) {
}
if (scope->arguments() != NULL) {
- if (FLAG_trace_bailout) PrintF("function uses 'arguments'\n");
- return NORMAL;
+ // if (FLAG_trace_bailout) PrintF("function uses 'arguments'\n");
+ // return NORMAL;
William Hesse 2009/11/12 09:56:49 Remove.
Lasse Reichstein 2009/11/13 08:54:37 Done.
}
has_supported_syntax_ = true;
@@ -792,21 +792,23 @@ void CodeGenSelector::VisitSlot(Slot* expr) {
void CodeGenSelector::VisitVariableProxy(VariableProxy* expr) {
Expression* rewrite = expr->var()->rewrite();
- // A rewrite of NULL indicates a global variable.
+ // A rewrite of NULL indicates a global variable or explict arguments access.
William Hesse 2009/11/12 09:56:49 Lie!
Lasse Reichstein 2009/11/13 08:54:37 Truthified.
if (rewrite != NULL) {
// Non-global.
Slot* slot = rewrite->AsSlot();
- if (slot == NULL) {
- // This is a variable rewritten to an explicit property access
- // on the arguments object.
- BAILOUT("non-global/non-slot variable reference");
- }
-
- Slot::Type type = slot->type();
- // When LOOKUP slots are enabled, some currently dead code
- // implementing unary typeof will become live.
- if (type == Slot::LOOKUP) {
- BAILOUT("Lookup slot");
+ if (slot != NULL) {
+ Slot::Type type = slot->type();
+ // When LOOKUP slots are enabled, some currently dead code
+ // implementing unary typeof will become live.
+ if (type == Slot::LOOKUP) {
+ BAILOUT("Lookup slot");
+ }
+ } else {
+ Property* property = rewrite->AsProperty();
William Hesse 2009/11/12 09:56:49 Put a comment, indicating what this code is for.
Lasse Reichstein 2009/11/13 08:54:37 Added
+ ASSERT_NOT_NULL(property);
+ ASSERT_NE(Expression::kUninitialized, context_);
+ Visit(property);
+ property->set_context(context_);
Kevin Millikin (Chromium) 2009/11/12 14:23:13 I'm surprised that this works. For a variable in
}
}
}

Powered by Google App Engine
This is Rietveld 408576698