Index: src/ia32/codegen-ia32.h |
=================================================================== |
--- src/ia32/codegen-ia32.h (revision 2255) |
+++ src/ia32/codegen-ia32.h (working copy) |
@@ -273,8 +273,16 @@ |
}; |
+// ------------------------------------------------------------------------- |
+// Arguments allocation mode |
+enum ArgumentsAllocationMode { |
+ NO_ARGUMENTS_ALLOCATION, |
+ EAGER_ARGUMENTS_ALLOCATION, |
+ LAZY_ARGUMENTS_ALLOCATION |
+}; |
+ |
// ------------------------------------------------------------------------- |
// CodeGenerator |
@@ -332,12 +340,11 @@ |
// Accessors |
Scope* scope() const { return scope_; } |
+ bool is_eval() { return is_eval_; } |
// Generating deferred code. |
void ProcessDeferred(); |
- bool is_eval() { return is_eval_; } |
- |
// State |
TypeofState typeof_state() const { return state_->typeof_state(); } |
ControlDestination* destination() const { return state_->destination(); } |
@@ -373,6 +380,12 @@ |
// target (which can not be done more than once). |
void GenerateReturnSequence(Result* return_value); |
+ // Returns the arguments allocation mode. |
+ ArgumentsAllocationMode ArgumentsMode() const; |
+ |
+ // Store the arguments object and allocate it if necessary. |
+ Result StoreArgumentsObject(bool initial); |
+ |
// The following are used by class Reference. |
void LoadReference(Reference* ref); |
void UnloadReference(Reference* ref); |
@@ -408,6 +421,7 @@ |
// Read a value from a slot and leave it on top of the expression stack. |
void LoadFromSlot(Slot* slot, TypeofState typeof_state); |
+ void LoadFromSlotCheckForArguments(Slot* slot, TypeofState typeof_state); |
Result LoadFromGlobalSlotCheckExtensions(Slot* slot, |
TypeofState typeof_state, |
JumpTarget* slow); |
@@ -470,6 +484,14 @@ |
void CallWithArguments(ZoneList<Expression*>* arguments, int position); |
+ // Use an optimized version of Function.prototype.apply that avoid |
+ // allocating the arguments object and just copies the arguments |
+ // from the stack. |
+ void CallApplyLazy(Property* apply, |
+ Expression* receiver, |
+ VariableProxy* arguments, |
+ int position); |
+ |
void CheckStack(); |
struct InlineRuntimeLUT { |