本文整理汇总了C++中HandleScript::lineno方法的典型用法代码示例。如果您正苦于以下问题:C++ HandleScript::lineno方法的具体用法?C++ HandleScript::lineno怎么用?C++ HandleScript::lineno使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandleScript
的用法示例。
在下文中一共展示了HandleScript::lineno方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sprinter
JS_DumpPCCounts(JSContext *cx, HandleScript script)
{
JS_ASSERT(script->hasScriptCounts());
Sprinter sprinter(cx);
if (!sprinter.init())
return;
fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
js_DumpPCCounts(cx, script, &sprinter);
fputs(sprinter.string(), stdout);
fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
}
示例2: getenv
static bool
FilterContainsLocation(HandleScript function)
{
static const char *filter = getenv("IONFILTER");
// If there is no filter we accept all outputs.
if (!filter || !filter[0])
return true;
// Disable asm.js output when filter is set.
if (!function)
return false;
const char *filename = function->filename();
const size_t line = function->lineno();
const size_t filelen = strlen(filename);
const char *index = strstr(filter, filename);
while (index) {
if (index == filter || index[-1] == ',') {
if (index[filelen] == 0 || index[filelen] == ',')
return true;
if (index[filelen] == ':' && line != size_t(-1)) {
size_t read_line = strtoul(&index[filelen + 1], nullptr, 10);
if (read_line == line)
return true;
}
}
index = strstr(index + filelen, filename);
}
return false;
}
示例3: fprintf
void
C1Spewer::beginFunction(MIRGraph *graph, HandleScript script)
{
if (!spewout_)
return;
this->graph = graph;
fprintf(spewout_, "begin_compilation\n");
if (script) {
fprintf(spewout_, " name \"%s:%d\"\n", script->filename(), (int)script->lineno());
fprintf(spewout_, " method \"%s:%d\"\n", script->filename(), (int)script->lineno());
} else {
fprintf(spewout_, " name \"asm.js compilation\"\n");
fprintf(spewout_, " method \"asm.js compilation\"\n");
}
fprintf(spewout_, " date %d\n", (int)time(nullptr));
fprintf(spewout_, "end_compilation\n");
}