Index: src/builtins/x64/builtins-x64.cc |
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc |
index ed8300598a88fd7dc3210fd0874d13f80738e04c..c412431fa5517300596180e2d4713e78e60206ab 100644 |
--- a/src/builtins/x64/builtins-x64.cc |
+++ b/src/builtins/x64/builtins-x64.cc |
@@ -1121,8 +1121,15 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ jmp(&gotta_call_runtime); |
__ bind(&try_shared); |
- // Is the full code valid? |
__ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
+ // Is the shared function marked for optimization? |
+ __ testb( |
+ FieldOperand(entry, |
+ SharedFunctionInfo::kWasMarkedForOptimizationByteOffset), |
+ Immediate( |
+ 1 << SharedFunctionInfo::kWasMarkedForOptimizationBitWithinByte)); |
+ __ j(not_zero, &gotta_call_runtime); |
+ // Is the full code valid? |
__ movp(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset)); |
__ movl(rbx, FieldOperand(entry, Code::kFlagsOffset)); |
__ andl(rbx, Immediate(Code::KindField::kMask)); |