Changeset 179479 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Feb 2, 2015, 11:05:46 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r178928 r179479 483 483 static EncodedJSValue JSC_HOST_CALL functionReturnTypeFor(ExecState*); 484 484 static EncodedJSValue JSC_HOST_CALL functionDumpBasicBlockExecutionRanges(ExecState*); 485 static EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(ExecState*); 485 486 486 487 #if ENABLE(SAMPLING_FLAGS) … … 639 640 640 641 addFunction(vm, "dumpBasicBlockExecutionRanges", functionDumpBasicBlockExecutionRanges , 0); 642 addFunction(vm, "hasBasicBlockExecuted", functionHasBasicBlockExecuted, 2); 641 643 642 644 JSArray* array = constructEmptyArray(globalExec(), 0); … … 1113 1115 exec->vm().controlFlowProfiler()->dumpData(); 1114 1116 return JSValue::encode(jsUndefined()); 1117 } 1118 1119 EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(ExecState* exec) 1120 { 1121 RELEASE_ASSERT(exec->vm().controlFlowProfiler()); 1122 1123 JSValue functionValue = exec->argument(0); 1124 RELEASE_ASSERT(functionValue.isFunction()); 1125 FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(functionValue.asCell()->getObject()))->jsExecutable(); 1126 1127 RELEASE_ASSERT(exec->argument(1).isString()); 1128 String substring = exec->argument(1).getString(exec); 1129 String sourceCodeText = executable->source().toString(); 1130 int offset = sourceCodeText.find(substring) + executable->source().startOffset(); 1131 1132 bool hasExecuted = exec->vm().controlFlowProfiler()->hasBasicBlockAtTextOffsetBeenExecuted(offset, executable->sourceID(), exec->vm()); 1133 return JSValue::encode(jsBoolean(hasExecuted)); 1115 1134 } 1116 1135
Note:
See TracChangeset
for help on using the changeset viewer.