Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: src/codegen.cc

Issue 16537: Runtime logging (Closed)
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codegen-arm.h » ('j') | src/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index f340c0c2f6b13c92c1932c0ee33e4b3ad5bbb68e..265f6badb2e5bd0675ff6a3a5a735050162c491d 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -163,6 +163,19 @@ Handle<Code> CodeGenerator::MakeCode(FunctionLiteral* flit,
}
+bool CodeGenerator::ShouldGenerateLog(Expression* type) {
+ ASSERT(type != NULL);
+ if (!Logger::is_enabled()) return false;
+ Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle());
+ if (FLAG_log_regexp) {
+ static Vector<const char> kRegexp = CStrVector("regexp");
+ if (name->IsEqualTo(kRegexp))
+ return true;
+ }
+ return false;
+}
+
+
// Sets the function info on a function.
// The start_position points to the first '(' character after the function name
// in the full script source. When counting characters in the script source the
@@ -338,7 +351,9 @@ bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) {
{&v8::internal::CodeGenerator::GenerateFastCharCodeAt,
"_FastCharCodeAt"},
{&v8::internal::CodeGenerator::GenerateObjectEquals,
- "_ObjectEquals"}
+ "_ObjectEquals"},
+ {&v8::internal::CodeGenerator::GenerateLog,
+ "_Log"}
};
Handle<String> name = node->name();
StringShape shape(*name);
« no previous file with comments | « no previous file | src/codegen-arm.h » ('j') | src/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698