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

Unified Diff: src/code-stubs.h

Issue 1701653002: Revert of [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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 | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698