HistogramTimerScope timer(&Counters::code_creation);
CodeDesc desc;
cgen.masm()->GetCode(&desc);
- ScopeInfo<> sinfo(flit->scope());
+ ZoneScopeInfo sinfo(flit->scope());
Code::Flags flags = Code::ComputeFlags(Code::FUNCTION);
Handle<Code> code = Factory::NewCode(desc,
&sinfo,
}
-Handle<Code> Factory::NewCode(const CodeDesc& desc, ScopeInfo<>* sinfo,
- Code::Flags flags, Handle<Object> self_ref) {
+Handle<Code> Factory::NewCode(const CodeDesc& desc,
+ ZoneScopeInfo* sinfo,
+ Code::Flags flags,
+ Handle<Object> self_ref) {
CALL_HEAP_FUNCTION(Heap::CreateCode(desc, sinfo, flags, self_ref), Code);
}
#define V8_FACTORY_H_
#include "heap.h"
+#include "zone-inl.h"
namespace v8 { namespace internal {
Handle<JSFunction> boilerplate,
Handle<Context> context);
- static Handle<Code> NewCode(const CodeDesc& desc, ScopeInfo<>* sinfo,
- Code::Flags flags, Handle<Object> self_reference);
+ static Handle<Code> NewCode(const CodeDesc& desc,
+ ZoneScopeInfo* sinfo,
+ Code::Flags flags,
+ Handle<Object> self_reference);
static Handle<Code> CopyCode(Handle<Code> code);
Handle<String> MakeNameFromStackHelper(int pos, Handle<String> prev);
void InferFunctionsNames();
- List<int> entries_stack_;
- List<Handle<String> > names_stack_;
- List<FunctionLiteral*> funcs_to_infer_;
+ ZoneList<int> entries_stack_;
+ ZoneList<Handle<String> > names_stack_;
+ ZoneList<FunctionLiteral*> funcs_to_infer_;
Handle<String> dot_;
DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer);
class TickSample;
class VirtualMemory;
class Mutex;
+class ZoneScopeInfo;
typedef bool (*WeakSlotCallback)(Object** pointer);
Object* Heap::CreateCode(const CodeDesc& desc,
- ScopeInfo<>* sinfo,
+ ZoneScopeInfo* sinfo,
Code::Flags flags,
Handle<Object> self_reference) {
// Compute size
#ifndef V8_HEAP_H_
#define V8_HEAP_H_
+#include "zone-inl.h"
+
namespace v8 { namespace internal {
// Defines all the roots in Heap.
// object by containing this pointer.
// Please note this function does not perform a garbage collection.
static Object* CreateCode(const CodeDesc& desc,
- ScopeInfo<>* sinfo,
+ ZoneScopeInfo* sinfo,
Code::Flags flags,
Handle<Object> self_reference);
bool is_eval_; // Tells whether code is generated for eval.
Handle<Script> script_;
- List<DeferredCode*> deferred_;
+ ZoneList<DeferredCode*> deferred_;
// Assembler
MacroAssembler* masm_; // to generate code
// Make sure the classes get instantiated by the template system.
template class ScopeInfo<FreeStoreAllocationPolicy>;
template class ScopeInfo<PreallocatedStorage>;
+template class ScopeInfo<ZoneListAllocationPolicy>;
} } // namespace v8::internal
List<Variable::Mode, Allocator > context_modes_;
};
+class ZoneScopeInfo: public ScopeInfo<ZoneListAllocationPolicy> {
+ public:
+ // Create a ZoneScopeInfo instance from a scope.
+ explicit ZoneScopeInfo(Scope* scope)
+ : ScopeInfo<ZoneListAllocationPolicy>(scope) {}
+
+ // Create a ZoneScopeInfo instance from a Code object.
+ explicit ZoneScopeInfo(Code* code)
+ : ScopeInfo<ZoneListAllocationPolicy>(code) {}
+};
+
+
} } // namespace v8::internal
#endif // V8_SCOPEINFO_H_
List<Variable*, FreeStoreAllocationPolicy>* locals);
template void Scope::CollectUsedVariables(
List<Variable*, PreallocatedStorage>* locals);
+template void Scope::CollectUsedVariables(
+ List<Variable*, ZoneListAllocationPolicy>* locals);
void Scope::AllocateVariables(Handle<Context> context) {