Fixed build with no ENABLE_LOGGING_AND_PROFILING


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e639876d
......@@ -2580,11 +2580,13 @@ void CodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) {
void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) {
// See comment in CodeGenerator::GenerateLog in codegen-ia32.cc.
ASSERT_EQ(args->length(), 3);
#ifdef ENABLE_LOGGING_AND_PROFILING
if (ShouldGenerateLog(args->at(0))) {
Load(args->at(1));
Load(args->at(2));
__ CallRuntime(Runtime::kLog, 2);
}
#endif
__ mov(r0, Operand(Factory::undefined_value()));
frame_->Push(r0);
}
......
......@@ -195,7 +195,9 @@ class CodeGenerator: public AstVisitor {
Handle<Script> script,
bool is_eval);
#ifdef ENABLE_LOGGING_AND_PROFILING
static bool ShouldGenerateLog(Expression* type);
#endif
static void SetFunctionInfo(Handle<JSFunction> fun,
int length,
......
......@@ -2909,11 +2909,13 @@ void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) {
// with '%2s' (see Logger::LogRuntime for all the formats).
// 2 (array): Arguments to the format string.
ASSERT_EQ(args->length(), 3);
#ifdef ENABLE_LOGGING_AND_PROFILING
if (ShouldGenerateLog(args->at(0))) {
Load(args->at(1));
Load(args->at(2));
__ CallRuntime(Runtime::kLog, 2);
}
#endif
// Finally, we're expected to leave a value on the top of the stack.
frame_->Push(Immediate(Factory::undefined_value()));
}
......
......@@ -201,7 +201,9 @@ class CodeGenerator: public AstVisitor {
Handle<Script> script,
bool is_eval);
#ifdef ENABLE_LOGGING_AND_PROFILING
static bool ShouldGenerateLog(Expression* type);
#endif
static void SetFunctionInfo(Handle<JSFunction> fun,
int length,
......
......@@ -163,6 +163,8 @@ Handle<Code> CodeGenerator::MakeCode(FunctionLiteral* flit,
}
#ifdef ENABLE_LOGGING_AND_PROFILING
bool CodeGenerator::ShouldGenerateLog(Expression* type) {
ASSERT(type != NULL);
if (!Logger::is_enabled()) return false;
......@@ -175,6 +177,8 @@ bool CodeGenerator::ShouldGenerateLog(Expression* type) {
return false;
}
#endif
// Sets the function info on a function.
// The start_position points to the first '(' character after the function name
......
......@@ -432,6 +432,7 @@ void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
void Logger::LogRuntime(Vector<const char> format, JSArray* args) {
#ifdef ENABLE_LOGGING_AND_PROFILING
ScopedLock sl(mutex_);
HandleScope scope;
for (int i = 0; i < format.length(); i++) {
......@@ -465,6 +466,7 @@ void Logger::LogRuntime(Vector<const char> format, JSArray* args) {
}
}
fputc('\n', logfile_);
#endif
}
......
......@@ -200,11 +200,9 @@ class Logger {
static StateTag state() {
return current_state_ ? current_state_->state() : OTHER;
}
#endif
static bool is_enabled() { return logfile_ != NULL; }
#ifdef ENABLE_LOGGING_AND_PROFILING
private:
// Emits the source code of a regexp. Used by regexp events.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment