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

Unified Diff: src/code-stub-assembler.cc

Issue 2932263002: [cleanup] Remove instanceof cache. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index e1f72fa759fa4b6052829b02983fd0151eaba093..000c064a7057d072cca4c9c14fb0b2223f1cdc17 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -6006,23 +6006,6 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
// Load map of {object}.
Node* object_map = LoadMap(object);
- // Lookup the {callable} and {object} map in the global instanceof cache.
- // Note: This is safe because we clear the global instanceof cache whenever
- // we change the prototype of any object.
- Node* instanceof_cache_function =
- LoadRoot(Heap::kInstanceofCacheFunctionRootIndex);
- Node* instanceof_cache_map = LoadRoot(Heap::kInstanceofCacheMapRootIndex);
- {
- Label instanceof_cache_miss(this);
- GotoIfNot(WordEqual(instanceof_cache_function, callable),
- &instanceof_cache_miss);
- GotoIfNot(WordEqual(instanceof_cache_map, object_map),
- &instanceof_cache_miss);
- var_result.Bind(LoadRoot(Heap::kInstanceofCacheAnswerRootIndex));
- Goto(&return_result);
- BIND(&instanceof_cache_miss);
- }
-
// Goto runtime if {callable} is a Smi.
GotoIf(TaggedIsSmi(callable), &return_runtime);
@@ -6069,11 +6052,6 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
callable_prototype = var_callable_prototype.value();
}
- // Update the global instanceof cache with the current {object} map and
- // {callable}. The cached answer will be set when it is known below.
- StoreRoot(Heap::kInstanceofCacheFunctionRootIndex, callable);
- StoreRoot(Heap::kInstanceofCacheMapRootIndex, object_map);
-
// Loop through the prototype chain looking for the {callable} prototype.
VARIABLE(var_object_map, MachineRepresentation::kTagged, object_map);
Label loop(this, &var_object_map);
@@ -6106,19 +6084,15 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
}
BIND(&return_true);
- StoreRoot(Heap::kInstanceofCacheAnswerRootIndex, BooleanConstant(true));
var_result.Bind(BooleanConstant(true));
Goto(&return_result);
BIND(&return_false);
- StoreRoot(Heap::kInstanceofCacheAnswerRootIndex, BooleanConstant(false));
var_result.Bind(BooleanConstant(false));
Goto(&return_result);
BIND(&return_runtime);
{
- // Invalidate the global instanceof cache.
- StoreRoot(Heap::kInstanceofCacheFunctionRootIndex, SmiConstant(0));
// Fallback to the runtime implementation.
var_result.Bind(
CallRuntime(Runtime::kOrdinaryHasInstance, context, callable, object));
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698