Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 2fa97bad90f567f18dc2984a490f6fb6ace1d7ff..8d270d4fca6849f70373753676e69ea9ad6431ee 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -21,6 +21,7 @@ |
// List of code stubs used on all platforms. |
#define CODE_STUB_LIST_ALL_PLATFORMS(V) \ |
/* PlatformCodeStubs */ \ |
+ V(ArgumentsAccess) \ |
V(ArrayConstructor) \ |
V(BinaryOpICWithAllocationSite) \ |
V(CallApiFunction) \ |
@@ -77,8 +78,7 @@ |
V(FastNewClosure) \ |
V(FastNewContext) \ |
V(FastNewRestParameter) \ |
- V(FastNewSloppyArguments) \ |
- V(FastNewStrictArguments) \ |
+ V(FastNewStrictArguments) \ |
V(GrowArrayElements) \ |
V(InternalArrayNArgumentsConstructor) \ |
V(InternalArrayNoArgumentConstructor) \ |
@@ -742,20 +742,8 @@ |
// TODO(turbofan): This stub should be possible to write in TurboFan |
// using the CodeStubAssembler very soon in a way that is as efficient |
-// and easy as the current handwritten version. |
-class FastNewSloppyArgumentsStub final : public PlatformCodeStub { |
- public: |
- explicit FastNewSloppyArgumentsStub(Isolate* isolate) |
- : PlatformCodeStub(isolate) {} |
- |
- DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewSloppyArguments); |
- DEFINE_PLATFORM_CODE_STUB(FastNewSloppyArguments, PlatformCodeStub); |
-}; |
- |
- |
-// TODO(turbofan): This stub should be possible to write in TurboFan |
-// using the CodeStubAssembler very soon in a way that is as efficient |
-// and easy as the current handwritten version. |
+// and easy as the current handwritten version, which is partly a copy |
+// of the strict arguments object materialization code. |
class FastNewStrictArgumentsStub final : public PlatformCodeStub { |
public: |
explicit FastNewStrictArgumentsStub(Isolate* isolate) |
@@ -1849,6 +1837,43 @@ |
DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
DEFINE_PLATFORM_CODE_STUB(JSEntry, PlatformCodeStub); |
+}; |
+ |
+ |
+class ArgumentsAccessStub: public PlatformCodeStub { |
+ public: |
+ enum Type { |
+ NEW_SLOPPY_FAST, |
+ NEW_SLOPPY_SLOW, |
+ }; |
+ |
+ ArgumentsAccessStub(Isolate* isolate, Type type) : PlatformCodeStub(isolate) { |
+ minor_key_ = TypeBits::encode(type); |
+ } |
+ |
+ CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { |
+ return ArgumentsAccessNewDescriptor(isolate()); |
+ } |
+ |
+ static Type ComputeType(bool has_duplicate_parameters) { |
+ if (has_duplicate_parameters) { |
+ return Type::NEW_SLOPPY_SLOW; |
+ } else { |
+ return Type::NEW_SLOPPY_FAST; |
+ } |
+ } |
+ |
+ private: |
+ Type type() const { return TypeBits::decode(minor_key_); } |
+ |
+ void GenerateNewSloppyFast(MacroAssembler* masm); |
+ void GenerateNewSloppySlow(MacroAssembler* masm); |
+ |
+ void PrintName(std::ostream& os) const override; // NOLINT |
+ |
+ class TypeBits : public BitField<Type, 0, 1> {}; |
+ |
+ DEFINE_PLATFORM_CODE_STUB(ArgumentsAccess, PlatformCodeStub); |
}; |