void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) {
code_map->AddCode(start, entry, size);
- if (sfi_address != NULL) {
- entry->set_shared_id(code_map->GetSFITag(sfi_address));
+ if (shared != NULL) {
+ entry->set_shared_id(code_map->GetSharedId(shared));
}
}
}
-void SFIMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
+void SharedFunctionInfoMoveEventRecord::UpdateCodeMap(CodeMap* code_map) {
code_map->MoveCode(from, to);
}
rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, prefix, name);
rec->size = 1;
- rec->sfi_address = NULL;
+ rec->shared = NULL;
events_buffer_.Enqueue(evt_rec);
}
int line_number,
Address start,
unsigned size,
- Address sfi_address) {
+ Address shared) {
if (FilterOutCodeCreateEvent(tag)) return;
CodeEventsContainer evt_rec;
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number);
rec->size = size;
- rec->sfi_address = sfi_address;
+ rec->shared = shared;
events_buffer_.Enqueue(evt_rec);
}
rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, name);
rec->size = size;
- rec->sfi_address = NULL;
+ rec->shared = NULL;
events_buffer_.Enqueue(evt_rec);
}
rec->start = start;
rec->entry = generator_->NewCodeEntry(tag, args_count);
rec->size = size;
- rec->sfi_address = NULL;
+ rec->shared = NULL;
events_buffer_.Enqueue(evt_rec);
}
}
-void ProfilerEventsProcessor::SFIMoveEvent(Address from, Address to) {
+void ProfilerEventsProcessor::SharedFunctionInfoMoveEvent(Address from,
+ Address to) {
CodeEventsContainer evt_rec;
- SFIMoveEventRecord* rec = &evt_rec.SFIMoveEventRecord_;
- rec->type = CodeEventRecord::SFI_MOVE;
+ SharedFunctionInfoMoveEventRecord* rec =
+ &evt_rec.SharedFunctionInfoMoveEventRecord_;
+ rec->type = CodeEventRecord::SHARED_FUNC_MOVE;
rec->order = ++enqueue_order_;
rec->from = from;
rec->to = to;
}
-void CpuProfiler::SFIMoveEvent(Address from, Address to) {
- singleton_->processor_->SFIMoveEvent(from, to);
+void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) {
+ singleton_->processor_->SharedFunctionInfoMoveEvent(from, to);
}
class ProfileGenerator;
class TokenEnumerator;
-#define CODE_EVENTS_TYPE_LIST(V) \
- V(CODE_CREATION, CodeCreateEventRecord) \
- V(CODE_MOVE, CodeMoveEventRecord) \
- V(CODE_DELETE, CodeDeleteEventRecord) \
- V(SFI_MOVE, SFIMoveEventRecord)
+#define CODE_EVENTS_TYPE_LIST(V) \
+ V(CODE_CREATION, CodeCreateEventRecord) \
+ V(CODE_MOVE, CodeMoveEventRecord) \
+ V(CODE_DELETE, CodeDeleteEventRecord) \
+ V(SHARED_FUNC_MOVE, SharedFunctionInfoMoveEventRecord)
class CodeEventRecord {
Address start;
CodeEntry* entry;
unsigned size;
- Address sfi_address;
+ Address shared;
INLINE(void UpdateCodeMap(CodeMap* code_map));
};
};
-class SFIMoveEventRecord : public CodeEventRecord {
+class SharedFunctionInfoMoveEventRecord : public CodeEventRecord {
public:
Address from;
Address to;
String* name,
String* resource_name, int line_number,
Address start, unsigned size,
- Address sfi_address);
+ Address shared);
void CodeCreateEvent(Logger::LogEventsAndTags tag,
const char* name,
Address start, unsigned size);
Address start, unsigned size);
void CodeMoveEvent(Address from, Address to);
void CodeDeleteEvent(Address from);
- void SFIMoveEvent(Address from, Address to);
+ void SharedFunctionInfoMoveEvent(Address from, Address to);
void RegExpCodeCreateEvent(Logger::LogEventsAndTags tag,
const char* prefix, String* name,
Address start, unsigned size);
static void GetterCallbackEvent(String* name, Address entry_point);
static void RegExpCodeCreateEvent(Code* code, String* source);
static void SetterCallbackEvent(String* name, Address entry_point);
- static void SFIMoveEvent(Address from, Address to);
+ static void SharedFunctionInfoMoveEvent(Address from, Address to);
static INLINE(bool is_profiling()) {
return NoBarrier_Load(&is_profiling_);
#if defined(ENABLE_LOGGING_AND_PROFILING)
if (Logger::is_logging() || CpuProfiler::is_profiling()) {
if (target->IsSharedFunctionInfo()) {
- PROFILE(SFIMoveEvent(source->address(), target->address()));
+ PROFILE(SharedFunctionInfoMoveEvent(
+ source->address(), target->address()));
}
}
#endif
}
-void Logger::SFIMoveEvent(Address from, Address to) {
+void Logger::SharedFunctionInfoMoveEvent(Address from, Address to) {
#ifdef ENABLE_LOGGING_AND_PROFILING
- MoveEventInternal(SFI_MOVE_EVENT, from, to);
+ MoveEventInternal(SHARED_FUNC_MOVE_EVENT, from, to);
#endif
}
V(CODE_MOVE_EVENT, "code-move") \
V(CODE_DELETE_EVENT, "code-delete") \
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(TICK_EVENT, "tick") \
V(REPEAT_META_EVENT, "repeat") \
// Emits a code delete event.
static void CodeDeleteEvent(Address from);
- static void SFIMoveEvent(Address from, Address to);
+ static void SharedFunctionInfoMoveEvent(Address from, Address to);
static void SnapshotPositionEvent(Address addr, int pos);
HeapObject* copied_to = HeapObject::FromAddress(new_addr);
if (copied_to->IsSharedFunctionInfo()) {
- PROFILE(SFIMoveEvent(old_addr, new_addr));
+ PROFILE(SharedFunctionInfoMoveEvent(old_addr, new_addr));
}
HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
HeapObject* copied_to = HeapObject::FromAddress(new_addr);
if (copied_to->IsSharedFunctionInfo()) {
- PROFILE(SFIMoveEvent(old_addr, new_addr));
+ PROFILE(SharedFunctionInfoMoveEvent(old_addr, new_addr));
}
HEAP_PROFILE(ObjectMoveEvent(old_addr, new_addr));
}
-CodeEntry* const CodeMap::kSfiCodeEntry = NULL;
+CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL;
const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL;
const CodeMap::CodeTreeConfig::Value CodeMap::CodeTreeConfig::kNoValue =
CodeMap::CodeEntryInfo(NULL, 0);
}
-int CodeMap::GetSFITag(Address addr) {
+int CodeMap::GetSharedId(Address addr) {
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)) {
const CodeEntryInfo& entry = locator.value();
- ASSERT(entry.entry == kSfiCodeEntry);
+ ASSERT(entry.entry == kSharedFunctionCodeEntry);
return entry.size;
} else {
tree_.Insert(addr, &locator);
- int tag = next_sfi_tag_++;
- locator.set_value(CodeEntryInfo(kSfiCodeEntry, tag));
- return tag;
+ int id = next_shared_id_++;
+ locator.set_value(CodeEntryInfo(kSharedFunctionCodeEntry, id));
+ return id;
}
}
class CodeMap {
public:
- CodeMap() : next_sfi_tag_(1) { }
+ CodeMap() : next_shared_id_(1) { }
INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size));
INLINE(void MoveCode(Address from, Address to));
INLINE(void DeleteCode(Address addr));
CodeEntry* FindEntry(Address addr);
- int GetSFITag(Address addr);
+ int GetSharedId(Address addr);
void Print();
void Call(const Address& key, const CodeEntryInfo& value);
};
- // Fake CodeEntry pointer to distinguish SFI entries.
- static CodeEntry* const kSfiCodeEntry;
+ // Fake CodeEntry pointer to distinguish shared function entries.
+ static CodeEntry* const kSharedFunctionCodeEntry;
CodeTree tree_;
- int next_sfi_tag_;
+ int next_shared_id_;
DISALLOW_COPY_AND_ASSIGN(CodeMap);
};