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

Unified Diff: src/codegen.cc

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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/codegen.h ('k') | src/compilation-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
===================================================================
--- src/codegen.cc (revision 3427)
+++ src/codegen.cc (working copy)
@@ -43,9 +43,42 @@
namespace internal {
-CodeGenerator* CodeGeneratorScope::top_ = NULL;
+CodeGeneratorData::CodeGeneratorData()
+ :top_(NULL),
+ compiling_deferred_code_(false),
+ frame_element_constants_list_(NULL),
+ result_constants_list_(NULL) {
+}
+CodeGeneratorData::~CodeGeneratorData() {
+ delete result_constants_list_;
+ delete frame_element_constants_list_;
+}
+// we cannot allocate ZoneObjectList because it goes to some zone unexpectedly,
+// and after that to unexpected death so we create ZoneObjectList as member of
+// malloced class and take the only field
+struct NonZoneObjectListHolder {
+ ZoneObjectList zone_list;
+ NonZoneObjectListHolder():zone_list(10) {
+ ASSERT(sizeof(NonZoneObjectListHolder) == sizeof(zone_list));
+ ASSERT(reinterpret_cast<int>(this) == reinterpret_cast<int>(&zone_list));
+ }
+};
+
+ZoneObjectList* CodeGeneratorData::result_constants_list() {
+ if (!result_constants_list_) result_constants_list_ = &(
+ (new NonZoneObjectListHolder())->zone_list);
+ return result_constants_list_;
+}
+
+ZoneObjectList* CodeGeneratorData::frame_element_constants_list() {
+ if (!frame_element_constants_list_) frame_element_constants_list_ =
+ &((new NonZoneObjectListHolder())->zone_list);
+ return frame_element_constants_list_;
+}
+
+
DeferredCode::DeferredCode()
: masm_(CodeGeneratorScope::Current()->masm()),
statement_position_(masm_->current_statement_position()),
@@ -205,7 +238,7 @@
#endif // ENABLE_DISASSEMBLER
if (!code.is_null()) {
- Counters::total_compiled_code_size.Increment(code->instruction_size());
+ INCREMENT_COUNTER(total_compiled_code_size, code->instruction_size());
}
return code;
}
« no previous file with comments | « src/codegen.h ('k') | src/compilation-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698