Commit 4a0f3c6f authored by Jakob Gruber's avatar Jakob Gruber Committed by V8 LUCI CQ

[nci] Remove the last remnants of NCI code

Bug: v8:8888
Change-Id: I3ecbf73df482865d838a0b98b6acd45de7e186f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3085270
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76225}
parent d9ad9e31
This diff is collapsed.
...@@ -796,12 +796,6 @@ void CompilationDependencies::DependOnOwnConstantDictionaryProperty( ...@@ -796,12 +796,6 @@ void CompilationDependencies::DependOnOwnConstantDictionaryProperty(
} }
bool CompilationDependencies::Commit(Handle<Code> code) { bool CompilationDependencies::Commit(Handle<Code> code) {
// Dependencies are context-dependent. In the future it may be possible to
// restore them in the consumer native context, but for now they are
// disabled.
CHECK_IMPLIES(broker_->is_native_context_independent(),
dependencies_.empty());
for (auto dep : dependencies_) { for (auto dep : dependencies_) {
if (!dep->IsValid()) { if (!dep->IsValid()) {
dependencies_.clear(); dependencies_.clear();
......
...@@ -4055,10 +4055,6 @@ JSCallReducer::ReduceCallOrConstructWithArrayLikeOrSpreadOfCreateArguments( ...@@ -4055,10 +4055,6 @@ JSCallReducer::ReduceCallOrConstructWithArrayLikeOrSpreadOfCreateArguments(
} }
} }
// TODO(jgruber,v8:8888): Attempt to remove this restriction. The reason it
// currently exists is because we cannot create code dependencies in NCI code.
if (broker()->is_native_context_independent()) return NoChange();
// For call/construct with spread, we need to also install a code // For call/construct with spread, we need to also install a code
// dependency on the array iterator lookup protector cell to ensure // dependency on the array iterator lookup protector cell to ensure
// that no one messed with the %ArrayIteratorPrototype%.next method. // that no one messed with the %ArrayIteratorPrototype%.next method.
...@@ -6599,10 +6595,6 @@ Reduction JSCallReducer::ReduceStringFromCodePoint(Node* node) { ...@@ -6599,10 +6595,6 @@ Reduction JSCallReducer::ReduceStringFromCodePoint(Node* node) {
} }
Reduction JSCallReducer::ReduceStringPrototypeIterator(Node* node) { Reduction JSCallReducer::ReduceStringPrototypeIterator(Node* node) {
// TODO(jgruber): We could reduce here when generating native context
// independent code, if LowerJSCreateStringIterator were implemented in
// generic lowering.
if (broker()->is_native_context_independent()) return NoChange();
JSCallNode n(node); JSCallNode n(node);
CallParameters const& p = n.Parameters(); CallParameters const& p = n.Parameters();
if (p.speculation_mode() == SpeculationMode::kDisallowSpeculation) { if (p.speculation_mode() == SpeculationMode::kDisallowSpeculation) {
...@@ -6727,11 +6719,6 @@ Reduction JSCallReducer::ReduceStringPrototypeConcat(Node* node) { ...@@ -6727,11 +6719,6 @@ Reduction JSCallReducer::ReduceStringPrototypeConcat(Node* node) {
} }
Reduction JSCallReducer::ReducePromiseConstructor(Node* node) { Reduction JSCallReducer::ReducePromiseConstructor(Node* node) {
// TODO(jgruber): We could reduce here when generating native context
// independent code, if LowerJSCreatePromise were implemented in generic
// lowering.
if (broker()->is_native_context_independent()) return NoChange();
PromiseBuiltinReducerAssembler a(this, node, broker()); PromiseBuiltinReducerAssembler a(this, node, broker());
// We only inline when we have the executor. // We only inline when we have the executor.
......
This diff is collapsed.
...@@ -537,12 +537,6 @@ bool HasMigrationTargets(const ZoneVector<MapRef>& maps) { ...@@ -537,12 +537,6 @@ bool HasMigrationTargets(const ZoneVector<MapRef>& maps) {
} // namespace } // namespace
bool JSHeapBroker::CanUseFeedback(const FeedbackNexus& nexus) const {
// TODO(jgruber,v8:8888): Currently, nci code does not use any
// feedback. This restriction will be relaxed in the future.
return !is_native_context_independent() && !nexus.IsUninitialized();
}
const ProcessedFeedback& JSHeapBroker::NewInsufficientFeedback( const ProcessedFeedback& JSHeapBroker::NewInsufficientFeedback(
FeedbackSlotKind kind) const { FeedbackSlotKind kind) const {
return *zone()->New<InsufficientFeedback>(kind); return *zone()->New<InsufficientFeedback>(kind);
...@@ -553,7 +547,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForPropertyAccess( ...@@ -553,7 +547,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForPropertyAccess(
base::Optional<NameRef> static_name) { base::Optional<NameRef> static_name) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
FeedbackSlotKind kind = nexus.kind(); FeedbackSlotKind kind = nexus.kind();
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(kind); if (nexus.IsUninitialized()) return NewInsufficientFeedback(kind);
ZoneVector<MapRefAndHandler> maps_and_handlers(zone()); ZoneVector<MapRefAndHandler> maps_and_handlers(zone());
ZoneVector<MapRef> maps(zone()); ZoneVector<MapRef> maps(zone());
...@@ -622,7 +616,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess( ...@@ -622,7 +616,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
nexus.kind() == FeedbackSlotKind::kLoadGlobalNotInsideTypeof || nexus.kind() == FeedbackSlotKind::kLoadGlobalNotInsideTypeof ||
nexus.kind() == FeedbackSlotKind::kStoreGlobalSloppy || nexus.kind() == FeedbackSlotKind::kStoreGlobalSloppy ||
nexus.kind() == FeedbackSlotKind::kStoreGlobalStrict); nexus.kind() == FeedbackSlotKind::kStoreGlobalStrict);
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
if (nexus.ic_state() != MONOMORPHIC || nexus.GetFeedback()->IsCleared()) { if (nexus.ic_state() != MONOMORPHIC || nexus.GetFeedback()->IsCleared()) {
return *zone()->New<GlobalAccessFeedback>(nexus.kind()); return *zone()->New<GlobalAccessFeedback>(nexus.kind());
} }
...@@ -662,7 +656,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess( ...@@ -662,7 +656,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForBinaryOperation( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForBinaryOperation(
FeedbackSource const& source) const { FeedbackSource const& source) const {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
BinaryOperationHint hint = nexus.GetBinaryOperationFeedback(); BinaryOperationHint hint = nexus.GetBinaryOperationFeedback();
DCHECK_NE(hint, BinaryOperationHint::kNone); // Not uninitialized. DCHECK_NE(hint, BinaryOperationHint::kNone); // Not uninitialized.
return *zone()->New<BinaryOperationFeedback>(hint, nexus.kind()); return *zone()->New<BinaryOperationFeedback>(hint, nexus.kind());
...@@ -671,7 +665,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForBinaryOperation( ...@@ -671,7 +665,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForBinaryOperation(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCompareOperation( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCompareOperation(
FeedbackSource const& source) const { FeedbackSource const& source) const {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
CompareOperationHint hint = nexus.GetCompareOperationFeedback(); CompareOperationHint hint = nexus.GetCompareOperationFeedback();
DCHECK_NE(hint, CompareOperationHint::kNone); // Not uninitialized. DCHECK_NE(hint, CompareOperationHint::kNone); // Not uninitialized.
return *zone()->New<CompareOperationFeedback>(hint, nexus.kind()); return *zone()->New<CompareOperationFeedback>(hint, nexus.kind());
...@@ -680,7 +674,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCompareOperation( ...@@ -680,7 +674,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCompareOperation(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForForIn( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForForIn(
FeedbackSource const& source) const { FeedbackSource const& source) const {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
ForInHint hint = nexus.GetForInFeedback(); ForInHint hint = nexus.GetForInFeedback();
DCHECK_NE(hint, ForInHint::kNone); // Not uninitialized. DCHECK_NE(hint, ForInHint::kNone); // Not uninitialized.
return *zone()->New<ForInFeedback>(hint, nexus.kind()); return *zone()->New<ForInFeedback>(hint, nexus.kind());
...@@ -689,7 +683,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForForIn( ...@@ -689,7 +683,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForForIn(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf(
FeedbackSource const& source) { FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
base::Optional<JSObjectRef> optional_constructor; base::Optional<JSObjectRef> optional_constructor;
{ {
...@@ -705,7 +699,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf( ...@@ -705,7 +699,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForInstanceOf(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForArrayOrObjectLiteral( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForArrayOrObjectLiteral(
FeedbackSource const& source) { FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
HeapObject object; HeapObject object;
if (!nexus.GetFeedback()->GetHeapObject(&object)) { if (!nexus.GetFeedback()->GetHeapObject(&object)) {
...@@ -723,7 +717,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForArrayOrObjectLiteral( ...@@ -723,7 +717,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForArrayOrObjectLiteral(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForRegExpLiteral( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForRegExpLiteral(
FeedbackSource const& source) { FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
HeapObject object; HeapObject object;
if (!nexus.GetFeedback()->GetHeapObject(&object)) { if (!nexus.GetFeedback()->GetHeapObject(&object)) {
...@@ -741,7 +735,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForRegExpLiteral( ...@@ -741,7 +735,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForRegExpLiteral(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForTemplateObject( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForTemplateObject(
FeedbackSource const& source) { FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
HeapObject object; HeapObject object;
if (!nexus.GetFeedback()->GetHeapObject(&object)) { if (!nexus.GetFeedback()->GetHeapObject(&object)) {
...@@ -755,7 +749,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForTemplateObject( ...@@ -755,7 +749,7 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForTemplateObject(
ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall( ProcessedFeedback const& JSHeapBroker::ReadFeedbackForCall(
FeedbackSource const& source) { FeedbackSource const& source) {
FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config()); FeedbackNexus nexus(source.vector, source.slot, feedback_nexus_config());
if (!CanUseFeedback(nexus)) return NewInsufficientFeedback(nexus.kind()); if (nexus.IsUninitialized()) return NewInsufficientFeedback(nexus.kind());
base::Optional<HeapObjectRef> target_ref; base::Optional<HeapObjectRef> target_ref;
{ {
......
...@@ -118,16 +118,6 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -118,16 +118,6 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
bool tracing_enabled() const { return tracing_enabled_; } bool tracing_enabled() const { return tracing_enabled_; }
bool is_concurrent_inlining() const { return is_concurrent_inlining_; } bool is_concurrent_inlining() const { return is_concurrent_inlining_; }
bool is_isolate_bootstrapping() const { return is_isolate_bootstrapping_; } bool is_isolate_bootstrapping() const { return is_isolate_bootstrapping_; }
bool is_native_context_independent() const {
// TODO(jgruber,v8:8888): Remove dependent code.
return false;
}
bool generate_full_feedback_collection() const {
// NCI code currently collects full feedback.
DCHECK_IMPLIES(is_native_context_independent(),
CollectFeedbackInGenericLowering());
return is_native_context_independent();
}
bool is_turboprop() const { return code_kind_ == CodeKind::TURBOPROP; } bool is_turboprop() const { return code_kind_ == CodeKind::TURBOPROP; }
NexusConfig feedback_nexus_config() const { NexusConfig feedback_nexus_config() const {
...@@ -372,7 +362,6 @@ class V8_EXPORT_PRIVATE JSHeapBroker { ...@@ -372,7 +362,6 @@ class V8_EXPORT_PRIVATE JSHeapBroker {
friend class PropertyCellData; friend class PropertyCellData;
ProcessedFeedback const& GetFeedback(FeedbackSource const& source) const; ProcessedFeedback const& GetFeedback(FeedbackSource const& source) const;
bool CanUseFeedback(const FeedbackNexus& nexus) const;
const ProcessedFeedback& NewInsufficientFeedback(FeedbackSlotKind kind) const; const ProcessedFeedback& NewInsufficientFeedback(FeedbackSlotKind kind) const;
// Bottleneck FeedbackNexus access here, for storage in the broker // Bottleneck FeedbackNexus access here, for storage in the broker
......
...@@ -2349,16 +2349,7 @@ Reduction JSTypedLowering::ReduceJSResolvePromise(Node* node) { ...@@ -2349,16 +2349,7 @@ Reduction JSTypedLowering::ReduceJSResolvePromise(Node* node) {
} }
Reduction JSTypedLowering::Reduce(Node* node) { Reduction JSTypedLowering::Reduce(Node* node) {
const IrOpcode::Value opcode = node->opcode(); switch (node->opcode()) {
if (broker()->generate_full_feedback_collection() &&
IrOpcode::IsFeedbackCollectingOpcode(opcode)) {
// In NCI code, it is not valid to reduce feedback-collecting JS opcodes
// into non-feedback-collecting lower-level opcodes; missed feedback would
// result in soft deopts.
return NoChange();
}
switch (opcode) {
case IrOpcode::kJSEqual: case IrOpcode::kJSEqual:
return ReduceJSEqual(node); return ReduceJSEqual(node);
case IrOpcode::kJSStrictEqual: case IrOpcode::kJSStrictEqual:
......
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