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

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

Issue 2642933003: Revert of Revert [TypeFeedbackVector] Root literal arrays in function literal slots (Closed)
Patch Set: Created 3 years, 11 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') | src/builtins/x64/builtins-x64.cc » ('j') | 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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 // -- r3 : target function (preserved for callee) 1361 // -- r3 : target function (preserved for callee)
1362 // ----------------------------------- 1362 // -----------------------------------
1363 // First lookup code, maybe we don't need to compile! 1363 // First lookup code, maybe we don't need to compile!
1364 Label gotta_call_runtime; 1364 Label gotta_call_runtime;
1365 Label try_shared; 1365 Label try_shared;
1366 Label loop_top, loop_bottom; 1366 Label loop_top, loop_bottom;
1367 1367
1368 Register closure = r3; 1368 Register closure = r3;
1369 Register map = r8; 1369 Register map = r8;
1370 Register index = r4; 1370 Register index = r4;
1371
1372 // Do we have a valid feedback vector?
1373 __ LoadP(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset));
1374 __ LoadP(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset));
1375 __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, &gotta_call_runtime);
1376
1371 __ LoadP(map, 1377 __ LoadP(map,
1372 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1378 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1373 __ LoadP(map, 1379 __ LoadP(map,
1374 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 1380 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
1375 __ LoadP(index, FieldMemOperand(map, FixedArray::kLengthOffset)); 1381 __ LoadP(index, FieldMemOperand(map, FixedArray::kLengthOffset));
1376 __ CmpSmiLiteral(index, Smi::FromInt(2), r0); 1382 __ CmpSmiLiteral(index, Smi::FromInt(2), r0);
1377 __ blt(&gotta_call_runtime); 1383 __ blt(&gotta_call_runtime);
1378 1384
1379 // Find literals. 1385 // Find literals.
1380 // r9 : native context 1386 // r9 : native context
1381 // r4 : length / index 1387 // r4 : length / index
1382 // r8 : optimized code map 1388 // r8 : optimized code map
1383 // r5 : new target 1389 // r5 : new target
1384 // r3 : closure 1390 // r3 : closure
1385 Register native_context = r9; 1391 Register native_context = r9;
1386 __ LoadP(native_context, NativeContextMemOperand()); 1392 __ LoadP(native_context, NativeContextMemOperand());
1387 1393
1388 __ bind(&loop_top); 1394 __ bind(&loop_top);
1389 Register temp = r1; 1395 Register temp = r1;
1390 Register array_pointer = r7; 1396 Register array_pointer = r7;
1391 1397
1392 // Does the native context match? 1398 // Does the native context match?
1393 __ SmiToPtrArrayOffset(array_pointer, index); 1399 __ SmiToPtrArrayOffset(array_pointer, index);
1394 __ AddP(array_pointer, map, array_pointer); 1400 __ AddP(array_pointer, map, array_pointer);
1395 __ LoadP(temp, FieldMemOperand(array_pointer, 1401 __ LoadP(temp, FieldMemOperand(array_pointer,
1396 SharedFunctionInfo::kOffsetToPreviousContext)); 1402 SharedFunctionInfo::kOffsetToPreviousContext));
1397 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1403 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1398 __ CmpP(temp, native_context); 1404 __ CmpP(temp, native_context);
1399 __ bne(&loop_bottom, Label::kNear); 1405 __ bne(&loop_bottom, Label::kNear);
1400 // Literals available?
1401 __ LoadP(temp,
1402 FieldMemOperand(array_pointer,
1403 SharedFunctionInfo::kOffsetToPreviousLiterals));
1404 __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1405 __ JumpIfSmi(temp, &gotta_call_runtime);
1406
1407 // Save the literals in the closure.
1408 __ StoreP(temp, FieldMemOperand(closure, JSFunction::kLiteralsOffset), r0);
1409 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r6,
1410 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1411 OMIT_SMI_CHECK);
1412 1406
1413 // Code available? 1407 // Code available?
1414 Register entry = r6; 1408 Register entry = r6;
1415 __ LoadP(entry, 1409 __ LoadP(entry,
1416 FieldMemOperand(array_pointer, 1410 FieldMemOperand(array_pointer,
1417 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1411 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1418 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1412 __ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1419 __ JumpIfSmi(entry, &try_shared); 1413 __ JumpIfSmi(entry, &try_shared);
1420 1414
1421 // Found literals and code. Get them into the closure and return. 1415 // Found code. Get it into the closure and return.
1422 // Store code entry in the closure. 1416 // Store code entry in the closure.
1423 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1417 __ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1424 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); 1418 __ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
1425 __ RecordWriteCodeEntryField(closure, entry, r7); 1419 __ RecordWriteCodeEntryField(closure, entry, r7);
1426 1420
1427 // Link the closure into the optimized function list. 1421 // Link the closure into the optimized function list.
1428 // r6 : code entry 1422 // r6 : code entry
1429 // r9: native context 1423 // r9: native context
1430 // r3 : closure 1424 // r3 : closure
1431 __ LoadP( 1425 __ LoadP(
(...skipping 13 matching lines...) Expand all
1445 __ RecordWriteContextSlot(native_context, function_list_offset, r7, temp, 1439 __ RecordWriteContextSlot(native_context, function_list_offset, r7, temp,
1446 kLRHasNotBeenSaved, kDontSaveFPRegs); 1440 kLRHasNotBeenSaved, kDontSaveFPRegs);
1447 __ JumpToJSEntry(entry); 1441 __ JumpToJSEntry(entry);
1448 1442
1449 __ bind(&loop_bottom); 1443 __ bind(&loop_bottom);
1450 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength), 1444 __ SubSmiLiteral(index, index, Smi::FromInt(SharedFunctionInfo::kEntryLength),
1451 r0); 1445 r0);
1452 __ CmpSmiLiteral(index, Smi::FromInt(1), r0); 1446 __ CmpSmiLiteral(index, Smi::FromInt(1), r0);
1453 __ bgt(&loop_top); 1447 __ bgt(&loop_top);
1454 1448
1455 // We found neither literals nor code. 1449 // We found no code.
1456 __ b(&gotta_call_runtime); 1450 __ b(&gotta_call_runtime);
1457 1451
1458 __ bind(&try_shared); 1452 __ bind(&try_shared);
1459 __ LoadP(entry, 1453 __ LoadP(entry,
1460 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1454 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1461 // Is the shared function marked for tier up? 1455 // Is the shared function marked for tier up?
1462 __ LoadlB(temp, FieldMemOperand( 1456 __ LoadlB(temp, FieldMemOperand(
1463 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset)); 1457 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset));
1464 __ TestBit(temp, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0); 1458 __ TestBit(temp, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0);
1465 __ bne(&gotta_call_runtime); 1459 __ bne(&gotta_call_runtime);
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 __ bkpt(0); 2981 __ bkpt(0);
2988 } 2982 }
2989 } 2983 }
2990 2984
2991 #undef __ 2985 #undef __
2992 2986
2993 } // namespace internal 2987 } // namespace internal
2994 } // namespace v8 2988 } // namespace v8
2995 2989
2996 #endif // V8_TARGET_ARCH_S390 2990 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/builtins/ppc/builtins-ppc.cc ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698