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

Unified Diff: src/stub-cache.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/stub-cache.h ('k') | src/top.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
===================================================================
--- src/stub-cache.cc (revision 3427)
+++ src/stub-cache.cc (working copy)
@@ -38,9 +38,17 @@
// -----------------------------------------------------------------------
// StubCache implementation.
+StubCacheData::StubCacheData() {
+ for (int i = 0; i < kPrimaryTableSize; ++i) {
+ primary_[i].key = NULL;
+ primary_[i].value = NULL;
+ }
-StubCache::Entry StubCache::primary_[StubCache::kPrimaryTableSize];
-StubCache::Entry StubCache::secondary_[StubCache::kSecondaryTableSize];
+ for (int i = 0; i < kSecondaryTableSize; ++i) {
+ secondary_[i].key = NULL;
+ secondary_[i].value = NULL;
+ }
+}
void StubCache::Initialize(bool create_heap_objects) {
ASSERT(IsPowerOf2(kPrimaryTableSize));
@@ -73,7 +81,8 @@
// Compute the primary entry.
int primary_offset = PrimaryOffset(name, flags, map);
- Entry* primary = entry(primary_, primary_offset);
+ StubCacheData& stub_cache_data = v8_context()->stub_cache_data_;
+ Entry* primary = entry(stub_cache_data.primary_, primary_offset);
Code* hit = primary->value;
// If the primary entry has useful data in it, we retire it to the
@@ -82,7 +91,7 @@
Code::Flags primary_flags = Code::RemoveTypeFromFlags(hit->flags());
int secondary_offset =
SecondaryOffset(primary->key, primary_flags, primary_offset);
- Entry* secondary = entry(secondary_, secondary_offset);
+ Entry* secondary = entry(stub_cache_data.secondary_, secondary_offset);
*secondary = *primary;
}
@@ -712,13 +721,14 @@
void StubCache::Clear() {
+ StubCacheData& stub_cache_data = v8_context()->stub_cache_data_;
for (int i = 0; i < kPrimaryTableSize; i++) {
- primary_[i].key = Heap::empty_string();
- primary_[i].value = Builtins::builtin(Builtins::Illegal);
+ stub_cache_data.primary_[i].key = Heap::empty_string();
+ stub_cache_data.primary_[i].value = Builtins::builtin(Builtins::Illegal);
}
for (int j = 0; j < kSecondaryTableSize; j++) {
- secondary_[j].key = Heap::empty_string();
- secondary_[j].value = Builtins::builtin(Builtins::Illegal);
+ stub_cache_data.secondary_[j].key = Heap::empty_string();
+ stub_cache_data.secondary_[j].value = Builtins::builtin(Builtins::Illegal);
}
}
@@ -926,7 +936,7 @@
CallIC::GenerateInitialize(masm(), argc);
Object* result = GetCodeWithFlags(flags, "CompileCallInitialize");
if (!result->IsFailure()) {
- Counters::call_initialize_stubs.Increment();
+ INC_COUNTER(call_initialize_stubs);
Code* code = Code::cast(result);
USE(code);
LOG(CodeCreateEvent(Logger::CALL_INITIALIZE_TAG,
@@ -944,7 +954,7 @@
CallIC::GenerateInitialize(masm(), argc);
Object* result = GetCodeWithFlags(flags, "CompileCallPreMonomorphic");
if (!result->IsFailure()) {
- Counters::call_premonomorphic_stubs.Increment();
+ INC_COUNTER(call_premonomorphic_stubs);
Code* code = Code::cast(result);
USE(code);
LOG(CodeCreateEvent(Logger::CALL_PRE_MONOMORPHIC_TAG,
@@ -960,7 +970,7 @@
CallIC::GenerateNormal(masm(), argc);
Object* result = GetCodeWithFlags(flags, "CompileCallNormal");
if (!result->IsFailure()) {
- Counters::call_normal_stubs.Increment();
+ INC_COUNTER(call_normal_stubs);
Code* code = Code::cast(result);
USE(code);
LOG(CodeCreateEvent(Logger::CALL_NORMAL_TAG,
@@ -976,7 +986,7 @@
CallIC::GenerateMegamorphic(masm(), argc);
Object* result = GetCodeWithFlags(flags, "CompileCallMegamorphic");
if (!result->IsFailure()) {
- Counters::call_megamorphic_stubs.Increment();
+ INC_COUNTER(call_megamorphic_stubs);
Code* code = Code::cast(result);
USE(code);
LOG(CodeCreateEvent(Logger::CALL_MEGAMORPHIC_TAG,
@@ -992,7 +1002,7 @@
CallIC::GenerateMiss(masm(), argc);
Object* result = GetCodeWithFlags(flags, "CompileCallMiss");
if (!result->IsFailure()) {
- Counters::call_megamorphic_stubs.Increment();
+ INC_COUNTER(call_megamorphic_stubs);
Code* code = Code::cast(result);
USE(code);
LOG(CodeCreateEvent(Logger::CALL_MISS_TAG, code, code->arguments_count()));
« no previous file with comments | « src/stub-cache.h ('k') | src/top.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698