Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: src/code-stubs.cc

Issue 2365223003: Revert of [compiler] Properly guard the speculative optimizations for instanceof. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 5ed03f8101418ad3333be162018369ab3fd888eb..a7429d050c8ef4e1de0174112cec5f1137cfcdbc 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -2929,67 +2929,6 @@
// TODO(bmeurer): Use GetPropertyStub here once available.
assembler->Bind(&return_runtime);
{
- result.Bind(assembler->CallRuntime(Runtime::kInstanceOf, context, object,
- callable));
- assembler->Goto(&end);
- }
-
- assembler->Bind(&end);
- return result.value();
-}
-
-// static
-compiler::Node* InstanceOfWithFeedbackStub::Generate(
- CodeStubAssembler* assembler, compiler::Node* object,
- compiler::Node* callable, compiler::Node* slot_id,
- compiler::Node* type_feedback_vector, compiler::Node* context) {
- // TODO(bmeurer): Unify this with the InstanceOfStub above. This
- // stub itself can be removed once we get rid of fullcodegen.
- typedef CodeStubAssembler::Label Label;
- typedef compiler::Node Node;
- typedef CodeStubAssembler::Variable Variable;
-
- Label return_runtime(assembler, Label::kDeferred), end(assembler);
- Variable result(assembler, MachineRepresentation::kTagged);
-
- // Check if no one installed @@hasInstance somewhere.
- assembler->GotoUnless(
- assembler->WordEqual(
- assembler->LoadObjectField(
- assembler->LoadRoot(Heap::kHasInstanceProtectorRootIndex),
- PropertyCell::kValueOffset),
- assembler->SmiConstant(Smi::FromInt(Isolate::kArrayProtectorValid))),
- &return_runtime);
-
- // Check if {callable} is a valid receiver.
- assembler->GotoIf(assembler->WordIsSmi(callable), &return_runtime);
- assembler->GotoIf(
- assembler->Word32Equal(
- assembler->Word32And(
- assembler->LoadMapBitField(assembler->LoadMap(callable)),
- assembler->Int32Constant(1 << Map::kIsCallable)),
- assembler->Int32Constant(0)),
- &return_runtime);
-
- // Use the inline OrdinaryHasInstance directly.
- CodeStubAssembler::VectorSlotPair feedback(type_feedback_vector, slot_id);
- result.Bind(
- assembler->OrdinaryHasInstance(context, callable, object, feedback));
- assembler->Goto(&end);
-
- assembler->Bind(&return_runtime);
- {
- // Record megamorphic here; we use this feedback to guard a bunch of
- // speculative optimizations in TurboFand (and Crankshaft) that just
- // deoptimize in case of funny inputs to instanceof.
- Node* megamorphic_sentinel = assembler->HeapConstant(
- TypeFeedbackVector::MegamorphicSentinel(assembler->isolate()));
- assembler->StoreFixedArrayElement(type_feedback_vector, slot_id,
- megamorphic_sentinel, SKIP_WRITE_BARRIER);
-
- // Fallback to the %InstanceOf runtime implementation for now, which
- // can deal with @@hasInstance and friends.
- // TODO(bmeurer): Use GetPropertyStub here once available.
result.Bind(assembler->CallRuntime(Runtime::kInstanceOf, context, object,
callable));
assembler->Goto(&end);
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698