OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 __ b(&gotta_call_runtime); | 1449 __ b(&gotta_call_runtime); |
1450 | 1450 |
1451 __ bind(&try_shared); | 1451 __ bind(&try_shared); |
1452 __ LoadP(entry, | 1452 __ LoadP(entry, |
1453 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1453 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1454 // Is the shared function marked for tier up? | 1454 // Is the shared function marked for tier up? |
1455 __ lbz(r8, FieldMemOperand(entry, | 1455 __ lbz(r8, FieldMemOperand(entry, |
1456 SharedFunctionInfo::kMarkedForTierUpByteOffset)); | 1456 SharedFunctionInfo::kMarkedForTierUpByteOffset)); |
1457 __ TestBit(r8, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0); | 1457 __ TestBit(r8, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0); |
1458 __ bne(&gotta_call_runtime, cr0); | 1458 __ bne(&gotta_call_runtime, cr0); |
1459 // Is the full code valid? | 1459 |
| 1460 // If SFI points to anything other than CompileLazy, install that. |
1460 __ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1461 __ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); |
1461 __ lwz(r8, FieldMemOperand(entry, Code::kFlagsOffset)); | 1462 __ mov(r8, Operand(masm->CodeObject())); |
1462 __ DecodeField<Code::KindField>(r8); | 1463 __ cmp(entry, r8); |
1463 __ cmpi(r8, Operand(Code::BUILTIN)); | |
1464 __ beq(&gotta_call_runtime); | 1464 __ beq(&gotta_call_runtime); |
1465 // Yes, install the full code. | 1465 |
| 1466 // Install the SFI's code entry. |
1466 __ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1467 __ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1467 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); | 1468 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); |
1468 __ RecordWriteCodeEntryField(closure, entry, r8); | 1469 __ RecordWriteCodeEntryField(closure, entry, r8); |
1469 __ JumpToJSEntry(entry); | 1470 __ JumpToJSEntry(entry); |
1470 | 1471 |
1471 __ bind(&gotta_call_runtime); | 1472 __ bind(&gotta_call_runtime); |
1472 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy); | 1473 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy); |
1473 } | 1474 } |
1474 | 1475 |
1475 void Builtins::Generate_CompileBaseline(MacroAssembler* masm) { | 1476 void Builtins::Generate_CompileBaseline(MacroAssembler* masm) { |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 __ CallRuntime(Runtime::kThrowStackOverflow); | 2972 __ CallRuntime(Runtime::kThrowStackOverflow); |
2972 __ bkpt(0); | 2973 __ bkpt(0); |
2973 } | 2974 } |
2974 } | 2975 } |
2975 | 2976 |
2976 #undef __ | 2977 #undef __ |
2977 } // namespace internal | 2978 } // namespace internal |
2978 } // namespace v8 | 2979 } // namespace v8 |
2979 | 2980 |
2980 #endif // V8_TARGET_ARCH_PPC | 2981 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |