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

Unified Diff: src/frames-inl.h

Issue 14031028: Generators save and restore stack handlers (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebased before commit Created 7 years, 7 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/objects.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 7901a5e591c85f8d85431d7dbbecd426e64ab08d..1228ccf18df4c4016884f4d44d7479c0eaf3cbd6 100644
--- a/src/frames-inl.h
+++ b/src/frames-inl.h
@@ -98,6 +98,12 @@ inline StackHandler::Kind StackHandler::kind() const {
}
+inline unsigned StackHandler::index() const {
+ const int offset = StackHandlerConstants::kStateOffset;
+ return IndexField::decode(Memory::unsigned_at(address() + offset));
+}
+
+
inline Object** StackHandler::context_address() const {
const int offset = StackHandlerConstants::kContextOffset;
return reinterpret_cast<Object**>(address() + offset);
@@ -216,8 +222,9 @@ Object* JavaScriptFrame::GetParameter(int index) const {
inline Address JavaScriptFrame::GetOperandSlot(int index) const {
Address base = fp() + JavaScriptFrameConstants::kLocal0Offset;
ASSERT(IsAddressAligned(base, kPointerSize));
- ASSERT(type() == JAVA_SCRIPT);
- ASSERT(index < ComputeOperandsCount());
+ ASSERT_EQ(type(), JAVA_SCRIPT);
+ ASSERT_LT(index, ComputeOperandsCount());
+ ASSERT_LE(0, index);
// Operand stack grows down.
return base - index * kPointerSize;
}
« no previous file with comments | « src/frames.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698