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

Unified Diff: src/scopeinfo.h

Issue 7523027: Provisional implementation of stack allocated catch variables. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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/runtime.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.h
diff --git a/src/scopeinfo.h b/src/scopeinfo.h
index 86c33f61ffaf3a1bd38bc8d38665a83ec0181c41..f87a0e7c537ecb2edcd9fbdaf482f92686bca1f6 100644
--- a/src/scopeinfo.h
+++ b/src/scopeinfo.h
@@ -31,6 +31,8 @@
#include "allocation.h"
#include "variables.h"
#include "zone-inl.h"
+#include "ast.h"
+#include "scopes.h"
namespace v8 {
namespace internal {
@@ -79,10 +81,18 @@ class ScopeInfo BASE_EMBEDDED {
int l = context_slots_.length();
return l == 0 ? 0 : l + Context::MIN_CONTEXT_SLOTS;
}
+ int first_stack_index() const {
+ return first_stack_index_;
+ }
Handle<String> LocalName(int i) const;
int NumberOfLocals() const;
+ Scope::Type type() const { return type_; }
+ int SourceBegStatementPos() const { return source_beg_statement_pos_; }
+ int SourceEndStatementPos() const { return source_end_statement_pos_; }
+
+
// --------------------------------------------------------------------------
// Debugging support
@@ -94,10 +104,15 @@ class ScopeInfo BASE_EMBEDDED {
Handle<String> function_name_;
bool calls_eval_;
bool is_strict_mode_;
+ Scope::Type type_;
+ int source_beg_statement_pos_;
+ int source_end_statement_pos_;
+ int first_stack_index_;
List<Handle<String>, Allocator > parameters_;
List<Handle<String>, Allocator > stack_slots_;
List<Handle<String>, Allocator > context_slots_;
List<Variable::Mode, Allocator > context_modes_;
+ List<Handle<SerializedScopeInfo>, Allocator> inner_scopeinfos_;
};
@@ -117,15 +132,39 @@ class SerializedScopeInfo : public FixedArray {
// Is this scope a strict mode scope?
bool IsStrictMode();
+ // Start position of this scope in the source string.
+ int SourceBegStatementPos();
+
+ // End position of this scope in the source string.
+ int SourceEndStatementPos();
+
+ // First stack slot index for stack slots.
+ int FirstStackSlot();
+
+ // Return the number of parameters for code.
+ int NumberOfParameters();
+
// Return the number of stack slots for code.
int NumberOfStackSlots();
// Return the number of context slots for code.
int NumberOfContextSlots();
+ // Return the number of nested scopes for code.
+ int NumberOfNestedScopes();
+
+ Handle<SerializedScopeInfo> NestedScope(int i);
+
// Return if this has context slots besides MIN_CONTEXT_SLOTS;
bool HasHeapAllocatedLocals();
+ bool HasContext();
+
+ Handle<String> FunctionName();
+ Handle<String> ParameterName(int i);
+ Handle<String> StackSlotName(int i);
+ Handle<String> ContextSlotName(int i, Variable::Mode* mode);
+
// Lookup support for serialized scope info. Returns the
// the stack slot index for a given slot name if the slot is
// present; otherwise returns a value < 0. The name must be a symbol
@@ -150,6 +189,11 @@ class SerializedScopeInfo : public FixedArray {
// must be a symbol (canonicalized).
int FunctionContextSlotIndex(String* name);
+ Scope::Type ScopeType();
+
+ void GetLocalScopeChain(List<Handle<SerializedScopeInfo> >* chain,
+ int position);
+
static Handle<SerializedScopeInfo> Create(Scope* scope);
// Serializes empty scope info.
@@ -162,6 +206,8 @@ class SerializedScopeInfo : public FixedArray {
inline Object** ParameterEntriesAddr();
inline Object** StackSlotEntriesAddr();
+
+ inline Object** NestedScopeEntriesAddr();
};
« no previous file with comments | « src/runtime.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698