Skip to content

Commit 1642bfd

Browse files
authored
Merge pull request nodejs#14 from hashseed/update_v8
Update V8 to 4c9ba86294
2 parents f4ec76a + 8918f14 commit 1642bfd

141 files changed

Lines changed: 1648 additions & 3145 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/v8/BUILD.gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ config("features") {
258258
if (v8_enable_handle_zapping) {
259259
defines += [ "ENABLE_HANDLE_ZAPPING" ]
260260
}
261+
if (v8_use_snapshot) {
262+
defines += [ "V8_USE_SNAPSHOT" ]
263+
}
261264
if (v8_use_external_startup_data) {
262265
defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ]
263266
}

deps/v8/include/v8.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6342,8 +6342,9 @@ class V8_EXPORT Isolate {
63426342
* The optional entry_hook allows the host application to provide the
63436343
* address of a function that's invoked on entry to every V8-generated
63446344
* function. Note that entry_hook is invoked at the very start of each
6345-
* generated function. Furthermore, if an entry_hook is given, V8 will
6346-
* not use a snapshot, including custom snapshots.
6345+
* generated function.
6346+
* An entry_hook can only be provided in no-snapshot builds; in snapshot
6347+
* builds it must be nullptr.
63476348
*/
63486349
FunctionEntryHook entry_hook;
63496350

deps/v8/src/api.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8143,6 +8143,12 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
81438143
isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob());
81448144
}
81458145
if (params.entry_hook) {
8146+
#ifdef V8_USE_SNAPSHOT
8147+
// Setting a FunctionEntryHook is only supported in no-snapshot builds.
8148+
Utils::ApiCheck(
8149+
false, "v8::Isolate::New",
8150+
"Setting a FunctionEntryHook is only supported in no-snapshot builds.");
8151+
#endif
81468152
isolate->set_function_entry_hook(params.entry_hook);
81478153
}
81488154
auto code_event_handler = params.code_event_handler;

deps/v8/src/arm/macro-assembler-arm.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,20 +2422,6 @@ void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
24222422
JumpIfSmi(value, miss);
24232423
}
24242424

2425-
2426-
void MacroAssembler::GetMapConstructor(Register result, Register map,
2427-
Register temp, Register temp2) {
2428-
Label done, loop;
2429-
ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset));
2430-
bind(&loop);
2431-
JumpIfSmi(result, &done);
2432-
CompareObjectType(result, temp, temp2, MAP_TYPE);
2433-
b(ne, &done);
2434-
ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset));
2435-
b(&loop);
2436-
bind(&done);
2437-
}
2438-
24392425
void MacroAssembler::CallStub(CodeStub* stub,
24402426
TypeFeedbackId ast_id,
24412427
Condition cond) {

deps/v8/src/arm/macro-assembler-arm.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,6 @@ class MacroAssembler: public Assembler {
824824
// ---------------------------------------------------------------------------
825825
// Support functions.
826826

827-
// Machine code version of Map::GetConstructor().
828-
// |temp| holds |result|'s map when done, and |temp2| its instance type.
829-
void GetMapConstructor(Register result, Register map, Register temp,
830-
Register temp2);
831-
832827
// Compare object type for heap object. heap_object contains a non-Smi
833828
// whose object type should be compared with the given type. This both
834829
// sets the flags and leaves the object type in the type_reg register.

deps/v8/src/arm64/macro-assembler-arm64.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,19 +3385,6 @@ void MacroAssembler::LoadElementsKindFromMap(Register result, Register map) {
33853385
}
33863386

33873387

3388-
void MacroAssembler::GetMapConstructor(Register result, Register map,
3389-
Register temp, Register temp2) {
3390-
Label done, loop;
3391-
Ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset));
3392-
Bind(&loop);
3393-
JumpIfSmi(result, &done);
3394-
CompareObjectType(result, temp, temp2, MAP_TYPE);
3395-
B(ne, &done);
3396-
Ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset));
3397-
B(&loop);
3398-
Bind(&done);
3399-
}
3400-
34013388
void MacroAssembler::PushRoot(Heap::RootListIndex index) {
34023389
UseScratchRegisterScope temps(this);
34033390
Register temp = temps.AcquireX();

deps/v8/src/arm64/macro-assembler-arm64.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,11 +1363,6 @@ class MacroAssembler : public Assembler {
13631363
// ---------------------------------------------------------------------------
13641364
// Support functions.
13651365

1366-
// Machine code version of Map::GetConstructor().
1367-
// |temp| holds |result|'s map when done, and |temp2| its instance type.
1368-
void GetMapConstructor(Register result, Register map, Register temp,
1369-
Register temp2);
1370-
13711366
// Compare object type for heap object. heap_object contains a non-Smi
13721367
// whose object type should be compared with the given type. This both
13731368
// sets the flags and leaves the object type in the type_reg register.

deps/v8/src/ast/ast-types.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ AstType::bitset AstBitsetType::Lub(i::Map* map) {
186186
if (map == heap->boolean_map()) return kBoolean;
187187
if (map == heap->the_hole_map()) return kHole;
188188
DCHECK(map == heap->uninitialized_map() ||
189-
map == heap->no_interceptor_result_sentinel_map() ||
190189
map == heap->termination_exception_map() ||
191190
map == heap->arguments_marker_map() ||
192191
map == heap->optimized_out_map() ||

deps/v8/src/compiler.cc

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,16 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
759759
CompilationInfo* info = job->info();
760760
Isolate* isolate = info->isolate();
761761

762+
if (FLAG_mark_optimizing_shared_functions &&
763+
info->closure()->shared()->has_concurrent_optimization_job()) {
764+
if (FLAG_trace_concurrent_recompilation) {
765+
PrintF(" ** Compilation job already running for ");
766+
info->shared_info()->ShortPrint();
767+
PrintF(".\n");
768+
}
769+
return false;
770+
}
771+
762772
if (!isolate->optimizing_compile_dispatcher()->IsQueueAvailable()) {
763773
if (FLAG_trace_concurrent_recompilation) {
764774
PrintF(" ** Compilation queue full, will retry optimizing ");
@@ -793,6 +803,7 @@ bool GetOptimizedCodeLater(CompilationJob* job) {
793803

794804
if (job->PrepareJob() != CompilationJob::SUCCEEDED) return false;
795805
isolate->optimizing_compile_dispatcher()->QueueForOptimization(job);
806+
info->closure()->shared()->set_has_concurrent_optimization_job(true);
796807

797808
if (FLAG_trace_concurrent_recompilation) {
798809
PrintF(" ** Queued ");
@@ -813,9 +824,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
813824
DCHECK_IMPLIES(ignition_osr, !osr_ast_id.IsNone());
814825
DCHECK_IMPLIES(ignition_osr, FLAG_ignition_osr);
815826

816-
// Shared function no longer needs to be tiered up
817-
shared->set_marked_for_tier_up(false);
818-
819827
Handle<Code> cached_code;
820828
// TODO(4764): When compiling for OSR from bytecode, BailoutId might derive
821829
// from bytecode offset and overlap with actual BailoutId. No lookup!
@@ -928,6 +936,13 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
928936
return MaybeHandle<Code>();
929937
}
930938

939+
MaybeHandle<Code> GetOptimizedCodeMaybeLater(Handle<JSFunction> function) {
940+
Isolate* isolate = function->GetIsolate();
941+
return GetOptimizedCode(function, isolate->concurrent_recompilation_enabled()
942+
? Compiler::CONCURRENT
943+
: Compiler::NOT_CONCURRENT);
944+
}
945+
931946
CompilationJob::Status FinalizeOptimizedCompilationJob(CompilationJob* job) {
932947
CompilationInfo* info = job->info();
933948
Isolate* isolate = info->isolate();
@@ -947,6 +962,11 @@ CompilationJob::Status FinalizeOptimizedCompilationJob(CompilationJob* job) {
947962
shared->set_profiler_ticks(0);
948963
}
949964

965+
shared->set_has_concurrent_optimization_job(false);
966+
967+
// Shared function no longer needs to be tiered up.
968+
shared->set_marked_for_tier_up(false);
969+
950970
DCHECK(!shared->HasDebugInfo());
951971

952972
// 1) Optimization on the concurrent thread may have failed.
@@ -1094,9 +1114,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
10941114
}
10951115

10961116
Handle<Code> code;
1097-
// TODO(leszeks): Look into performing this compilation concurrently.
1098-
if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT)
1099-
.ToHandle(&code)) {
1117+
if (GetOptimizedCodeMaybeLater(function).ToHandle(&code)) {
11001118
return code;
11011119
}
11021120
break;

deps/v8/src/compiler/OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mstarzinger@chromium.org
77
mtrofin@chromium.org
88
titzer@chromium.org
99
danno@chromium.org
10+
tebbi@chromium.org
1011

1112
per-file wasm-*=ahaas@chromium.org
1213
per-file wasm-*=clemensh@chromium.org

0 commit comments

Comments
 (0)