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

Unified Diff: src/frames-inl.h

Issue 2106883003: [builtins] Add receiver to builtin exit frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 6 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/frames.cc ('k') | src/heap-symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames-inl.h
diff --git a/src/frames-inl.h b/src/frames-inl.h
index ef51e0d5767d6935b5b266d23e070c1bcc9ce002..bc2ff4fb6a8b5d74d57bec9e667af00c6b6f18db 100644
--- a/src/frames-inl.h
+++ b/src/frames-inl.h
@@ -101,10 +101,30 @@ inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator)
inline BuiltinExitFrame::BuiltinExitFrame(StackFrameIteratorBase* iterator)
: ExitFrame(iterator) {}
-inline Object* BuiltinExitFrame::function_slot_object() const {
+inline Object* BuiltinExitFrame::target_slot_object() const {
return Memory::Object_at(fp() + BuiltinExitFrameConstants::kTargetOffset);
}
+inline Object* BuiltinExitFrame::new_target_slot_object() const {
+ return Memory::Object_at(fp() + BuiltinExitFrameConstants::kNewTargetOffset);
+}
+
+inline Object* BuiltinExitFrame::receiver_slot_object() const {
+ // The receiver is the first argument on the frame.
+ // fp[1]: return address.
+ // fp[2]: the last argument (new target).
+ // fp[4]: argc.
+ // fp[2 + argc - 1]: receiver.
+ Object* argc_slot =
+ Memory::Object_at(fp() + BuiltinExitFrameConstants::kArgcOffset);
+ DCHECK(argc_slot->IsSmi());
+ int argc = Smi::cast(argc_slot)->value();
+
+ const int receiverOffset =
+ BuiltinExitFrameConstants::kNewTargetOffset + (argc - 1) * kPointerSize;
+ return Memory::Object_at(fp() + receiverOffset);
+}
+
inline StandardFrame::StandardFrame(StackFrameIteratorBase* iterator)
: StackFrame(iterator) {
}
« no previous file with comments | « src/frames.cc ('k') | src/heap-symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698