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

Unified Diff: src/frames.h

Issue 14031028: Generators save and restore stack handlers (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebase to have the test suite expect boxed return values Created 7 years, 8 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 | « no previous file | src/frames.cc » ('j') | src/frames.cc » ('J')
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 678191b950a0172a37f62a78fb9533f977502613..7b34bac49ba2c4bbe7a80fbd74720c78e1fbe560 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -107,7 +107,7 @@ class StackHandler BASE_EMBEDDED {
static const int kKindWidth = 2;
STATIC_ASSERT(LAST_KIND < (1 << kKindWidth));
- static const int kIndexWidth = 32 - kKindWidth;
+ static const int kIndexWidth = 32 - kSmiTagSize - kKindWidth;
class KindField: public BitField<StackHandler::Kind, 0, kKindWidth> {};
class IndexField: public BitField<unsigned, kKindWidth, kIndexWidth> {};
@@ -131,6 +131,13 @@ class StackHandler BASE_EMBEDDED {
inline bool is_catch() const;
inline bool is_finally() const;
+ // Helpers to allow generators to capture and restore an activation's stack
+ // handlers.
Michael Starzinger 2013/05/07 09:55:44 nit: How about shortening the comment to just "Gen
+ void Unwind(Isolate* isolate, FixedArray* array, int offset,
+ Object *data) const;
Michael Starzinger 2013/05/07 09:55:44 Can we make "data" to be of type Smi? That would b
+ Object* Rewind(Isolate* isolate, FixedArray* array, int offset,
+ Address fp);
Michael Starzinger 2013/05/07 09:55:44 nit: Should fit into one line.
+
private:
// Accessors.
inline Kind kind() const;
@@ -541,6 +548,9 @@ class JavaScriptFrame: public StandardFrame {
inline Object* GetOperand(int index) const;
inline int ComputeOperandsCount() const;
+ void SaveOperandStack(FixedArray* store, int* stack_handler_index) const;
Michael Starzinger 2013/05/07 09:55:44 nit: Maybe add a one-liner comment "Generator supp
+ void RestoreOperandStack(FixedArray* store, int stack_handler_index);
+
// Debugger access.
void SetParameterValue(int index, Object* value) const;
« no previous file with comments | « no previous file | src/frames.cc » ('j') | src/frames.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698