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

Side by Side Diff: src/builtins/s390/builtins-s390.cc

Issue 2401043002: PPC/s390: Reland "[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 unified diff | Download patch
« no previous file with comments | « src/builtins/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_S390 5 #if V8_TARGET_ARCH_S390
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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 } 1394 }
1395 1395
1396 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1396 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1397 // ----------- S t a t e ------------- 1397 // ----------- S t a t e -------------
1398 // -- r2 : argument count (preserved for callee) 1398 // -- r2 : argument count (preserved for callee)
1399 // -- r5 : new target (preserved for callee) 1399 // -- r5 : new target (preserved for callee)
1400 // -- r3 : target function (preserved for callee) 1400 // -- r3 : target function (preserved for callee)
1401 // ----------------------------------- 1401 // -----------------------------------
1402 // First lookup code, maybe we don't need to compile! 1402 // First lookup code, maybe we don't need to compile!
1403 Label gotta_call_runtime; 1403 Label gotta_call_runtime;
1404 Label maybe_call_runtime;
1405 Label try_shared; 1404 Label try_shared;
1406 Label loop_top, loop_bottom; 1405 Label loop_top, loop_bottom;
1407 1406
1408 Register closure = r3; 1407 Register closure = r3;
1409 Register map = r8; 1408 Register map = r8;
1410 Register index = r4; 1409 Register index = r4;
1411 __ LoadP(map, 1410 __ LoadP(map,
1412 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1411 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1413 __ LoadP(map, 1412 __ LoadP(map,
1414 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 1413 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r6, 1455 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r6,
1457 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1456 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1458 OMIT_SMI_CHECK); 1457 OMIT_SMI_CHECK);
1459 1458
1460 // Code available? 1459 // Code available?
1461 Register entry = r6; 1460 Register entry = r6;
1462 __ LoadP(entry, 1461 __ LoadP(entry,
1463 FieldMemOperand(array_pointer, 1462 FieldMemOperand(array_pointer,
1464 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1463 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1465 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1464 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1466 __ JumpIfSmi(entry, &maybe_call_runtime); 1465 __ JumpIfSmi(entry, &try_shared);
1467 1466
1468 // Found literals and code. Get them into the closure and return. 1467 // Found literals and code. Get them into the closure and return.
1469 // Store code entry in the closure. 1468 // Store code entry in the closure.
1470 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1469 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1471
1472 Label install_optimized_code_and_tailcall;
1473 __ bind(&install_optimized_code_and_tailcall);
1474 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); 1470 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
1475 __ RecordWriteCodeEntryField(closure, entry, r7); 1471 __ RecordWriteCodeEntryField(closure, entry, r7);
1476 1472
1477 // Link the closure into the optimized function list. 1473 // Link the closure into the optimized function list.
1478 // r6 : code entry 1474 // r6 : code entry
1479 // r9: native context 1475 // r9: native context
1480 // r3 : closure 1476 // r3 : closure
1481 __ LoadP( 1477 __ LoadP(
1482 r7, ContextMemOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST)); 1478 r7, ContextMemOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST));
1483 __ StoreP(r7, FieldMemOperand(closure, JSFunction::kNextFunctionLinkOffset), 1479 __ StoreP(r7, FieldMemOperand(closure, JSFunction::kNextFunctionLinkOffset),
(...skipping 14 matching lines...) Expand all
1498 1494
1499 __ bind(&loop_bottom); 1495 __ bind(&loop_bottom);
1500 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength), 1496 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength),
1501 r0); 1497 r0);
1502 __ CmpSmiLiteral(index, Smi::FromInt(1), r0); 1498 __ CmpSmiLiteral(index, Smi::FromInt(1), r0);
1503 __ bgt(&loop_top); 1499 __ bgt(&loop_top);
1504 1500
1505 // We found neither literals nor code. 1501 // We found neither literals nor code.
1506 __ b(&gotta_call_runtime); 1502 __ b(&gotta_call_runtime);
1507 1503
1508 __ bind(&maybe_call_runtime);
1509
1510 // Last possibility. Check the context free optimized code map entry.
1511 __ LoadP(entry,
1512 FieldMemOperand(map, FixedArray::kHeaderSize +
1513 SharedFunctionInfo::kSharedCodeIndex));
1514 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1515 __ JumpIfSmi(entry, &try_shared);
1516
1517 // Store code entry in the closure.
1518 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1519 __ b(&install_optimized_code_and_tailcall);
1520
1521 __ bind(&try_shared); 1504 __ bind(&try_shared);
1522 // Is the full code valid? 1505 // Is the full code valid?
1523 __ LoadP(entry, 1506 __ LoadP(entry,
1524 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1507 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1525 __ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); 1508 __ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset));
1526 __ LoadlW(r7, FieldMemOperand(entry, Code::kFlagsOffset)); 1509 __ LoadlW(r7, FieldMemOperand(entry, Code::kFlagsOffset));
1527 __ DecodeField<Code::KindField>(r7); 1510 __ DecodeField<Code::KindField>(r7);
1528 __ CmpP(r7, Operand(Code::BUILTIN)); 1511 __ CmpP(r7, Operand(Code::BUILTIN));
1529 __ beq(&gotta_call_runtime); 1512 __ beq(&gotta_call_runtime);
1530 // Yes, install the full code. 1513 // Yes, install the full code.
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
3023 __ bkpt(0); 3006 __ bkpt(0);
3024 } 3007 }
3025 } 3008 }
3026 3009
3027 #undef __ 3010 #undef __
3028 3011
3029 } // namespace internal 3012 } // namespace internal
3030 } // namespace v8 3013 } // namespace v8
3031 3014
3032 #endif // V8_TARGET_ARCH_S390 3015 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/builtins/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698