Changeset 208968 in webkit
- Timestamp:
- Nov 22, 2016 12:52:05 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r208966 r208968 1 2016-11-18 Mark Lam <mark.lam@apple.com> 2 3 Fix exception scope verification failures in JSC profiler files. 4 https://bugs.webkit.org/show_bug.cgi?id=164971 5 6 Reviewed by Saam Barati. 7 8 * profiler/ProfilerBytecodeSequence.cpp: 9 (JSC::Profiler::BytecodeSequence::addSequenceProperties): 10 * profiler/ProfilerCompilation.cpp: 11 (JSC::Profiler::Compilation::toJS): 12 * profiler/ProfilerDatabase.cpp: 13 (JSC::Profiler::Database::toJS): 14 (JSC::Profiler::Database::toJSON): 15 * profiler/ProfilerOSRExitSite.cpp: 16 (JSC::Profiler::OSRExitSite::toJS): 17 * profiler/ProfilerOriginStack.cpp: 18 (JSC::Profiler::OriginStack::toJS): 19 1 20 2016-11-22 Mark Lam <mark.lam@apple.com> 2 21 -
trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
r208761 r208968 83 83 JSArray* header = constructEmptyArray(exec, 0); 84 84 RETURN_IF_EXCEPTION(scope, void()); 85 for (unsigned i = 0; i < m_header.size(); ++i) 85 for (unsigned i = 0; i < m_header.size(); ++i) { 86 86 header->putDirectIndex(exec, i, jsString(exec, String::fromUTF8(m_header[i]))); 87 RETURN_IF_EXCEPTION(scope, void()); 88 } 87 89 result->putDirect(vm, exec->propertyNames().header, header); 88 90 89 91 JSArray* sequence = constructEmptyArray(exec, 0); 90 92 RETURN_IF_EXCEPTION(scope, void()); 91 for (unsigned i = 0; i < m_sequence.size(); ++i) 93 for (unsigned i = 0; i < m_sequence.size(); ++i) { 92 94 sequence->putDirectIndex(exec, i, m_sequence[i].toJS(exec)); 95 RETURN_IF_EXCEPTION(scope, void()); 96 } 93 97 result->putDirect(vm, exec->propertyNames().bytecode, sequence); 94 98 } -
trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
r206386 r208968 118 118 auto scope = DECLARE_THROW_SCOPE(vm); 119 119 JSObject* result = constructEmptyObject(exec); 120 RETURN_IF_EXCEPTION(scope, JSValue());120 RETURN_IF_EXCEPTION(scope, { }); 121 121 result->putDirect(vm, exec->propertyNames().bytecodesID, jsNumber(m_bytecodes->id())); 122 122 result->putDirect(vm, exec->propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind)))); 123 123 124 124 JSArray* profiledBytecodes = constructEmptyArray(exec, 0); 125 RETURN_IF_EXCEPTION(scope, JSValue()); 126 for (unsigned i = 0; i < m_profiledBytecodes.size(); ++i) 127 profiledBytecodes->putDirectIndex(exec, i, m_profiledBytecodes[i].toJS(exec)); 125 RETURN_IF_EXCEPTION(scope, { }); 126 for (unsigned i = 0; i < m_profiledBytecodes.size(); ++i) { 127 auto value = m_profiledBytecodes[i].toJS(exec); 128 RETURN_IF_EXCEPTION(scope, { }); 129 profiledBytecodes->putDirectIndex(exec, i, value); 130 RETURN_IF_EXCEPTION(scope, { }); 131 } 128 132 result->putDirect(vm, exec->propertyNames().profiledBytecodes, profiledBytecodes); 129 133 130 134 JSArray* descriptions = constructEmptyArray(exec, 0); 131 RETURN_IF_EXCEPTION(scope, JSValue()); 132 for (unsigned i = 0; i < m_descriptions.size(); ++i) 133 descriptions->putDirectIndex(exec, i, m_descriptions[i].toJS(exec)); 135 RETURN_IF_EXCEPTION(scope, { }); 136 for (unsigned i = 0; i < m_descriptions.size(); ++i) { 137 auto value = m_descriptions[i].toJS(exec); 138 RETURN_IF_EXCEPTION(scope, { }); 139 descriptions->putDirectIndex(exec, i, value); 140 RETURN_IF_EXCEPTION(scope, { }); 141 } 134 142 result->putDirect(vm, exec->propertyNames().descriptions, descriptions); 135 143 136 144 JSArray* counters = constructEmptyArray(exec, 0); 137 RETURN_IF_EXCEPTION(scope, JSValue());145 RETURN_IF_EXCEPTION(scope, { }); 138 146 for (auto it = m_counters.begin(), end = m_counters.end(); it != end; ++it) { 139 147 JSObject* counterEntry = constructEmptyObject(exec); 140 counterEntry->putDirect(vm, exec->propertyNames().origin, it->key.toJS(exec)); 148 RETURN_IF_EXCEPTION(scope, { }); 149 auto value = it->key.toJS(exec); 150 RETURN_IF_EXCEPTION(scope, { }); 151 counterEntry->putDirect(vm, exec->propertyNames().origin, value); 141 152 counterEntry->putDirect(vm, exec->propertyNames().executionCount, jsNumber(it->value->count())); 142 153 counters->push(exec, counterEntry); 154 RETURN_IF_EXCEPTION(scope, { }); 143 155 } 144 156 result->putDirect(vm, exec->propertyNames().counters, counters); 145 157 146 158 JSArray* exitSites = constructEmptyArray(exec, 0); 147 RETURN_IF_EXCEPTION(scope, JSValue()); 148 for (unsigned i = 0; i < m_osrExitSites.size(); ++i) 149 exitSites->putDirectIndex(exec, i, m_osrExitSites[i].toJS(exec)); 159 RETURN_IF_EXCEPTION(scope, { }); 160 for (unsigned i = 0; i < m_osrExitSites.size(); ++i) { 161 auto value = m_osrExitSites[i].toJS(exec); 162 RETURN_IF_EXCEPTION(scope, { }); 163 exitSites->putDirectIndex(exec, i, value); 164 RETURN_IF_EXCEPTION(scope, { }); 165 } 150 166 result->putDirect(vm, exec->propertyNames().osrExitSites, exitSites); 151 167 152 168 JSArray* exits = constructEmptyArray(exec, 0); 153 RETURN_IF_EXCEPTION(scope, JSValue());154 for (unsigned i = 0; i < m_osrExits.size(); ++i) 169 RETURN_IF_EXCEPTION(scope, { }); 170 for (unsigned i = 0; i < m_osrExits.size(); ++i) { 155 171 exits->putDirectIndex(exec, i, m_osrExits[i].toJS(exec)); 172 RETURN_IF_EXCEPTION(scope, { }); 173 } 156 174 result->putDirect(vm, exec->propertyNames().osrExits, exits); 157 175 -
trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
r206459 r208968 105 105 106 106 JSArray* bytecodes = constructEmptyArray(exec, 0); 107 RETURN_IF_EXCEPTION(scope, JSValue()); 108 for (unsigned i = 0; i < m_bytecodes.size(); ++i) 109 bytecodes->putDirectIndex(exec, i, m_bytecodes[i].toJS(exec)); 107 RETURN_IF_EXCEPTION(scope, { }); 108 for (unsigned i = 0; i < m_bytecodes.size(); ++i) { 109 auto value = m_bytecodes[i].toJS(exec); 110 RETURN_IF_EXCEPTION(scope, { }); 111 bytecodes->putDirectIndex(exec, i, value); 112 RETURN_IF_EXCEPTION(scope, { }); 113 } 110 114 result->putDirect(vm, exec->propertyNames().bytecodes, bytecodes); 111 115 112 116 JSArray* compilations = constructEmptyArray(exec, 0); 113 RETURN_IF_EXCEPTION(scope, JSValue()); 114 for (unsigned i = 0; i < m_compilations.size(); ++i) 115 compilations->putDirectIndex(exec, i, m_compilations[i]->toJS(exec)); 117 RETURN_IF_EXCEPTION(scope, { }); 118 for (unsigned i = 0; i < m_compilations.size(); ++i) { 119 auto value = m_compilations[i]->toJS(exec); 120 RETURN_IF_EXCEPTION(scope, { }); 121 compilations->putDirectIndex(exec, i, value); 122 RETURN_IF_EXCEPTION(scope, { }); 123 } 116 124 result->putDirect(vm, exec->propertyNames().compilations, compilations); 117 125 118 126 JSArray* events = constructEmptyArray(exec, 0); 119 RETURN_IF_EXCEPTION(scope, JSValue()); 120 for (unsigned i = 0; i < m_events.size(); ++i) 121 events->putDirectIndex(exec, i, m_events[i].toJS(exec)); 127 RETURN_IF_EXCEPTION(scope, { }); 128 for (unsigned i = 0; i < m_events.size(); ++i) { 129 auto value = m_events[i].toJS(exec); 130 RETURN_IF_EXCEPTION(scope, { }); 131 events->putDirectIndex(exec, i, value); 132 RETURN_IF_EXCEPTION(scope, { }); 133 } 122 134 result->putDirect(vm, exec->propertyNames().events, events); 123 135 … … 127 139 String Database::toJSON() const 128 140 { 141 auto scope = DECLARE_THROW_SCOPE(m_vm); 129 142 JSGlobalObject* globalObject = JSGlobalObject::create( 130 143 m_vm, JSGlobalObject::createStructure(m_vm, jsNull())); 131 132 return JSONStringify(globalObject->globalExec(), toJS(globalObject->globalExec()), 0); 144 145 auto value = toJS(globalObject->globalExec()); 146 RETURN_IF_EXCEPTION(scope, String()); 147 scope.release(); 148 return JSONStringify(globalObject->globalExec(), value, 0); 133 149 } 134 150 -
trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
r206386 r208968 40 40 auto scope = DECLARE_THROW_SCOPE(vm); 41 41 JSArray* result = constructEmptyArray(exec, 0); 42 RETURN_IF_EXCEPTION(scope, JSValue());43 for (unsigned i = 0; i < m_codeAddresses.size(); ++i) 42 RETURN_IF_EXCEPTION(scope, { }); 43 for (unsigned i = 0; i < m_codeAddresses.size(); ++i) { 44 44 result->putDirectIndex(exec, i, jsString(exec, toString(RawPointer(m_codeAddresses[i])))); 45 RETURN_IF_EXCEPTION(scope, { }); 46 } 45 47 return result; 46 48 } -
trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
r206386 r208968 104 104 auto scope = DECLARE_THROW_SCOPE(vm); 105 105 JSArray* result = constructEmptyArray(exec, 0); 106 RETURN_IF_EXCEPTION(scope, JSValue());106 RETURN_IF_EXCEPTION(scope, { }); 107 107 108 for (unsigned i = 0; i < m_stack.size(); ++i) 108 for (unsigned i = 0; i < m_stack.size(); ++i) { 109 109 result->putDirectIndex(exec, i, m_stack[i].toJS(exec)); 110 RETURN_IF_EXCEPTION(scope, { }); 111 } 110 112 111 113 return result;
Note: See TracChangeset
for help on using the changeset viewer.