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

Unified Diff: src/frames.h

Issue 2467513002: [builtins]: Uniformly push argument count in TF-generated builtins (Closed)
Patch Set: Fix windows build Created 4 years, 1 month 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/compiler/x64/code-generator-x64.cc ('k') | src/frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.h
diff --git a/src/frames.h b/src/frames.h
index 66c36dc89de52d68b6f47fd4de71813956d74e3a..1daa36404b7ae2c82debeed2daf3f92d6a9ea152 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -218,6 +218,48 @@ class StandardFrameConstants : public CommonFrameConstants {
static const int kLastObjectOffset = kContextOffset;
};
+// OptimizedBuiltinFrameConstants are used for TF-generated builtins. They
+// always have a context below the saved fp/constant pool and below that the
+// JSFunction of the executing function and below that an integer (not a Smi)
+// containing the number of arguments passed to the builtin.
+//
+// slot JS frame
+// +-----------------+--------------------------------
+// -n-1 | parameter 0 | ^
+// |- - - - - - - - -| |
+// -n | | Caller
+// ... | ... | frame slots
+// -2 | parameter n-1 | (slot < 0)
+// |- - - - - - - - -| |
+// -1 | parameter n | v
+// -----+-----------------+--------------------------------
+// 0 | return addr | ^ ^
+// |- - - - - - - - -| | |
+// 1 | saved frame ptr | Fixed |
+// |- - - - - - - - -| Header <-- frame ptr |
+// 2 | [Constant Pool] | | |
+// |- - - - - - - - -| | |
+// 2+cp | Context | | if a constant pool |
+// |- - - - - - - - -| | is used, cp = 1, |
+// 3+cp | JSFunction | | otherwise, cp = 0 |
+// |- - - - - - - - -| | |
+// 4+cp | argc | v |
+// +-----------------+---- |
+// 5+cp | | ^ Callee
+// |- - - - - - - - -| | frame slots
+// ... | | Frame slots (slot >= 0)
+// |- - - - - - - - -| | |
+// | | v |
+// -----+-----------------+----- <-- stack ptr -------------
+//
+class OptimizedBuiltinFrameConstants : public StandardFrameConstants {
+ public:
+ static const int kArgCSize = kPointerSize;
+ static const int kArgCOffset = -3 * kPointerSize - kCPSlotSize;
+ static const int kFixedFrameSize = kFixedFrameSizeAboveFp - kArgCOffset;
+ static const int kFixedSlotCount = kFixedFrameSize / kPointerSize;
+};
+
// TypedFrames have a SMI type maker value below the saved FP/constant pool to
// distinguish them from StandardFrames, which have a context in that position
// instead.
@@ -941,6 +983,8 @@ class OptimizedFrame : public JavaScriptFrame {
DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const;
+ Object* receiver() const override;
+
static int StackSlotOffsetRelativeToFp(int slot_index);
protected:
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698