renamed

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d57a8b0a
...@@ -41,8 +41,8 @@ namespace internal { ...@@ -41,8 +41,8 @@ namespace internal {
void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) { void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) {
code_map->AddCode(start, entry, size); code_map->AddCode(start, entry, size);
if (sfi_address != NULL) { if (shared != NULL) {
entry->set_shared_id(code_map->GetSFITag(sfi_address)); entry->set_shared_id(code_map->GetSharedId(shared));
} }
} }
...@@ -57,7 +57,7 @@ void CodeDeleteEventRecord::UpdateCodeMap(CodeMap* code_map) { ...@@ -57,7 +57,7 @@ void CodeDeleteEventRecord::UpdateCodeMap(CodeMap* code_map) {
} }
void SFIMoveEventRecord::UpdateCodeMap(CodeMap* code_map) { void SharedFunctionMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
code_map->MoveCode(from, to); code_map->MoveCode(from, to);
} }
......
...@@ -69,7 +69,7 @@ void ProfilerEventsProcessor::CallbackCreateEvent(Logger::LogEventsAndTags tag, ...@@ -69,7 +69,7 @@ void ProfilerEventsProcessor::CallbackCreateEvent(Logger::LogEventsAndTags tag,
rec->start = start; rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, prefix, name); rec->entry = generator_->NewCodeEntry(tag, prefix, name);
rec->size = 1; rec->size = 1;
rec->sfi_address = NULL; rec->shared = NULL;
events_buffer_.Enqueue(evt_rec); events_buffer_.Enqueue(evt_rec);
} }
...@@ -80,7 +80,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, ...@@ -80,7 +80,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
int line_number, int line_number,
Address start, Address start,
unsigned size, unsigned size,
Address sfi_address) { Address shared) {
if (FilterOutCodeCreateEvent(tag)) return; if (FilterOutCodeCreateEvent(tag)) return;
CodeEventsContainer evt_rec; CodeEventsContainer evt_rec;
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
...@@ -89,7 +89,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, ...@@ -89,7 +89,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
rec->start = start; rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number); rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number);
rec->size = size; rec->size = size;
rec->sfi_address = sfi_address; rec->shared = shared;
events_buffer_.Enqueue(evt_rec); events_buffer_.Enqueue(evt_rec);
} }
...@@ -106,7 +106,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, ...@@ -106,7 +106,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
rec->start = start; rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, name); rec->entry = generator_->NewCodeEntry(tag, name);
rec->size = size; rec->size = size;
rec->sfi_address = NULL; rec->shared = NULL;
events_buffer_.Enqueue(evt_rec); events_buffer_.Enqueue(evt_rec);
} }
...@@ -123,7 +123,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, ...@@ -123,7 +123,7 @@ void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag,
rec->start = start; rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, args_count); rec->entry = generator_->NewCodeEntry(tag, args_count);
rec->size = size; rec->size = size;
rec->sfi_address = NULL; rec->shared = NULL;
events_buffer_.Enqueue(evt_rec); events_buffer_.Enqueue(evt_rec);
} }
...@@ -149,10 +149,10 @@ void ProfilerEventsProcessor::CodeDeleteEvent(Address from) { ...@@ -149,10 +149,10 @@ void ProfilerEventsProcessor::CodeDeleteEvent(Address from) {
} }
void ProfilerEventsProcessor::SFIMoveEvent(Address from, Address to) { void ProfilerEventsProcessor::SharedFunctionMoveEvent(Address from, Address to) {
CodeEventsContainer evt_rec; CodeEventsContainer evt_rec;
SFIMoveEventRecord* rec = &evt_rec.SFIMoveEventRecord_; SharedFunctionMoveEventRecord* rec = &evt_rec.SharedFunctionMoveEventRecord_;
rec->type = CodeEventRecord::SFI_MOVE; rec->type = CodeEventRecord::SHARED_FUNC_MOVE;
rec->order = ++enqueue_order_; rec->order = ++enqueue_order_;
rec->from = from; rec->from = from;
rec->to = to; rec->to = to;
...@@ -403,8 +403,8 @@ void CpuProfiler::CodeDeleteEvent(Address from) { ...@@ -403,8 +403,8 @@ void CpuProfiler::CodeDeleteEvent(Address from) {
} }
void CpuProfiler::SFIMoveEvent(Address from, Address to) { void CpuProfiler::SharedFunctionMoveEvent(Address from, Address to) {
singleton_->processor_->SFIMoveEvent(from, to); singleton_->processor_->SharedFunctionMoveEvent(from, to);
} }
......
...@@ -50,7 +50,7 @@ class TokenEnumerator; ...@@ -50,7 +50,7 @@ class TokenEnumerator;
V(CODE_CREATION, CodeCreateEventRecord) \ V(CODE_CREATION, CodeCreateEventRecord) \
V(CODE_MOVE, CodeMoveEventRecord) \ V(CODE_MOVE, CodeMoveEventRecord) \
V(CODE_DELETE, CodeDeleteEventRecord) \ V(CODE_DELETE, CodeDeleteEventRecord) \
V(SFI_MOVE, SFIMoveEventRecord) V(SHARED_FUNC_MOVE, SharedFunctionMoveEventRecord)
class CodeEventRecord { class CodeEventRecord {
...@@ -73,7 +73,7 @@ class CodeCreateEventRecord : public CodeEventRecord { ...@@ -73,7 +73,7 @@ class CodeCreateEventRecord : public CodeEventRecord {
Address start; Address start;
CodeEntry* entry; CodeEntry* entry;
unsigned size; unsigned size;
Address sfi_address; Address shared;
INLINE(void UpdateCodeMap(CodeMap* code_map)); INLINE(void UpdateCodeMap(CodeMap* code_map));
}; };
...@@ -96,7 +96,7 @@ class CodeDeleteEventRecord : public CodeEventRecord { ...@@ -96,7 +96,7 @@ class CodeDeleteEventRecord : public CodeEventRecord {
}; };
class SFIMoveEventRecord : public CodeEventRecord { class SharedFunctionMoveEventRecord : public CodeEventRecord {
public: public:
Address from; Address from;
Address to; Address to;
...@@ -149,7 +149,7 @@ class ProfilerEventsProcessor : public Thread { ...@@ -149,7 +149,7 @@ class ProfilerEventsProcessor : public Thread {
String* name, String* name,
String* resource_name, int line_number, String* resource_name, int line_number,
Address start, unsigned size, Address start, unsigned size,
Address sfi_address); Address shared);
void CodeCreateEvent(Logger::LogEventsAndTags tag, void CodeCreateEvent(Logger::LogEventsAndTags tag,
const char* name, const char* name,
Address start, unsigned size); Address start, unsigned size);
...@@ -158,7 +158,7 @@ class ProfilerEventsProcessor : public Thread { ...@@ -158,7 +158,7 @@ class ProfilerEventsProcessor : public Thread {
Address start, unsigned size); Address start, unsigned size);
void CodeMoveEvent(Address from, Address to); void CodeMoveEvent(Address from, Address to);
void CodeDeleteEvent(Address from); void CodeDeleteEvent(Address from);
void SFIMoveEvent(Address from, Address to); void SharedFunctionMoveEvent(Address from, Address to);
void RegExpCodeCreateEvent(Logger::LogEventsAndTags tag, void RegExpCodeCreateEvent(Logger::LogEventsAndTags tag,
const char* prefix, String* name, const char* prefix, String* name,
Address start, unsigned size); Address start, unsigned size);
...@@ -251,7 +251,7 @@ class CpuProfiler { ...@@ -251,7 +251,7 @@ class CpuProfiler {
static void GetterCallbackEvent(String* name, Address entry_point); static void GetterCallbackEvent(String* name, Address entry_point);
static void RegExpCodeCreateEvent(Code* code, String* source); static void RegExpCodeCreateEvent(Code* code, String* source);
static void SetterCallbackEvent(String* name, Address entry_point); static void SetterCallbackEvent(String* name, Address entry_point);
static void SFIMoveEvent(Address from, Address to); static void SharedFunctionMoveEvent(Address from, Address to);
static INLINE(bool is_profiling()) { static INLINE(bool is_profiling()) {
return NoBarrier_Load(&is_profiling_); return NoBarrier_Load(&is_profiling_);
......
...@@ -1341,7 +1341,7 @@ class ScavengingVisitor : public StaticVisitorBase { ...@@ -1341,7 +1341,7 @@ class ScavengingVisitor : public StaticVisitorBase {
#if defined(ENABLE_LOGGING_AND_PROFILING) #if defined(ENABLE_LOGGING_AND_PROFILING)
if (Logger::is_logging() || CpuProfiler::is_profiling()) { if (Logger::is_logging() || CpuProfiler::is_profiling()) {
if (target->IsSharedFunctionInfo()) { if (target->IsSharedFunctionInfo()) {
PROFILE(SFIMoveEvent(source->address(), target->address())); PROFILE(SharedFunctionMoveEvent(source->address(), target->address()));
} }
} }
#endif #endif
......
...@@ -881,9 +881,9 @@ void Logger::SnapshotPositionEvent(Address addr, int pos) { ...@@ -881,9 +881,9 @@ void Logger::SnapshotPositionEvent(Address addr, int pos) {
} }
void Logger::SFIMoveEvent(Address from, Address to) { void Logger::SharedFunctionMoveEvent(Address from, Address to) {
#ifdef ENABLE_LOGGING_AND_PROFILING #ifdef ENABLE_LOGGING_AND_PROFILING
MoveEventInternal(SFI_MOVE_EVENT, from, to); MoveEventInternal(SHARED_FUNC_MOVE_EVENT, from, to);
#endif #endif
} }
......
...@@ -91,7 +91,7 @@ class LogMessageBuilder; ...@@ -91,7 +91,7 @@ class LogMessageBuilder;
V(CODE_MOVE_EVENT, "code-move") \ V(CODE_MOVE_EVENT, "code-move") \
V(CODE_DELETE_EVENT, "code-delete") \ V(CODE_DELETE_EVENT, "code-delete") \
V(CODE_MOVING_GC, "code-moving-gc") \ V(CODE_MOVING_GC, "code-moving-gc") \
V(SFI_MOVE_EVENT, "sfi-move") \ V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
V(TICK_EVENT, "tick") \ V(TICK_EVENT, "tick") \
V(REPEAT_META_EVENT, "repeat") \ V(REPEAT_META_EVENT, "repeat") \
...@@ -224,7 +224,7 @@ class Logger { ...@@ -224,7 +224,7 @@ class Logger {
// Emits a code delete event. // Emits a code delete event.
static void CodeDeleteEvent(Address from); static void CodeDeleteEvent(Address from);
static void SFIMoveEvent(Address from, Address to); static void SharedFunctionMoveEvent(Address from, Address to);
static void SnapshotPositionEvent(Address addr, int pos); static void SnapshotPositionEvent(Address addr, int pos);
......
...@@ -2827,7 +2827,7 @@ int MarkCompactCollector::RelocateOldNonCodeObject(HeapObject* obj, ...@@ -2827,7 +2827,7 @@ int MarkCompactCollector::RelocateOldNonCodeObject(HeapObject* obj,
HeapObject* copied_to = HeapObject::FromAddress(new_addr); HeapObject* copied_to = HeapObject::FromAddress(new_addr);
if (copied_to->IsSharedFunctionInfo()) { if (copied_to->IsSharedFunctionInfo()) {
PROFILE(SFIMoveEvent(old_addr, new_addr)); PROFILE(SharedFunctionMoveEvent(old_addr, new_addr));
} }
HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
...@@ -2919,7 +2919,7 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) { ...@@ -2919,7 +2919,7 @@ int MarkCompactCollector::RelocateNewObject(HeapObject* obj) {
HeapObject* copied_to = HeapObject::FromAddress(new_addr); HeapObject* copied_to = HeapObject::FromAddress(new_addr);
if (copied_to->IsSharedFunctionInfo()) { if (copied_to->IsSharedFunctionInfo()) {
PROFILE(SFIMoveEvent(old_addr, new_addr)); PROFILE(SharedFunctionMoveEvent(old_addr, new_addr));
} }
HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr)); HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
......
...@@ -465,7 +465,7 @@ void CpuProfile::Print() { ...@@ -465,7 +465,7 @@ void CpuProfile::Print() {
} }
CodeEntry* const CodeMap::kSfiCodeEntry = NULL; CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL;
const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL; const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL;
const CodeMap::CodeTreeConfig::Value CodeMap::CodeTreeConfig::kNoValue = const CodeMap::CodeTreeConfig::Value CodeMap::CodeTreeConfig::kNoValue =
CodeMap::CodeEntryInfo(NULL, 0); CodeMap::CodeEntryInfo(NULL, 0);
...@@ -483,18 +483,18 @@ CodeEntry* CodeMap::FindEntry(Address addr) { ...@@ -483,18 +483,18 @@ CodeEntry* CodeMap::FindEntry(Address addr) {
} }
int CodeMap::GetSFITag(Address addr) { int CodeMap::GetSharedId(Address addr) {
CodeTree::Locator locator; CodeTree::Locator locator;
// For SFI entries, 'size' field is used to store their IDs. // For shared function entries, 'size' field is used to store their IDs.
if (tree_.Find(addr, &locator)) { if (tree_.Find(addr, &locator)) {
const CodeEntryInfo& entry = locator.value(); const CodeEntryInfo& entry = locator.value();
ASSERT(entry.entry == kSfiCodeEntry); ASSERT(entry.entry == kSharedFunctionCodeEntry);
return entry.size; return entry.size;
} else { } else {
tree_.Insert(addr, &locator); tree_.Insert(addr, &locator);
int tag = next_sfi_tag_++; int id = next_shared_id_++;
locator.set_value(CodeEntryInfo(kSfiCodeEntry, tag)); locator.set_value(CodeEntryInfo(kSharedFunctionCodeEntry, id));
return tag; return id;
} }
} }
......
...@@ -236,12 +236,12 @@ class CpuProfile { ...@@ -236,12 +236,12 @@ class CpuProfile {
class CodeMap { class CodeMap {
public: public:
CodeMap() : next_sfi_tag_(1) { } CodeMap() : next_shared_id_(1) { }
INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size)); INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size));
INLINE(void MoveCode(Address from, Address to)); INLINE(void MoveCode(Address from, Address to));
INLINE(void DeleteCode(Address addr)); INLINE(void DeleteCode(Address addr));
CodeEntry* FindEntry(Address addr); CodeEntry* FindEntry(Address addr);
int GetSFITag(Address addr); int GetSharedId(Address addr);
void Print(); void Print();
...@@ -269,11 +269,11 @@ class CodeMap { ...@@ -269,11 +269,11 @@ class CodeMap {
void Call(const Address& key, const CodeEntryInfo& value); void Call(const Address& key, const CodeEntryInfo& value);
}; };
// Fake CodeEntry pointer to distinguish SFI entries. // Fake CodeEntry pointer to distinguish shared function entries.
static CodeEntry* const kSfiCodeEntry; static CodeEntry* const kSharedFunctionCodeEntry;
CodeTree tree_; CodeTree tree_;
int next_sfi_tag_; int next_shared_id_;
DISALLOW_COPY_AND_ASSIGN(CodeMap); DISALLOW_COPY_AND_ASSIGN(CodeMap);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment