class Visitor {
public:
- inline explicit Visitor()
- : utf8_length_(0),
- state_(kInitialState) {}
+ Visitor() : utf8_length_(0), state_(kInitialState) {}
void VisitOneByteString(const uint8_t* chars, int length) {
int utf8_length = 0;
// Class used to build a constant pool.
class ConstantPoolBuilder BASE_EMBEDDED {
public:
- explicit ConstantPoolBuilder();
+ ConstantPoolBuilder();
ConstantPoolArray::LayoutSection AddEntry(Assembler* assm,
const RelocInfo& rinfo);
void Relocate(int pc_delta);
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
// MemOperand represents a memory operand in a load or store instruction.
class MemOperand {
public:
- inline explicit MemOperand();
+ inline MemOperand();
inline explicit MemOperand(Register base,
ptrdiff_t offset = 0,
AddrMode addrmode = Offset);
class Counter {
public:
- Counter(const char* name, CounterType type = Gauge);
+ explicit Counter(const char* name, CounterType type = Gauge);
void Increment();
void Enable();
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 1> {
public:
- LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) {
+ explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) {
inputs_[0] = value;
temps_[0] = temp;
}
// emitted is what you specified when creating the scope.
class InstructionAccurateScope BASE_EMBEDDED {
public:
- InstructionAccurateScope(MacroAssembler* masm, size_t count = 0)
+ explicit InstructionAccurateScope(MacroAssembler* masm, size_t count = 0)
: masm_(masm)
#ifdef DEBUG
,
class Options {
public:
Options() : name_("v8:<unknown>"), stack_size_(0) {}
- Options(const char* name, int stack_size = 0)
+ explicit Options(const char* name, int stack_size = 0)
: name_(name), stack_size_(stack_size) {}
const char* name() const { return name_; }
INITIALIZED
};
- HydrogenCodeStub(Isolate* isolate, InitializationState state = INITIALIZED)
+ explicit HydrogenCodeStub(Isolate* isolate,
+ InitializationState state = INITIALIZED)
: CodeStub(isolate) {
is_uninitialized_ = (state == UNINITIALIZED);
}
Bounds bounds;
Effect() : modality(DEFINITE) {}
- Effect(Bounds b, Modality m = DEFINITE) : modality(m), bounds(b) {}
+ explicit Effect(Bounds b, Modality m = DEFINITE) : modality(m), bounds(b) {}
// The unknown effect.
static Effect Unknown(Zone* zone) {
return IsShl() || IsShr() || IsSar();
}
- HValue(HType type = HType::Tagged())
+ explicit HValue(HType type = HType::Tagged())
: block_(NULL),
id_(kNoNumber),
type_(type),
DECLARE_ABSTRACT_INSTRUCTION(Instruction)
protected:
- HInstruction(HType type = HType::Tagged())
+ explicit HInstruction(HType type = HType::Tagged())
: HValue(type),
next_(NULL),
previous_(NULL),
}
protected:
- HTemplateInstruction(HType type = HType::Tagged()) : HInstruction(type) {}
+ explicit HTemplateInstruction(HType type = HType::Tagged())
+ : HInstruction(type) {}
virtual void InternalSetOperandAt(int i, HValue* value) V8_FINAL V8_OVERRIDE {
inputs_[i] = value;
class HUnaryOperation : public HTemplateInstruction<1> {
public:
- HUnaryOperation(HValue* value, HType type = HType::Tagged())
+ explicit HUnaryOperation(HValue* value, HType type = HType::Tagged())
: HTemplateInstruction<1>(type) {
SetOperandAt(0, value);
}
}
private:
- HLoadRoot(Heap::RootListIndex index, HType type = HType::Tagged())
+ explicit HLoadRoot(Heap::RootListIndex index, HType type = HType::Tagged())
: HTemplateInstruction<0>(type), index_(index) {
SetFlag(kUseGVN);
// TODO(bmeurer): We'll need kDependsOnRoots once we add the
private:
friend class HGraph;
- HConstant(Handle<Object> handle, Representation r = Representation::None());
+ explicit HConstant(Handle<Object> handle,
+ Representation r = Representation::None());
HConstant(int32_t value,
Representation r = Representation::None(),
bool is_not_in_new_space = true,
class FunctionSorter {
public:
- FunctionSorter(int index = 0, int ticks = 0, int size = 0)
- : index_(index), ticks_(ticks), size_(size) { }
+ explicit FunctionSorter(int index = 0, int ticks = 0, int size = 0)
+ : index_(index), ticks_(ticks), size_(size) {}
int index() const { return index_; }
int ticks() const { return ticks_; }
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
// matching terminates.
class BacktrackStack {
public:
- explicit BacktrackStack() {
- data_ = NewArray<int>(kBacktrackStackSize);
- }
+ BacktrackStack() { data_ = NewArray<int>(kBacktrackStackSize); }
~BacktrackStack() {
DeleteArray(data_);
namespace platform {
WorkerThread::WorkerThread(TaskQueue* queue)
- : Thread("V8 WorkerThread"), queue_(queue) {
+ : Thread(Options("V8 WorkerThread")), queue_(queue) {
Start();
}
// Profiler implementation.
//
Profiler::Profiler(Isolate* isolate)
- : base::Thread("v8:Profiler"),
+ : base::Thread(Options("v8:Profiler")),
isolate_(isolate),
head_(0),
tail_(0),
buffer_semaphore_(0),
engaged_(false),
running_(false),
- paused_(false) {
-}
+ paused_(false) {}
void Profiler::Engage() {
#include "src/assembler.h"
#include "src/x64/assembler-x64.h"
#include "src/x64/assembler-x64-inl.h"
-#include "src/code.h" // must be after assembler_*.h
+#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/x64/macro-assembler-x64.h"
#elif V8_TARGET_ARCH_ARM64
#include "src/arm64/constants-arm64.h"
#include "src/assembler.h"
#include "src/arm64/assembler-arm64.h" // NOLINT
#include "src/arm64/assembler-arm64-inl.h"
-#include "src/code.h" // must be after assembler_*.h
-#include "src/arm64/macro-assembler-arm64.h"
+#include "src/code.h" // NOLINT, must be after assembler_*.h
+#include "src/arm64/macro-assembler-arm64.h" // NOLINT
#include "src/arm64/macro-assembler-arm64-inl.h"
#elif V8_TARGET_ARCH_ARM
#include "src/arm/constants-arm.h"
#include "src/assembler.h"
#include "src/arm/assembler-arm.h" // NOLINT
#include "src/arm/assembler-arm-inl.h"
-#include "src/code.h" // must be after assembler_*.h
-#include "src/arm/macro-assembler-arm.h"
+#include "src/code.h" // NOLINT, must be after assembler_*.h
+#include "src/arm/macro-assembler-arm.h" // NOLINT
#elif V8_TARGET_ARCH_MIPS
#include "src/mips/constants-mips.h"
-#include "src/assembler.h"
+#include "src/assembler.h" // NOLINT
#include "src/mips/assembler-mips.h" // NOLINT
#include "src/mips/assembler-mips-inl.h"
-#include "src/code.h" // must be after assembler_*.h
+#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/mips/macro-assembler-mips.h"
#elif V8_TARGET_ARCH_MIPS64
#include "src/mips64/constants-mips64.h"
-#include "src/assembler.h"
+#include "src/assembler.h" // NOLINT
#include "src/mips64/assembler-mips64.h" // NOLINT
#include "src/mips64/assembler-mips64-inl.h"
-#include "src/code.h" // must be after assembler_*.h
+#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/mips64/macro-assembler-mips64.h"
#elif V8_TARGET_ARCH_X87
#include "src/assembler.h"
#include "src/x87/assembler-x87.h"
#include "src/x87/assembler-x87-inl.h"
-#include "src/code.h" // must be after assembler_*.h
+#include "src/code.h" // NOLINT, must be after assembler_*.h
#include "src/x87/macro-assembler-x87.h"
#else
#error Unsupported target architecture.
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
class OptimizingCompilerThread : public base::Thread {
public:
- explicit OptimizingCompilerThread(Isolate *isolate) :
- Thread("OptimizingCompilerThread"),
+ explicit OptimizingCompilerThread(Isolate* isolate)
+ : Thread(Options("OptimizingCompilerThread")),
#ifdef DEBUG
- thread_id_(0),
+ thread_id_(0),
#endif
- isolate_(isolate),
- stop_semaphore_(0),
- input_queue_semaphore_(0),
- input_queue_capacity_(FLAG_concurrent_recompilation_queue_length),
- input_queue_length_(0),
- input_queue_shift_(0),
- osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4),
- osr_buffer_cursor_(0),
- osr_hits_(0),
- osr_attempts_(0),
- blocked_jobs_(0) {
+ isolate_(isolate),
+ stop_semaphore_(0),
+ input_queue_semaphore_(0),
+ input_queue_capacity_(FLAG_concurrent_recompilation_queue_length),
+ input_queue_length_(0),
+ input_queue_shift_(0),
+ osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4),
+ osr_buffer_cursor_(0),
+ osr_hits_(0),
+ osr_attempts_(0),
+ blocked_jobs_(0) {
base::NoBarrier_Store(&stop_thread_,
static_cast<base::AtomicWord>(CONTINUE));
input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_);
class Locator;
- SplayTree(AllocationPolicy allocator = AllocationPolicy())
- : root_(NULL), allocator_(allocator) { }
+ explicit SplayTree(AllocationPolicy allocator = AllocationPolicy())
+ : root_(NULL), allocator_(allocator) {}
~SplayTree();
INLINE(void* operator new(size_t size,
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> {
public:
- explicit LDummy() { }
+ LDummy() {}
DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
};
class ThreadWithMutexAndConditionVariable V8_FINAL : public Thread {
public:
ThreadWithMutexAndConditionVariable()
- : Thread("ThreadWithMutexAndConditionVariable"),
- running_(false), finished_(false) {}
+ : Thread(Options("ThreadWithMutexAndConditionVariable")),
+ running_(false),
+ finished_(false) {}
virtual ~ThreadWithMutexAndConditionVariable() {}
virtual void Run() V8_OVERRIDE {
class ThreadWithSharedMutexAndConditionVariable V8_FINAL : public Thread {
public:
ThreadWithSharedMutexAndConditionVariable()
- : Thread("ThreadWithSharedMutexAndConditionVariable"),
- running_(false), finished_(false), cv_(NULL), mutex_(NULL) {}
+ : Thread(Options("ThreadWithSharedMutexAndConditionVariable")),
+ running_(false),
+ finished_(false),
+ cv_(NULL),
+ mutex_(NULL) {}
virtual ~ThreadWithSharedMutexAndConditionVariable() {}
virtual void Run() V8_OVERRIDE {
class LoopIncrementThread V8_FINAL : public Thread {
public:
- LoopIncrementThread(int rem,
- int* counter,
- int limit,
- int thread_count,
- ConditionVariable* cv,
- Mutex* mutex)
- : Thread("LoopIncrementThread"), rem_(rem), counter_(counter),
- limit_(limit), thread_count_(thread_count), cv_(cv), mutex_(mutex) {
+ LoopIncrementThread(int rem, int* counter, int limit, int thread_count,
+ ConditionVariable* cv, Mutex* mutex)
+ : Thread(Options("LoopIncrementThread")),
+ rem_(rem),
+ counter_(counter),
+ limit_(limit),
+ thread_count_(thread_count),
+ cv_(cv),
+ mutex_(mutex) {
EXPECT_LT(rem, thread_count);
EXPECT_EQ(0, limit % thread_count);
}
class SelfJoinThread V8_FINAL : public Thread {
public:
- SelfJoinThread() : Thread("SelfJoinThread") {}
+ SelfJoinThread() : Thread(Options("SelfJoinThread")) {}
virtual void Run() V8_OVERRIDE { Join(); }
};
class ThreadLocalStorageTest : public Thread, public ::testing::Test {
public:
- ThreadLocalStorageTest() : Thread("ThreadLocalStorageTest") {
+ ThreadLocalStorageTest() : Thread(Options("ThreadLocalStorageTest")) {
for (size_t i = 0; i < ARRAY_SIZE(keys_); ++i) {
keys_[i] = Thread::CreateThreadLocalKey();
}
private:
explicit ApiTestFuzzer(int num)
- : Thread("ApiTestFuzzer"),
+ : Thread(Options("ApiTestFuzzer")),
test_number_(num),
gate_(0),
- active_(true) {
- }
+ active_(true) {}
~ApiTestFuzzer() {}
static bool fuzzing_;
// A testing helper for the register code abstraction.
class InstructionTester : public HandleAndZoneScope {
public: // We're all friends here.
- explicit InstructionTester()
+ InstructionTester()
: isolate(main_isolate()),
graph(zone()),
schedule(zone()),
class TestResource: public String::ExternalStringResource {
public:
- TestResource(uint16_t* data, int* counter = NULL, bool owning_data = true)
+ explicit TestResource(uint16_t* data, int* counter = NULL,
+ bool owning_data = true)
: data_(data), length_(0), counter_(counter), owning_data_(owning_data) {
while (data[length_]) ++length_;
}
class TestAsciiResource: public String::ExternalAsciiStringResource {
public:
- TestAsciiResource(const char* data, int* counter = NULL, size_t offset = 0)
+ explicit TestAsciiResource(const char* data, int* counter = NULL,
+ size_t offset = 0)
: orig_data_(data),
data_(data + offset),
length_(strlen(data) - offset),
- counter_(counter) { }
+ counter_(counter) {}
~TestAsciiResource() {
i::DeleteArray(orig_data_);
class RegExpInterruptionThread : public v8::base::Thread {
public:
explicit RegExpInterruptionThread(v8::Isolate* isolate)
- : Thread("TimeoutThread"), isolate_(isolate) {}
+ : Thread(Options("TimeoutThread")), isolate_(isolate) {}
virtual void Run() {
for (regexp_interruption_data.loop_count = 0;
class IsolateThread : public v8::base::Thread {
public:
IsolateThread(v8::Isolate* isolate, int fib_limit)
- : Thread("IsolateThread"),
+ : Thread(Options("IsolateThread")),
isolate_(isolate),
fib_limit_(fib_limit),
- result_(0) { }
+ result_(0) {}
void Run() {
result_ = CalcFibonacci(isolate_, fib_limit_);
};
explicit InitDefaultIsolateThread(TestCase testCase)
- : Thread("InitDefaultIsolateThread"),
+ : Thread(Options("InitDefaultIsolateThread")),
testCase_(testCase),
- result_(false) { }
+ result_(false) {}
void Run() {
v8::Isolate* isolate = v8::Isolate::New();
class InterruptThread : public v8::base::Thread {
public:
explicit InterruptThread(ThreadInterruptTest* test)
- : Thread("InterruptThread"), test_(test) {}
+ : Thread(Options("InterruptThread")), test_(test) {}
virtual void Run() {
struct sigaction action;
class InterruptThread : public v8::base::Thread {
public:
explicit InterruptThread(RequestInterruptTestBase* test)
- : Thread("RequestInterruptTest"), test_(test) {}
+ : Thread(Options("RequestInterruptTest")), test_(test) {}
virtual void Run() {
test_->sem_.Wait();
class InterruptThread : public v8::base::Thread {
public:
explicit InterruptThread(ClearInterruptFromAnotherThread* test)
- : Thread("RequestInterruptTest"), test_(test) {}
+ : Thread(Options("RequestInterruptTest")), test_(test) {}
virtual void Run() {
test_->sem_.Wait();
class ProducerThread: public v8::base::Thread {
public:
- ProducerThread(TestSampleQueue* scq,
- int records_per_chunk,
- Record value,
+ ProducerThread(TestSampleQueue* scq, int records_per_chunk, Record value,
v8::base::Semaphore* finished)
- : Thread("producer"),
+ : Thread(Options("producer")),
scq_(scq),
records_per_chunk_(records_per_chunk),
value_(value),
- finished_(finished) { }
+ finished_(finished) {}
virtual void Run() {
for (Record i = value_; i < value_ + records_per_chunk_; ++i) {
class MessageQueueDebuggerThread : public v8::base::Thread {
public:
MessageQueueDebuggerThread()
- : Thread("MessageQueueDebuggerThread") { }
+ : Thread(Options("MessageQueueDebuggerThread")) {}
void Run();
};
class V8Thread : public v8::base::Thread {
public:
- V8Thread() : Thread("V8Thread") { }
+ V8Thread() : Thread(Options("V8Thread")) {}
void Run();
};
class DebuggerThread : public v8::base::Thread {
public:
- DebuggerThread() : Thread("DebuggerThread") { }
+ DebuggerThread() : Thread(Options("DebuggerThread")) {}
void Run();
};
class BreakpointsV8Thread : public v8::base::Thread {
public:
- BreakpointsV8Thread() : Thread("BreakpointsV8Thread") { }
+ BreakpointsV8Thread() : Thread(Options("BreakpointsV8Thread")) {}
void Run();
};
class BreakpointsDebuggerThread : public v8::base::Thread {
public:
explicit BreakpointsDebuggerThread(bool global_evaluate)
- : Thread("BreakpointsDebuggerThread"),
+ : Thread(Options("BreakpointsDebuggerThread")),
global_evaluate_(global_evaluate) {}
void Run();
class SendCommandThread : public v8::base::Thread {
public:
explicit SendCommandThread(v8::Isolate* isolate)
- : Thread("SendCommandThread"),
+ : Thread(Options("SendCommandThread")),
semaphore_(0),
- isolate_(isolate) { }
+ isolate_(isolate) {}
static void ProcessDebugMessages(v8::Isolate* isolate, void* data) {
v8::Debug::ProcessDebugMessages();
class TerminationThread : public v8::base::Thread {
public:
- explicit TerminationThread(v8::Isolate* isolate) : Thread("terminator"),
- isolate_(isolate) { }
+ explicit TerminationThread(v8::Isolate* isolate)
+ : Thread(Options("terminator")), isolate_(isolate) {}
virtual void Run() {
terminate_requested_semaphore.Wait();
class HandleArray : public Malloced {
public:
static const unsigned kArraySize = 200;
- explicit HandleArray() {}
+ HandleArray() {}
~HandleArray() { Reset(); }
void Reset() {
for (unsigned i = 0; i < kArraySize; i++) {
class TestWorkerThread : public v8::base::Thread {
public:
explicit TestWorkerThread(v8::Task* task)
- : Thread("libplatform TestWorkerThread"), semaphore_(0), task_(task) {}
+ : Thread(Options("libplatform TestWorkerThread")),
+ semaphore_(0),
+ task_(task) {}
virtual ~TestWorkerThread() {}
void Signal() { semaphore_.Signal(); }
class KangarooThread : public v8::base::Thread {
public:
KangarooThread(v8::Isolate* isolate, v8::Handle<v8::Context> context)
- : Thread("KangarooThread"),
+ : Thread(Options("KangarooThread")),
isolate_(isolate),
context_(isolate, context) {}
class ThreadWithSemaphore : public v8::base::Thread {
public:
explicit ThreadWithSemaphore(JoinableThread* joinable_thread)
- : Thread(joinable_thread->name_),
- joinable_thread_(joinable_thread) {
- }
+ : Thread(Options(joinable_thread->name_)),
+ joinable_thread_(joinable_thread) {}
virtual void Run() {
joinable_thread_->Run();
class IsolateNonlockingThread : public JoinableThread {
public:
- explicit IsolateNonlockingThread()
- : JoinableThread("IsolateNonlockingThread") {
- }
+ IsolateNonlockingThread() : JoinableThread("IsolateNonlockingThread") {}
virtual void Run() {
v8::Isolate* isolate = v8::Isolate::New();
class WaitAndSignalThread V8_FINAL : public v8::base::Thread {
public:
explicit WaitAndSignalThread(v8::base::Semaphore* semaphore)
- : Thread("WaitAndSignalThread"), semaphore_(semaphore) {}
+ : Thread(Options("WaitAndSignalThread")), semaphore_(semaphore) {}
virtual ~WaitAndSignalThread() {}
virtual void Run() V8_OVERRIDE {
class ProducerThread V8_FINAL : public v8::base::Thread {
public:
- ProducerThread() : Thread("ProducerThread") {}
+ ProducerThread() : Thread(Options("ProducerThread")) {}
virtual ~ProducerThread() {}
virtual void Run() V8_OVERRIDE {
class ConsumerThread V8_FINAL : public v8::base::Thread {
public:
- ConsumerThread() : Thread("ConsumerThread") {}
+ ConsumerThread() : Thread(Options("ConsumerThread")) {}
virtual ~ConsumerThread() {}
virtual void Run() V8_OVERRIDE {
class TerminatorThread : public v8::base::Thread {
public:
explicit TerminatorThread(i::Isolate* isolate)
- : Thread("TerminatorThread"),
- isolate_(reinterpret_cast<v8::Isolate*>(isolate)) { }
+ : Thread(Options("TerminatorThread")),
+ isolate_(reinterpret_cast<v8::Isolate*>(isolate)) {}
void Run() {
semaphore->Wait();
CHECK(!v8::V8::IsExecutionTerminating(isolate_));
class ThreadA : public v8::base::Thread {
public:
- ThreadA() : Thread("ThreadA") { }
+ ThreadA() : Thread(Options("ThreadA")) {}
void Run() {
v8::Isolate* isolate = CcTest::isolate();
v8::Locker locker(isolate);
class ThreadB : public v8::base::Thread {
public:
- ThreadB() : Thread("ThreadB") { }
+ ThreadB() : Thread(Options("ThreadB")) {}
void Run() {
do {
{
class ThreadIdValidationThread : public v8::base::Thread {
public:
ThreadIdValidationThread(v8::base::Thread* thread_to_start,
- i::List<i::ThreadId>* refs,
- unsigned int thread_no,
+ i::List<i::ThreadId>* refs, unsigned int thread_no,
v8::base::Semaphore* semaphore)
- : Thread("ThreadRefValidationThread"),
- refs_(refs), thread_no_(thread_no), thread_to_start_(thread_to_start),
- semaphore_(semaphore) {
- }
+ : Thread(Options("ThreadRefValidationThread")),
+ refs_(refs),
+ thread_no_(thread_no),
+ thread_to_start_(thread_to_start),
+ semaphore_(semaphore) {}
void Run() {
i::ThreadId thread_id = i::ThreadId::Current();