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

Unified Diff: src/builtins/arm64/builtins-arm64.cc

Issue 2403453002: Revert of [turbofan] Discard the shared code entry in the optimized code map. (Closed)
Patch Set: Created 4 years, 2 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/builtins/arm/builtins-arm.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/arm64/builtins-arm64.cc
diff --git a/src/builtins/arm64/builtins-arm64.cc b/src/builtins/arm64/builtins-arm64.cc
index b6f9041bac2bf09c42d386d7d0c7fb16eeef369f..b815b85b878a6e3e6ead436447f722a94af83bfe 100644
--- a/src/builtins/arm64/builtins-arm64.cc
+++ b/src/builtins/arm64/builtins-arm64.cc
@@ -1381,6 +1381,7 @@
// -----------------------------------
// First lookup code, maybe we don't need to compile!
Label gotta_call_runtime;
+ Label maybe_call_runtime;
Label try_shared;
Label loop_top, loop_bottom;
@@ -1438,10 +1439,13 @@
FieldMemOperand(array_pointer,
SharedFunctionInfo::kOffsetToPreviousCachedCode));
__ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
- __ JumpIfSmi(entry, &try_shared);
+ __ JumpIfSmi(entry, &maybe_call_runtime);
// Found literals and code. Get them into the closure and return.
__ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
+
+ Label install_optimized_code_and_tailcall;
+ __ Bind(&install_optimized_code_and_tailcall);
__ Str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset));
__ RecordWriteCodeEntryField(closure, entry, x5);
@@ -1471,6 +1475,18 @@
// We found neither literals nor code.
__ B(&gotta_call_runtime);
+
+ __ Bind(&maybe_call_runtime);
+
+ // Last possibility. Check the context free optimized code map entry.
+ __ Ldr(entry, FieldMemOperand(map, FixedArray::kHeaderSize +
+ SharedFunctionInfo::kSharedCodeIndex));
+ __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
+ __ JumpIfSmi(entry, &try_shared);
+
+ // Store code entry in the closure.
+ __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
+ __ B(&install_optimized_code_and_tailcall);
__ Bind(&try_shared);
// Is the full code valid?
« no previous file with comments | « src/builtins/arm/builtins-arm.cc ('k') | src/builtins/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698