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

Unified Diff: src/tracing/event-tracer.cc

Issue 827993003: Integrate Chrome tracing with V8 (WIP) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 5 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 | « src/log-inl.h ('k') | src/tracing/trace-event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tracing/event-tracer.cc
diff --git a/test/mjsunit/regress/regress-3218915.js b/src/tracing/event-tracer.cc
similarity index 55%
copy from test/mjsunit/regress/regress-3218915.js
copy to src/tracing/event-tracer.cc
index 4b08a6e82508309459ff5dc18d4994fad76effe3..6ed92ba5f08432f615fc6bfb4a2bf10547982dab 100644
--- a/test/mjsunit/regress/regress-3218915.js
+++ b/src/tracing/event-tracer.cc
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,22 +25,47 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
+#include <include/v8-tracing.h>
+#include <stdio.h>
+#ifndef NULL
+#define NULL (0)
+#endif
-// Checks that comma expression in conditional context is processed correctly.
+class DefaultEventTracer : public v8::EventTracer {
+ virtual v8::EventTracer::Handle addTraceEvent(
+ char phase, const uint8_t* categoryEnabledFlag, const char* name,
+ uint64_t id, int numArgs, const char** argNames, const uint8_t* argTypes,
+ const uint64_t* argValues, uint8_t flags) {
+ return 0;
+ }
+
+ virtual void updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
+ const char* name,
+ EventTracer::Handle handle) {}
-function withCommaExpressionInConditional(x) {
- if (x > 1000) { for (var i = 0; i < 10000; i++) { } }
- var y;
- if (y = x, y > 1) {
- return 'big';
+ virtual const uint8_t* getCategoryGroupEnabled(const char* name) {
+ static uint8_t no = 0x7;
+ return &no;
+ }
+
+ virtual const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) {
+ static const char* dummy = "V8";
+ return dummy;
+ }
+};
+
+v8::EventTracer* v8::EventTracer::gInstance;
+
+static void intialize_default_tracer(v8::EventTracer* current_instance) {
+ if (NULL == current_instance) {
+ v8::EventTracer::SetInstance(new (DefaultEventTracer));
}
- return (y = x + 1, y > 1) ? 'medium' : 'small';
}
-for (var i = 0; i < 5; i++) {
- withCommaExpressionInConditional(i);
+
+v8::EventTracer* v8::EventTracer::GetInstance() {
+ if (NULL == v8::EventTracer::gInstance) {
+ intialize_default_tracer(NULL);
+ }
+ return v8::EventTracer::gInstance;
}
-%OptimizeFunctionOnNextCall(withCommaExpressionInConditional);
-withCommaExpressionInConditional(i);
-withCommaExpressionInConditional("1")
« no previous file with comments | « src/log-inl.h ('k') | src/tracing/trace-event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698