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

Commit 4d8c179

Browse files
committed
Update V8 5.4.9
1 parent 8b5982f commit 4d8c179

7 files changed

Lines changed: 168 additions & 79 deletions

File tree

deps/SConscript

Lines changed: 111 additions & 74 deletions
Large diffs are not rendered by default.

deps/v8/src/base/platform/platform-runtimejs.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ bool OS::isDirectorySeparator(const char ch) {
131131
}
132132

133133

134+
char OS::DirectorySeparator() { return '/'; }
135+
136+
134137
FILE* OS::OpenTemporaryFile() {
135138
RT_ASSERT(!"tmptile()");
136139
return nullptr;
@@ -411,6 +414,16 @@ bool VirtualMemory::UncommitRegion(void* base, size_t size) {
411414
}
412415

413416

417+
bool VirtualMemory::ReleasePartialRegion(void* base, size_t size,
418+
void* free_start, size_t free_size) {
419+
RT_ASSERT(reinterpret_cast<size_t>(base) + size == reinterpret_cast<size_t>(free_start) + free_size);
420+
void* new_base = realloc(base, size - free_size);
421+
RT_ASSERT(base == new_base); // ensure we're using the same memory
422+
printf("[V8] Partial realloc\n");
423+
return true;
424+
}
425+
426+
414427
bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
415428
free(base);
416429
return true;

deps/v8/src/base/platform/time.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ struct timeval Time::ToTimeval() const {
405405

406406
#elif V8_OS_RUNTIMEJS
407407

408+
V8_INLINE int64_t ClockNow(clockid_t clk_id) {
409+
RT_ASSERT(GLOBAL_platform());
410+
return GLOBAL_platform()->BootTimeMicroseconds();
411+
}
412+
408413
Time Time::Now() {
409414
// Uncomment for snapshot generation
410415
// return Time(1);

deps/v8/src/snapshot/mksnapshot.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "src/flags.h"
1313
#include "src/list.h"
1414
#include "src/snapshot/natives.h"
15-
#include "src/snapshot/serialize.h"
1615
#include "src/snapshot/partial-serializer.h"
1716
#include "src/snapshot/startup-serializer.h"
1817

src/kernel/engines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ class Engines {
6969

7070
v8::V8::SetEntropySource(EntropySource);
7171

72-
v8::V8::InitializePlatform(v8_platform_);
73-
v8::V8::Initialize();
74-
7572
#if 0
76-
const char flags[] = "--trace-deopt --redirect_code_traces_to=deopt";
73+
const char flags[] = "--expose-wasm";
7774
v8::V8::SetFlagsFromString(flags, sizeof(flags));
7875
#endif
76+
77+
v8::V8::InitializePlatform(v8_platform_);
78+
v8::V8::Initialize();
7979
}
8080

8181
void Startup() {

src/kernel/threadlib/semaphore.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ namespace threadlib {
2929
}
3030

3131
bool timed_wait(uint64_t max_time_microseconds) {
32+
// Special case for 0ms wait time, return the result immediately
33+
// so we can avoid unexpected sched() call
34+
if (max_time_microseconds == 0) {
35+
return try_wait();
36+
}
37+
3238
uint64_t end_time = get_time_microseconds() + max_time_microseconds;
3339
while (!try_wait()) {
3440
if (get_time_microseconds() > end_time) {

src/kernel/v8sampler.cc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "src/libsampler/v8-sampler.h"
2+
#include <kernel/kernel.h>
3+
4+
namespace v8 {
5+
namespace sampler {
6+
7+
Sampler::Sampler(Isolate* isolate)
8+
: is_counting_samples_(false),
9+
js_sample_count_(0),
10+
external_sample_count_(0),
11+
isolate_(isolate),
12+
profiling_(false),
13+
has_processing_thread_(false),
14+
active_(false),
15+
registered_(false) {}
16+
17+
Sampler::~Sampler() {}
18+
19+
void Sampler::Start() { RT_ASSERT(!"not implemented"); }
20+
void Sampler::Stop() { RT_ASSERT(!"not implemented"); }
21+
void Sampler::IncreaseProfilingDepth() { RT_ASSERT(!"not implemented"); }
22+
void Sampler::DecreaseProfilingDepth() { RT_ASSERT(!"not implemented"); }
23+
void Sampler::DoSample() { RT_ASSERT(!"not implemented"); }
24+
25+
void Sampler::SetUp() {}
26+
void Sampler::TearDown() {}
27+
28+
} // namespace sampler
29+
} // namespace v8

0 commit comments

Comments
 (0)