Index: src/scopeinfo.cc |
=================================================================== |
--- src/scopeinfo.cc (revision 1344) |
+++ src/scopeinfo.cc (working copy) |
@@ -50,6 +50,7 @@ |
template<class Allocator> |
ScopeInfo<Allocator>::ScopeInfo(Scope* scope) |
: function_name_(Factory::empty_symbol()), |
+ calls_eval_(scope->calls_eval()), |
parameters_(scope->num_parameters()), |
stack_slots_(scope->num_stack_slots()), |
context_slots_(scope->num_heap_slots()), |
@@ -254,6 +255,7 @@ |
Object** p0 = &Memory::Object_at(code->sinfo_start()); |
Object** p = p0; |
p = ReadSymbol(p, &function_name_); |
+ p = ReadBool(p, &calls_eval_); |
p = ReadList<Allocator>(p, &context_slots_, &context_modes_); |
p = ReadList<Allocator>(p, ¶meters_); |
p = ReadList<Allocator>(p, &stack_slots_); |
@@ -267,6 +269,12 @@ |
} |
+static inline Object** WriteBool(Object** p, bool b) { |
+ *p++ = Smi::FromInt(b ? 1 : 0); |
+ return p; |
+} |
+ |
+ |
static inline Object** WriteSymbol(Object** p, Handle<String> s) { |
*p++ = *s; |
return p; |
@@ -306,8 +314,8 @@ |
template<class Allocator> |
int ScopeInfo<Allocator>::Serialize(Code* code) { |
- // function name, length & sentinel for 3 tables: |
- const int extra_slots = 1 + 2 * 3; |
+ // function name, calls eval, length & sentinel for 3 tables: |
+ const int extra_slots = 1 + 1 + 2 * 3; |
int size = (extra_slots + |
context_slots_.length() * 2 + |
parameters_.length() + |
@@ -318,6 +326,7 @@ |
Object** p0 = &Memory::Object_at(code->sinfo_start()); |
Object** p = p0; |
p = WriteSymbol(p, function_name_); |
+ p = WriteBool(p, calls_eval_); |
p = WriteList(p, &context_slots_, &context_modes_); |
p = WriteList(p, ¶meters_); |
p = WriteList(p, &stack_slots_); |
@@ -338,8 +347,8 @@ |
static Object** ContextEntriesAddr(Code* code) { |
ASSERT(code->sinfo_size() > 0); |
- // +1 for function name: |
- return &Memory::Object_at(code->sinfo_start()) + 1; |
+ // +2 for function name and calls eval: |
+ return &Memory::Object_at(code->sinfo_start()) + 2; |
} |
@@ -362,6 +371,19 @@ |
template<class Allocator> |
+bool ScopeInfo<Allocator>::CallsEval(Code* code) { |
+ if (code->sinfo_size() > 0) { |
+ // +1 for function name: |
+ Object** p = &Memory::Object_at(code->sinfo_start()) + 1; |
+ bool calls_eval; |
+ p = ReadBool(p, &calls_eval); |
+ return calls_eval; |
+ } |
+ return true; |
+} |
+ |
+ |
+template<class Allocator> |
int ScopeInfo<Allocator>::NumberOfStackSlots(Code* code) { |
if (code->sinfo_size() > 0) { |
Object** p = StackSlotEntriesAddr(code); |