Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Revert of Create libsampler as V8 sampler library. (patchset #24 id:4…
Browse files Browse the repository at this point in the history
…60001 of https://codereview.chromium.org/1922303002/ )

Reason for revert:
V8 Linux64 TSAN failure because ThreadSanitizer indicated data race.

Original issue's description:
> Create libsampler as V8 sampler library.
>
> This patch does five things:
>
> 1. Extracts sampler as libsampler to provide sampling functionality support.
> 2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
> 3. Removes sampler.[h|cc].
> 4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
> 5. Creates SamplerManager to manage the relationship between samplers and threads.
>
> The reason we port hashmap.h is that in debug mode, STL containers are using
> mutexes from a mutex pool, which may lead to deadlock when using asynchronously
> signal handler.
>
> Currently libsampler is used in V8 temporarily.
>
> BUG=v8:4789
> LOG=n
>
> Committed: https://crrev.com/06cc9b7c176a6223971deaa9fbcafe1a05058c7b
> Cr-Commit-Position: refs/heads/master@{#36527}

TBR=jochen@chromium.org,alph@chromium.org,fmeawad@chromium.org,yangguo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4789

Review-Url: https://codereview.chromium.org/2000323007
Cr-Commit-Position: refs/heads/master@{#36529}
  • Loading branch information
lpy authored and Commit bot committed May 25, 2016
1 parent 91e2039 commit 636f1e8
Show file tree
Hide file tree
Showing 19 changed files with 878 additions and 1,294 deletions.
25 changes: 2 additions & 23 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ config("libplatform_config") {
include_dirs = [ "include" ]
}

# This config should be applied to code using the libsampler.
config("libsampler_config") {
include_dirs = [ "include" ]
}

# This config should only be applied to code using V8 and not any V8 code
# itself.
config("external_config") {
Expand Down Expand Up @@ -1334,6 +1329,8 @@ v8_source_set("v8_base") {
"src/profiler/profile-generator-inl.h",
"src/profiler/profile-generator.cc",
"src/profiler/profile-generator.h",
"src/profiler/sampler.cc",
"src/profiler/sampler.h",
"src/profiler/sampling-heap-profiler.cc",
"src/profiler/sampling-heap-profiler.h",
"src/profiler/strings-storage.cc",
Expand Down Expand Up @@ -1819,7 +1816,6 @@ v8_source_set("v8_base") {
defines = []
deps = [
":v8_libbase",
":v8_libsampler",
]

if (is_win) {
Expand Down Expand Up @@ -1974,23 +1970,6 @@ v8_source_set("v8_libplatform") {
]
}

v8_source_set("v8_libsampler") {
sources = [
"src/libsampler/hashmap.h",
"src/libsampler/utils.h",
"src/libsampler/v8-sampler.cc",
"src/libsampler/v8-sampler.h",
]

configs = [ ":internal_config_base" ]

public_configs = [ ":libsampler_config" ]

deps = [
":v8_libbase",
]
}

v8_source_set("fuzzer_support") {
visibility = [ ":*" ] # Only targets in this file can depend on this.

Expand Down
6 changes: 0 additions & 6 deletions include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6331,12 +6331,6 @@ class V8_EXPORT Isolate {
*/
void VisitWeakHandles(PersistentHandleVisitor* visitor);

/**
* Check if this isolate is in use.
* True if at least one thread Enter'ed this isolate.
*/
bool IsInUse();

private:
template <class K, class V, class Traits>
friend class PersistentValueMapBase;
Expand Down
6 changes: 0 additions & 6 deletions src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7793,12 +7793,6 @@ void Isolate::VisitExternalResources(ExternalResourceVisitor* visitor) {
}


bool Isolate::IsInUse() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return isolate->IsInUse();
}


class VisitorAdapter : public i::ObjectVisitor {
public:
explicit VisitorAdapter(PersistentHandleVisitor* visitor)
Expand Down
4 changes: 2 additions & 2 deletions src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
#include "src/ic/stub-cache.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/libsampler/v8-sampler.h"
#include "src/log.h"
#include "src/messages.h"
#include "src/profiler/cpu-profiler.h"
#include "src/profiler/sampler.h"
#include "src/prototype.h"
#include "src/regexp/regexp-stack.h"
#include "src/runtime-profiler.h"
Expand Down Expand Up @@ -2006,7 +2006,7 @@ void Isolate::Deinit() {
}

// We must stop the logger before we tear down other components.
sampler::Sampler* sampler = logger_->sampler();
Sampler* sampler = logger_->sampler();
if (sampler && sampler->IsActive()) sampler->Stop();

delete deoptimizer_data_;
Expand Down
6 changes: 0 additions & 6 deletions src/libsampler/DEPS

This file was deleted.

278 changes: 0 additions & 278 deletions src/libsampler/hashmap.h

This file was deleted.

Loading

0 comments on commit 636f1e8

Please sign in to comment.