Commit 7b2b708f authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove obsolete {Code::has_tagged_params} field.

Now that all WebAssembly code (including its lazy compile stub) has been
moved off the garbage-collected heap, we can determine the taggedness of
parameters purely from the {Code::Kind} and no longer need a dedicated
flag for it.

R=clemensh@chromium.org
BUG=v8:6792

Change-Id: If40b6763d042c19b937391fac8301a03b8ccc891
Reviewed-on: https://chromium-review.googlesource.com/999416Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52433}
parent 146e3c18
...@@ -1319,8 +1319,6 @@ namespace internal { ...@@ -1319,8 +1319,6 @@ namespace internal {
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \ BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \
IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
#define BUILTINS_WITH_UNTAGGED_PARAMS(V) V(WasmCompileLazy)
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -285,17 +285,6 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) { ...@@ -285,17 +285,6 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) {
BUILTIN_EXCEPTION_CAUGHT_PREDICTION_LIST(SET_EXCEPTION_CAUGHT_PREDICTION) BUILTIN_EXCEPTION_CAUGHT_PREDICTION_LIST(SET_EXCEPTION_CAUGHT_PREDICTION)
#undef SET_EXCEPTION_CAUGHT_PREDICTION #undef SET_EXCEPTION_CAUGHT_PREDICTION
// TODO(mstarzinger,6792): This code-space modification section should be
// moved into {Heap} eventually and a safe wrapper be provided.
CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
#define SET_CODE_NON_TAGGED_PARAMS(Name) \
Code::cast(builtins->builtins_[Builtins::k##Name]) \
->set_has_tagged_params(false);
BUILTINS_WITH_UNTAGGED_PARAMS(SET_CODE_NON_TAGGED_PARAMS)
#undef SET_CODE_NON_TAGGED_PARAMS
builtins->MarkInitialized(); builtins->MarkInitialized();
} }
......
...@@ -1873,7 +1873,6 @@ Handle<Code> Factory::NewOffHeapTrampolineFor(Handle<Code> code, ...@@ -1873,7 +1873,6 @@ Handle<Code> Factory::NewOffHeapTrampolineFor(Handle<Code> code,
result->initialize_flags(code->kind(), code->has_unwinding_info(), result->initialize_flags(code->kind(), code->has_unwinding_info(),
code->is_turbofanned(), stack_slots); code->is_turbofanned(), stack_slots);
result->set_builtin_index(code->builtin_index()); result->set_builtin_index(code->builtin_index());
result->set_has_tagged_params(code->has_tagged_params());
result->set_handler_table_offset(code->handler_table_offset()); result->set_handler_table_offset(code->handler_table_offset());
result->code_data_container()->set_kind_specific_flags( result->code_data_container()->set_kind_specific_flags(
code->code_data_container()->kind_specific_flags()); code->code_data_container()->kind_specific_flags());
......
...@@ -3348,26 +3348,12 @@ AllocationResult Heap::AllocateCode( ...@@ -3348,26 +3348,12 @@ AllocationResult Heap::AllocateCode(
code->set_safepoint_table_offset(safepoint_table_offset); code->set_safepoint_table_offset(safepoint_table_offset);
code->set_handler_table_offset(handler_table_offset); code->set_handler_table_offset(handler_table_offset);
code->set_code_data_container(data_container); code->set_code_data_container(data_container);
code->set_has_tagged_params(true);
code->set_deoptimization_data(deopt_data); code->set_deoptimization_data(deopt_data);
code->set_stub_key(stub_key); code->set_stub_key(stub_key);
code->set_source_position_table(source_position_table); code->set_source_position_table(source_position_table);
code->set_constant_pool_offset(desc.instr_size - desc.constant_pool_size); code->set_constant_pool_offset(desc.instr_size - desc.constant_pool_size);
code->set_builtin_index(builtin_index); code->set_builtin_index(builtin_index);
switch (code->kind()) {
case Code::OPTIMIZED_FUNCTION:
code->set_marked_for_deoptimization(false);
break;
case Code::JS_TO_WASM_FUNCTION:
case Code::C_WASM_ENTRY:
case Code::WASM_FUNCTION:
code->set_has_tagged_params(false);
break;
default:
break;
}
// Allow self references to created code object by patching the handle to // Allow self references to created code object by patching the handle to
// point to the newly allocated Code object. // point to the newly allocated Code object.
if (!self_ref.is_null()) *(self_ref.location()) = code; if (!self_ref.is_null()) *(self_ref.location()) = code;
......
...@@ -359,19 +359,13 @@ inline bool Code::checks_optimization_marker() const { ...@@ -359,19 +359,13 @@ inline bool Code::checks_optimization_marker() const {
(kind() == OPTIMIZED_FUNCTION && marked_for_deoptimization()); (kind() == OPTIMIZED_FUNCTION && marked_for_deoptimization());
} }
inline bool Code::has_unwinding_info() const {
return HasUnwindingInfoField::decode(READ_UINT32_FIELD(this, kFlagsOffset));
}
inline bool Code::has_tagged_params() const { inline bool Code::has_tagged_params() const {
int flags = READ_UINT32_FIELD(this, kFlagsOffset); return kind() != JS_TO_WASM_FUNCTION && kind() != C_WASM_ENTRY &&
return HasTaggedStackField::decode(flags); kind() != WASM_FUNCTION;
} }
inline void Code::set_has_tagged_params(bool value) { inline bool Code::has_unwinding_info() const {
int previous = READ_UINT32_FIELD(this, kFlagsOffset); return HasUnwindingInfoField::decode(READ_UINT32_FIELD(this, kFlagsOffset));
int updated = HasTaggedStackField::update(previous, value);
WRITE_UINT32_FIELD(this, kFlagsOffset, updated);
} }
inline bool Code::is_turbofanned() const { inline bool Code::is_turbofanned() const {
......
...@@ -116,10 +116,8 @@ class Code : public HeapObject { ...@@ -116,10 +116,8 @@ class Code : public HeapObject {
// feedback vector. // feedback vector.
inline bool checks_optimization_marker() const; inline bool checks_optimization_marker() const;
// [has_tagged_params]: For compiled code or builtins: Tells whether the // Tells whether the outgoing parameters of this code are tagged pointers.
// outgoing parameters of this code are tagged pointers. True for other kinds.
inline bool has_tagged_params() const; inline bool has_tagged_params() const;
inline void set_has_tagged_params(bool value);
// [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the // [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the
// code object was generated by the TurboFan optimizing compiler. // code object was generated by the TurboFan optimizing compiler.
...@@ -403,7 +401,6 @@ class Code : public HeapObject { ...@@ -403,7 +401,6 @@ class Code : public HeapObject {
#define CODE_FLAGS_BIT_FIELDS(V, _) \ #define CODE_FLAGS_BIT_FIELDS(V, _) \
V(HasUnwindingInfoField, bool, 1, _) \ V(HasUnwindingInfoField, bool, 1, _) \
V(KindField, Kind, 5, _) \ V(KindField, Kind, 5, _) \
V(HasTaggedStackField, bool, 1, _) \
V(IsTurbofannedField, bool, 1, _) \ V(IsTurbofannedField, bool, 1, _) \
V(StackSlotsField, int, 24, _) V(StackSlotsField, int, 24, _)
DEFINE_BIT_FIELDS(CODE_FLAGS_BIT_FIELDS) DEFINE_BIT_FIELDS(CODE_FLAGS_BIT_FIELDS)
......
...@@ -1361,14 +1361,11 @@ MaybeHandle<WasmModuleObject> CompileToModuleObjectInternal( ...@@ -1361,14 +1361,11 @@ MaybeHandle<WasmModuleObject> CompileToModuleObjectInternal(
script, asm_js_offset_table); script, asm_js_offset_table);
if (lazy_compile) WasmSharedModuleData::PrepareForLazyCompilation(shared); if (lazy_compile) WasmSharedModuleData::PrepareForLazyCompilation(shared);
Handle<Code> init_builtin = lazy_compile
? BUILTIN_CODE(isolate, WasmCompileLazy)
: BUILTIN_CODE(isolate, Illegal);
int export_wrappers_size = int export_wrappers_size =
static_cast<int>(wasm_module->num_exported_functions); static_cast<int>(wasm_module->num_exported_functions);
Handle<FixedArray> export_wrappers = Handle<FixedArray> export_wrappers =
factory->NewFixedArray(static_cast<int>(export_wrappers_size), TENURED); factory->NewFixedArray(static_cast<int>(export_wrappers_size), TENURED);
Handle<Code> init_builtin = BUILTIN_CODE(isolate, Illegal);
for (int i = 0, e = export_wrappers->length(); i < e; ++i) { for (int i = 0, e = export_wrappers->length(); i < e; ++i) {
export_wrappers->set(i, *init_builtin); export_wrappers->set(i, *init_builtin);
} }
......
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