Commit e2a3e102 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[ubsan] Replace Object** in runtime-scopes.cc

as part of the ongoing quest to get rid of Object**/Object* entirely.

Bug: v8:3770
Change-Id: Ibe05801fad78b26ca27b044c8091a26ccab5469a
Reviewed-on: https://chromium-review.googlesource.com/c/1330909Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57414}
parent 799a69d4
...@@ -474,11 +474,13 @@ class HandleArguments { ...@@ -474,11 +474,13 @@ class HandleArguments {
class ParameterArguments { class ParameterArguments {
public: public:
explicit ParameterArguments(Object** parameters) : parameters_(parameters) {} explicit ParameterArguments(Address parameters) : parameters_(parameters) {}
Object*& operator[](int index) { return *(parameters_ - index - 1); } Object* operator[](int index) {
return *ObjectSlot(parameters_ - (index + 1) * kPointerSize);
}
private: private:
Object** parameters_; Address parameters_;
}; };
} // namespace } // namespace
...@@ -573,8 +575,8 @@ RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { ...@@ -573,8 +575,8 @@ RUNTIME_FUNCTION(Runtime_NewSloppyArguments) {
fp = adaptor_frame->fp(); fp = adaptor_frame->fp();
} }
Object** parameters = reinterpret_cast<Object**>( Address parameters =
fp + argc * kPointerSize + StandardFrameConstants::kCallerSPOffset); fp + argc * kPointerSize + StandardFrameConstants::kCallerSPOffset;
ParameterArguments argument_getter(parameters); ParameterArguments argument_getter(parameters);
return *NewSloppyArguments(isolate, callee, argument_getter, argc); return *NewSloppyArguments(isolate, callee, argument_getter, argc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment