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

Unified Diff: src/libsampler/utils.h

Issue 1922303002: Create libsampler as V8 sampler library. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix TSAN failure Created 4 years, 7 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/libsampler/hashmap.h ('k') | src/libsampler/v8-sampler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libsampler/utils.h
diff --git a/test/mjsunit/regress/regress-crbug-580506.js b/src/libsampler/utils.h
similarity index 34%
copy from test/mjsunit/regress/regress-crbug-580506.js
copy to src/libsampler/utils.h
index fb036982cfbea449c85b31c24834d43216282a49..a0e28cefc85fadac722e71e70280f38994b38f36 100644
--- a/test/mjsunit/regress/regress-crbug-580506.js
+++ b/src/libsampler/utils.h
@@ -2,21 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --allow-natives-syntax
+#ifndef V8_LIBSAMPLER_UTILS_H_
+#define V8_LIBSAMPLER_UTILS_H_
-(function() {
- 'use strict';
- class A extends Function {
- constructor(...args) {
- super(...args);
- this.a = 42;
- }
+#include "include/v8.h"
+
+namespace v8 {
+namespace sampler {
+
+class Malloced {
+ public:
+ static void* New(size_t size) {
+ return malloc(size);
}
- var v1 = new A("'use strict';");
- function f(func) {
- func.__defineSetter__('a', function() { });
+
+ static void Delete(void* p) {
+ free(p);
}
- var v2 = new A();
- f(v2);
- f(v1);
-})();
+};
+
+} // namespace sampler
+} // namespace v8
+
+#endif // V8_LIBSAMPLER_UTILS_H_
« no previous file with comments | « src/libsampler/hashmap.h ('k') | src/libsampler/v8-sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698