Revision: 10861
Author: [email protected]
Date: Tue Feb 28 10:26:04 2012
Log: Do not call memset() to initialize StubCache.
Review URL: https://chromiumcodereview.appspot.com/9464054
Patch from Iliyan Malchev <[email protected]>.
http://code.google.com/p/v8/source/detail?r=10861
Modified:
/branches/bleeding_edge/src/isolate.cc
/branches/bleeding_edge/src/stub-cache.cc
/branches/bleeding_edge/src/stub-cache.h
=======================================
--- /branches/bleeding_edge/src/isolate.cc Mon Feb 20 07:34:08 2012
+++ /branches/bleeding_edge/src/isolate.cc Tue Feb 28 10:26:04 2012
@@ -1836,13 +1836,12 @@
#ifdef ENABLE_DEBUGGER_SUPPORT
debug_->SetUp(create_heap_objects);
#endif
- stub_cache_->Initialize(create_heap_objects);
// If we are deserializing, read the state into the now-empty heap.
if (des != NULL) {
des->Deserialize();
- stub_cache_->Initialize(true);
- }
+ }
+ stub_cache_->Initialize();
// Finish initialization of ThreadLocal after deserialization is done.
clear_pending_exception();
=======================================
--- /branches/bleeding_edge/src/stub-cache.cc Fri Feb 10 04:36:05 2012
+++ /branches/bleeding_edge/src/stub-cache.cc Tue Feb 28 10:26:04 2012
@@ -45,26 +45,13 @@
StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {
ASSERT(isolate == Isolate::Current());
- memset(primary_, 0, sizeof(primary_[0]) * StubCache::kPrimaryTableSize);
- memset(secondary_, 0, sizeof(secondary_[0]) *
StubCache::kSecondaryTableSize);
}
-void StubCache::Initialize(bool create_heap_objects) {
+void StubCache::Initialize() {
ASSERT(IsPowerOf2(kPrimaryTableSize));
ASSERT(IsPowerOf2(kSecondaryTableSize));
- if (create_heap_objects) {
- HandleScope scope;
- Code* empty = isolate_->builtins()->builtin(Builtins::kIllegal);
- for (int i = 0; i < kPrimaryTableSize; i++) {
- primary_[i].key = heap()->empty_string();
- primary_[i].value = empty;
- }
- for (int j = 0; j < kSecondaryTableSize; j++) {
- secondary_[j].key = heap()->empty_string();
- secondary_[j].value = empty;
- }
- }
+ Clear();
}
=======================================
--- /branches/bleeding_edge/src/stub-cache.h Fri Feb 10 04:36:05 2012
+++ /branches/bleeding_edge/src/stub-cache.h Tue Feb 28 10:26:04 2012
@@ -71,7 +71,7 @@
Code* value;
};
- void Initialize(bool create_heap_objects);
+ void Initialize();
// Computes the right stub matching. Inserts the result in the
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev