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

Unified Diff: src/frames.cc

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing condition in SafeStackFrameIter::frame() 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.h ('k') | src/frames-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index a7bd91a79636a2bb601d0bdade272e10a3467609..5ee5b5615db7ceb2650c5e41f17b8369db71a3a1 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -325,7 +325,7 @@ void SafeStackFrameIterator::Advance() {
external_callback_scope_ = external_callback_scope_->previous();
}
if (frame_->is_java_script()) break;
- if (frame_->is_exit()) {
+ if (frame_->is_exit() || frame_->is_builtin_exit()) {
// Some of the EXIT frames may have ExternalCallbackScope allocated on
// top of them. In that case the scope corresponds to the first EXIT
// frame beneath it. There may be other EXIT frames on top of the
@@ -485,6 +485,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
case ENTRY:
case ENTRY_CONSTRUCT:
case EXIT:
+ case BUILTIN_EXIT:
case STUB:
case STUB_FAILURE_TRAMPOLINE:
case INTERNAL:
@@ -558,7 +559,6 @@ Object*& ExitFrame::code_slot() const {
return Memory::Object_at(fp() + offset);
}
-
Code* ExitFrame::unchecked_code() const {
return reinterpret_cast<Code*>(code_slot());
}
@@ -600,6 +600,26 @@ StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
Address sp = ComputeStackPointer(fp);
FillState(fp, sp, state);
DCHECK(*state->pc_address != NULL);
+
+ return ComputeFrameType(fp);
+}
+
+StackFrame::Type ExitFrame::ComputeFrameType(Address fp) {
+ // Distinguish between between regular and builtin exit frames.
+ // Default to EXIT in all hairy cases (e.g., when called from profiler).
+ const int offset = ExitFrameConstants::kFrameTypeOffset;
+ Object* marker = Memory::Object_at(fp + offset);
+
+ if (!marker->IsSmi()) {
+ return EXIT;
+ }
+
+ StackFrame::Type frame_type =
+ static_cast<StackFrame::Type>(Smi::cast(marker)->value());
+ if (frame_type == EXIT || frame_type == BUILTIN_EXIT) {
+ return frame_type;
+ }
+
return EXIT;
}
@@ -620,6 +640,10 @@ void ExitFrame::FillState(Address fp, Address sp, State* state) {
state->constant_pool_address = NULL;
}
+JSFunction* BuiltinExitFrame::function() const {
+ return JSFunction::cast(function_slot_object());
+}
+
Address StandardFrame::GetExpressionAddress(int n) const {
const int offset = StandardFrameConstants::kExpressionsOffset;
return fp() + offset - n * kPointerSize;
@@ -678,6 +702,7 @@ void StandardFrame::IterateCompiledFrame(ObjectVisitor* v) const {
case ENTRY:
case ENTRY_CONSTRUCT:
case EXIT:
+ case BUILTIN_EXIT:
case STUB_FAILURE_TRAMPOLINE:
case ARGUMENTS_ADAPTOR:
case STUB:
« no previous file with comments | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698