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

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

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

Powered by Google App Engine
This is Rietveld 408576698