Commit 743fdb25 authored by mvstanton's avatar mvstanton Committed by Commit bot

[builtins] CompileLazy bailed out to the runtime entirely too often.

This is just a bug. CompileLazy knows how to look in the
SharedFunctionInfo for code (or bytecode, essentially) if it
finds nothing in the OptimizedCodeMap. Ensure that behavior.

BUG=681543
R=leszeks@chromium.org

Review-Url: https://codereview.chromium.org/2636143002
Cr-Commit-Position: refs/heads/master@{#42409}
parent b83c3d29
......@@ -1354,7 +1354,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ ldr(index, FieldMemOperand(map, FixedArray::kLengthOffset));
__ cmp(index, Operand(Smi::FromInt(2)));
__ b(lt, &gotta_call_runtime);
__ b(lt, &try_shared);
// r3 : native context
// r2 : length / index
......@@ -1419,9 +1419,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ cmp(index, Operand(Smi::FromInt(1)));
__ b(gt, &loop_top);
// We found no code.
__ jmp(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ bind(&try_shared);
__ pop(closure);
__ pop(new_target);
......
......@@ -1357,7 +1357,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset));
__ Cmp(index, Operand(2));
__ B(lt, &gotta_call_runtime);
__ B(lt, &try_shared);
// x3 : native context
// x2 : length / index
......@@ -1416,9 +1416,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ Cmp(index, Operand(1));
__ B(gt, &loop_top);
// We found no code.
__ B(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ Bind(&try_shared);
__ Ldr(entry,
FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
......
......@@ -1040,7 +1040,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ mov(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ mov(index, FieldOperand(map, FixedArray::kLengthOffset));
__ cmp(index, Immediate(Smi::FromInt(2)));
__ j(less, &gotta_call_runtime);
__ j(less, &try_shared);
// edx : native context
// ebx : length / index
......@@ -1100,9 +1100,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ cmp(index, Immediate(Smi::FromInt(1)));
__ j(greater, &loop_top);
// We found no code.
__ jmp(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ bind(&try_shared);
__ pop(closure);
__ pop(new_target);
......
......@@ -1364,7 +1364,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ lw(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
__ lw(map, FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ lw(index, FieldMemOperand(map, FixedArray::kLengthOffset));
__ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2)));
__ Branch(&try_shared, lt, index, Operand(Smi::FromInt(2)));
// a3 : native context
// a2 : length / index
......@@ -1429,9 +1429,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
__ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1)));
// We found no code.
__ jmp(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ bind(&try_shared);
__ pop(closure);
__ pop(new_target);
......
......@@ -1355,7 +1355,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ ld(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
__ ld(map, FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ ld(index, FieldMemOperand(map, FixedArray::kLengthOffset));
__ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2)));
__ Branch(&try_shared, lt, index, Operand(Smi::FromInt(2)));
// a3 : native context
// a2 : length / index
......@@ -1420,9 +1420,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
__ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1)));
// We found no code.
__ jmp(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ bind(&try_shared);
__ pop(closure);
__ pop(new_target);
......
......@@ -1004,7 +1004,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset));
__ cmpl(index, Immediate(2));
__ j(less, &gotta_call_runtime);
__ j(less, &try_shared);
// r14 : native context
// r9 : length / index
......@@ -1061,9 +1061,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ cmpl(index, Immediate(1));
__ j(greater, &loop_top);
// We found no code.
__ jmp(&gotta_call_runtime);
// We found no code. Try the SharedFunctionInfo.
__ bind(&try_shared);
__ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset));
// Is the shared function marked for tier up?
......
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