Changeset 201787 in webkit for trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
- Timestamp:
- Jun 7, 2016, 7:53:32 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
r200658 r201787 115 115 JSValue Compilation::toJS(ExecState* exec) const 116 116 { 117 VM& vm = exec->vm(); 117 118 JSObject* result = constructEmptyObject(exec); 118 119 result->putDirect(exec->vm(), exec->propertyNames().bytecodesID, jsNumber(m_bytecodes->id())); 120 result->putDirect(exec->vm(), exec->propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind)))); 119 if (UNLIKELY(vm.exception())) 120 return jsUndefined(); 121 result->putDirect(vm, exec->propertyNames().bytecodesID, jsNumber(m_bytecodes->id())); 122 result->putDirect(vm, exec->propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind)))); 121 123 122 124 JSArray* profiledBytecodes = constructEmptyArray(exec, 0); 125 if (UNLIKELY(vm.exception())) 126 return jsUndefined(); 123 127 for (unsigned i = 0; i < m_profiledBytecodes.size(); ++i) 124 128 profiledBytecodes->putDirectIndex(exec, i, m_profiledBytecodes[i].toJS(exec)); 125 result->putDirect( exec->vm(), exec->propertyNames().profiledBytecodes, profiledBytecodes);129 result->putDirect(vm, exec->propertyNames().profiledBytecodes, profiledBytecodes); 126 130 127 131 JSArray* descriptions = constructEmptyArray(exec, 0); 132 if (UNLIKELY(vm.exception())) 133 return jsUndefined(); 128 134 for (unsigned i = 0; i < m_descriptions.size(); ++i) 129 135 descriptions->putDirectIndex(exec, i, m_descriptions[i].toJS(exec)); 130 result->putDirect( exec->vm(), exec->propertyNames().descriptions, descriptions);136 result->putDirect(vm, exec->propertyNames().descriptions, descriptions); 131 137 132 138 JSArray* counters = constructEmptyArray(exec, 0); 139 if (UNLIKELY(vm.exception())) 140 return jsUndefined(); 133 141 for (auto it = m_counters.begin(), end = m_counters.end(); it != end; ++it) { 134 142 JSObject* counterEntry = constructEmptyObject(exec); 135 counterEntry->putDirect( exec->vm(), exec->propertyNames().origin, it->key.toJS(exec));136 counterEntry->putDirect( exec->vm(), exec->propertyNames().executionCount, jsNumber(it->value->count()));143 counterEntry->putDirect(vm, exec->propertyNames().origin, it->key.toJS(exec)); 144 counterEntry->putDirect(vm, exec->propertyNames().executionCount, jsNumber(it->value->count())); 137 145 counters->push(exec, counterEntry); 138 146 } 139 result->putDirect( exec->vm(), exec->propertyNames().counters, counters);147 result->putDirect(vm, exec->propertyNames().counters, counters); 140 148 141 149 JSArray* exitSites = constructEmptyArray(exec, 0); 150 if (UNLIKELY(vm.exception())) 151 return jsUndefined(); 142 152 for (unsigned i = 0; i < m_osrExitSites.size(); ++i) 143 153 exitSites->putDirectIndex(exec, i, m_osrExitSites[i].toJS(exec)); 144 result->putDirect( exec->vm(), exec->propertyNames().osrExitSites, exitSites);154 result->putDirect(vm, exec->propertyNames().osrExitSites, exitSites); 145 155 146 156 JSArray* exits = constructEmptyArray(exec, 0); 157 if (UNLIKELY(vm.exception())) 158 return jsUndefined(); 147 159 for (unsigned i = 0; i < m_osrExits.size(); ++i) 148 160 exits->putDirectIndex(exec, i, m_osrExits[i].toJS(exec)); 149 result->putDirect( exec->vm(), exec->propertyNames().osrExits, exits);161 result->putDirect(vm, exec->propertyNames().osrExits, exits); 150 162 151 result->putDirect( exec->vm(), exec->propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));152 result->putDirect( exec->vm(), exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));153 result->putDirect( exec->vm(), exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));154 result->putDirect( exec->vm(), exec->propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason))));163 result->putDirect(vm, exec->propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds)); 164 result->putDirect(vm, exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds)); 165 result->putDirect(vm, exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls)); 166 result->putDirect(vm, exec->propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason)))); 155 167 if (!m_additionalJettisonReason.isNull()) 156 result->putDirect( exec->vm(), exec->propertyNames().additionalJettisonReason, jsString(exec, String::fromUTF8(m_additionalJettisonReason)));168 result->putDirect(vm, exec->propertyNames().additionalJettisonReason, jsString(exec, String::fromUTF8(m_additionalJettisonReason))); 157 169 158 result->putDirect( exec->vm(), exec->propertyNames().uid, m_uid.toJS(exec));170 result->putDirect(vm, exec->propertyNames().uid, m_uid.toJS(exec)); 159 171 160 172 return result;
Note:
See TracChangeset
for help on using the changeset viewer.