Commit 4e686686 authored by jgruber's avatar jgruber Committed by Commit Bot

[builtins] More granular assembler options

Now that we pass in assembler options during builtin setup, we can be
more precise in assembler configuration.

Isolate-independent generation is only requested for isolate-independent
builtins. And pc-relative jumps additionally need a valid code range.

Bug: v8:6666
Change-Id: I64dfb414549a2f1e87610244c48d9405e63a1b12
Reviewed-on: https://chromium-review.googlesource.com/1177707Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55187}
parent a1e2dcaf
...@@ -62,7 +62,6 @@ AssemblerOptions AssemblerOptions::Default( ...@@ -62,7 +62,6 @@ AssemblerOptions AssemblerOptions::Default(
// might be run on real hardware. // might be run on real hardware.
options.enable_simulator_code = !serializer; options.enable_simulator_code = !serializer;
#endif #endif
options.isolate_independent_code = isolate->ShouldLoadConstantsFromRootList();
options.inline_offheap_trampolines = !serializer; options.inline_offheap_trampolines = !serializer;
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64
options.code_range_start = options.code_range_start =
......
...@@ -38,13 +38,22 @@ void PostBuildProfileAndTracing(Isolate* isolate, Code* code, ...@@ -38,13 +38,22 @@ void PostBuildProfileAndTracing(Isolate* isolate, Code* code,
AssemblerOptions BuiltinAssemblerOptions(Isolate* isolate, AssemblerOptions BuiltinAssemblerOptions(Isolate* isolate,
int32_t builtin_index) { int32_t builtin_index) {
AssemblerOptions options = AssemblerOptions::Default(isolate); AssemblerOptions options = AssemblerOptions::Default(isolate);
if (isolate->ShouldLoadConstantsFromRootList() && CHECK(!options.isolate_independent_code);
Builtins::IsIsolateIndependent(builtin_index) && CHECK(!options.use_pc_relative_calls_and_jumps);
isolate->heap()->memory_allocator()->code_range()->valid() &&
isolate->heap()->memory_allocator()->code_range()->size() <= if (!isolate->ShouldLoadConstantsFromRootList() ||
kMaxPCRelativeCodeRangeInMB * MB) { !Builtins::IsIsolateIndependent(builtin_index)) {
options.use_pc_relative_calls_and_jumps = true; return options;
} }
CodeRange* code_range = isolate->heap()->memory_allocator()->code_range();
bool pc_relative_calls_fit_in_code_range =
code_range->valid() &&
code_range->size() <= kMaxPCRelativeCodeRangeInMB * MB;
options.isolate_independent_code = true;
options.use_pc_relative_calls_and_jumps = pc_relative_calls_fit_in_code_range;
return options; return options;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment