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);
}
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,
// 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()));
}
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,
}
+#ifdef ENABLE_LOGGING_AND_PROFILING
+
bool CodeGenerator::ShouldGenerateLog(Expression* type) {
ASSERT(type != NULL);
if (!Logger::is_enabled()) return false;
return false;
}
+#endif
+
// Sets the function info on a function.
// The start_position points to the first '(' character after the function name
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++) {
}
}
fputc('\n', logfile_);
+#endif
}
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.