summaryrefslogtreecommitdiff
path: root/deps/v8/src/execution/frames.h
diff options
context:
space:
mode:
authorMyles Borins <mylesborins@google.com>2019-09-24 11:56:38 -0400
committerMyles Borins <myles.borins@gmail.com>2019-10-07 03:19:23 -0400
commitf7f6c928c1c9c136b7926f892b8a2fda11d8b4b2 (patch)
treef5edbccb3ffda2573d70a6e291e7157f290e0ae0 /deps/v8/src/execution/frames.h
parentffd22e81983056d09c064c59343a0e488236272d (diff)
downloadandroid-node-v8-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.tar.gz
android-node-v8-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.tar.bz2
android-node-v8-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.zip
deps: update V8 to 7.8.279.9
PR-URL: https://github.com/nodejs/node/pull/29694 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'deps/v8/src/execution/frames.h')
-rw-r--r--deps/v8/src/execution/frames.h170
1 files changed, 170 insertions, 0 deletions
diff --git a/deps/v8/src/execution/frames.h b/deps/v8/src/execution/frames.h
index 1f83984f97..d1e7a7890d 100644
--- a/deps/v8/src/execution/frames.h
+++ b/deps/v8/src/execution/frames.h
@@ -1285,6 +1285,7 @@ class SafeStackFrameIterator : public StackFrameIteratorBase {
void Advance();
StackFrame::Type top_frame_type() const { return top_frame_type_; }
+ Address top_context_address() const { return top_context_address_; }
private:
void AdvanceOneFrame();
@@ -1308,9 +1309,178 @@ class SafeStackFrameIterator : public StackFrameIteratorBase {
const Address low_bound_;
const Address high_bound_;
StackFrame::Type top_frame_type_;
+ Address top_context_address_;
ExternalCallbackScope* external_callback_scope_;
Address top_link_register_;
};
+
+// Frame layout helper classes. Used by the deoptimizer and instruction
+// selector.
+// -------------------------------------------------------------------------
+
+// How to calculate the frame layout information. Precise, when all information
+// is available during deoptimization. Conservative, when an overapproximation
+// is fine.
+// TODO(jgruber): Investigate whether the conservative kind can be removed. It
+// seems possible: 1. is_topmost should be known through the outer_state chain
+// of FrameStateDescriptor; 2. the deopt_kind may be a property of the bailout
+// id; 3. for continuation_mode, we only care whether it is a mode with catch,
+// and that is likewise known at compile-time.
+// There is nothing specific blocking this, the investigation just requires time
+// and it is not that important to get the exact frame height at compile-time.
+enum class FrameInfoKind {
+ kPrecise,
+ kConservative,
+};
+
+// Used by the deoptimizer. Corresponds to frame kinds:
+enum class BuiltinContinuationMode {
+ STUB, // BuiltinContinuationFrame
+ JAVASCRIPT, // JavaScriptBuiltinContinuationFrame
+ JAVASCRIPT_WITH_CATCH, // JavaScriptBuiltinContinuationWithCatchFrame
+ JAVASCRIPT_HANDLE_EXCEPTION // JavaScriptBuiltinContinuationWithCatchFrame
+};
+
+class InterpretedFrameInfo {
+ public:
+ static InterpretedFrameInfo Precise(int parameters_count_with_receiver,
+ int translation_height, bool is_topmost) {
+ return {parameters_count_with_receiver, translation_height, is_topmost,
+ FrameInfoKind::kPrecise};
+ }
+
+ static InterpretedFrameInfo Conservative(int parameters_count_with_receiver,
+ int locals_count) {
+ return {parameters_count_with_receiver, locals_count, false,
+ FrameInfoKind::kConservative};
+ }
+
+ uint32_t register_stack_slot_count() const {
+ return register_stack_slot_count_;
+ }
+ uint32_t frame_size_in_bytes_without_fixed() const {
+ return frame_size_in_bytes_without_fixed_;
+ }
+ uint32_t frame_size_in_bytes() const { return frame_size_in_bytes_; }
+
+ private:
+ InterpretedFrameInfo(int parameters_count_with_receiver,
+ int translation_height, bool is_topmost,
+ FrameInfoKind frame_info_kind);
+
+ uint32_t register_stack_slot_count_;
+ uint32_t frame_size_in_bytes_without_fixed_;
+ uint32_t frame_size_in_bytes_;
+};
+
+class ArgumentsAdaptorFrameInfo {
+ public:
+ static ArgumentsAdaptorFrameInfo Precise(int translation_height) {
+ return ArgumentsAdaptorFrameInfo{translation_height};
+ }
+
+ static ArgumentsAdaptorFrameInfo Conservative(int parameters_count) {
+ return ArgumentsAdaptorFrameInfo{parameters_count};
+ }
+
+ uint32_t frame_size_in_bytes_without_fixed() const {
+ return frame_size_in_bytes_without_fixed_;
+ }
+ uint32_t frame_size_in_bytes() const { return frame_size_in_bytes_; }
+
+ private:
+ explicit ArgumentsAdaptorFrameInfo(int translation_height);
+
+ uint32_t frame_size_in_bytes_without_fixed_;
+ uint32_t frame_size_in_bytes_;
+};
+
+class ConstructStubFrameInfo {
+ public:
+ static ConstructStubFrameInfo Precise(int translation_height,
+ bool is_topmost) {
+ return {translation_height, is_topmost, FrameInfoKind::kPrecise};
+ }
+
+ static ConstructStubFrameInfo Conservative(int parameters_count) {
+ return {parameters_count, false, FrameInfoKind::kConservative};
+ }
+
+ uint32_t frame_size_in_bytes_without_fixed() const {
+ return frame_size_in_bytes_without_fixed_;
+ }
+ uint32_t frame_size_in_bytes() const { return frame_size_in_bytes_; }
+
+ private:
+ ConstructStubFrameInfo(int translation_height, bool is_topmost,
+ FrameInfoKind frame_info_kind);
+
+ uint32_t frame_size_in_bytes_without_fixed_;
+ uint32_t frame_size_in_bytes_;
+};
+
+// Used by BuiltinContinuationFrameInfo.
+class CallInterfaceDescriptor;
+class RegisterConfiguration;
+
+class BuiltinContinuationFrameInfo {
+ public:
+ static BuiltinContinuationFrameInfo Precise(
+ int translation_height,
+ const CallInterfaceDescriptor& continuation_descriptor,
+ const RegisterConfiguration* register_config, bool is_topmost,
+ DeoptimizeKind deopt_kind, BuiltinContinuationMode continuation_mode) {
+ return {translation_height,
+ continuation_descriptor,
+ register_config,
+ is_topmost,
+ deopt_kind,
+ continuation_mode,
+ FrameInfoKind::kPrecise};
+ }
+
+ static BuiltinContinuationFrameInfo Conservative(
+ int parameters_count,
+ const CallInterfaceDescriptor& continuation_descriptor,
+ const RegisterConfiguration* register_config) {
+ // It doesn't matter what we pass as is_topmost, deopt_kind and
+ // continuation_mode; these values are ignored in conservative mode.
+ return {parameters_count,
+ continuation_descriptor,
+ register_config,
+ false,
+ DeoptimizeKind::kEager,
+ BuiltinContinuationMode::STUB,
+ FrameInfoKind::kConservative};
+ }
+
+ bool frame_has_result_stack_slot() const {
+ return frame_has_result_stack_slot_;
+ }
+ uint32_t translated_stack_parameter_count() const {
+ return translated_stack_parameter_count_;
+ }
+ uint32_t stack_parameter_count() const { return stack_parameter_count_; }
+ uint32_t frame_size_in_bytes() const { return frame_size_in_bytes_; }
+ uint32_t frame_size_in_bytes_above_fp() const {
+ return frame_size_in_bytes_above_fp_;
+ }
+
+ private:
+ BuiltinContinuationFrameInfo(
+ int translation_height,
+ const CallInterfaceDescriptor& continuation_descriptor,
+ const RegisterConfiguration* register_config, bool is_topmost,
+ DeoptimizeKind deopt_kind, BuiltinContinuationMode continuation_mode,
+ FrameInfoKind frame_info_kind);
+
+ bool frame_has_result_stack_slot_;
+ uint32_t translated_stack_parameter_count_;
+ uint32_t stack_parameter_count_;
+ uint32_t frame_size_in_bytes_;
+ uint32_t frame_size_in_bytes_above_fp_;
+};
+
} // namespace internal
} // namespace v8