Chromium Code Reviews

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

Issue 2401653002: [turbofan] Discard the shared code entry in the optimized code map. (Closed)
Patch Set: Dead code. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 1363 matching lines...)
1374 } 1374 }
1375 1375
1376 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1376 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1377 // ----------- S t a t e ------------- 1377 // ----------- S t a t e -------------
1378 // -- x0 : argument count (preserved for callee) 1378 // -- x0 : argument count (preserved for callee)
1379 // -- x3 : new target (preserved for callee) 1379 // -- x3 : new target (preserved for callee)
1380 // -- x1 : target function (preserved for callee) 1380 // -- x1 : target function (preserved for callee)
1381 // ----------------------------------- 1381 // -----------------------------------
1382 // First lookup code, maybe we don't need to compile! 1382 // First lookup code, maybe we don't need to compile!
1383 Label gotta_call_runtime; 1383 Label gotta_call_runtime;
1384 Label maybe_call_runtime;
1385 Label try_shared; 1384 Label try_shared;
1386 Label loop_top, loop_bottom; 1385 Label loop_top, loop_bottom;
1387 1386
1388 Register closure = x1; 1387 Register closure = x1;
1389 Register map = x13; 1388 Register map = x13;
1390 Register index = x2; 1389 Register index = x2;
1391 __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1390 __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1392 __ Ldr(map, 1391 __ Ldr(map,
1393 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 1392 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
1394 __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset)); 1393 __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset));
(...skipping 37 matching lines...)
1432 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7, 1431 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7,
1433 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1432 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1434 OMIT_SMI_CHECK); 1433 OMIT_SMI_CHECK);
1435 1434
1436 // Code available? 1435 // Code available?
1437 Register entry = x7; 1436 Register entry = x7;
1438 __ Ldr(entry, 1437 __ Ldr(entry,
1439 FieldMemOperand(array_pointer, 1438 FieldMemOperand(array_pointer,
1440 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1439 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1441 __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1440 __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1442 __ JumpIfSmi(entry, &maybe_call_runtime); 1441 __ JumpIfSmi(entry, &try_shared);
1443 1442
1444 // Found literals and code. Get them into the closure and return. 1443 // Found literals and code. Get them into the closure and return.
1445 __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1444 __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1446 1445
1447 Label install_optimized_code_and_tailcall; 1446 Label install_optimized_code_and_tailcall;
1448 __ Bind(&install_optimized_code_and_tailcall); 1447 __ Bind(&install_optimized_code_and_tailcall);
1449 __ Str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); 1448 __ Str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset));
1450 __ RecordWriteCodeEntryField(closure, entry, x5); 1449 __ RecordWriteCodeEntryField(closure, entry, x5);
1451 1450
1452 // Link the closure into the optimized function list. 1451 // Link the closure into the optimized function list.
(...skipping 16 matching lines...)
1469 __ Jump(entry); 1468 __ Jump(entry);
1470 1469
1471 __ Bind(&loop_bottom); 1470 __ Bind(&loop_bottom);
1472 __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength)); 1471 __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength));
1473 __ Cmp(index, Operand(1)); 1472 __ Cmp(index, Operand(1));
1474 __ B(gt, &loop_top); 1473 __ B(gt, &loop_top);
1475 1474
1476 // We found neither literals nor code. 1475 // We found neither literals nor code.
1477 __ B(&gotta_call_runtime); 1476 __ B(&gotta_call_runtime);
1478 1477
1479 __ Bind(&maybe_call_runtime);
1480
1481 // Last possibility. Check the context free optimized code map entry.
1482 __ Ldr(entry, FieldMemOperand(map, FixedArray::kHeaderSize +
1483 SharedFunctionInfo::kSharedCodeIndex));
1484 __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1485 __ JumpIfSmi(entry, &try_shared);
1486
1487 // Store code entry in the closure.
1488 __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1489 __ B(&install_optimized_code_and_tailcall);
1490
1491 __ Bind(&try_shared); 1478 __ Bind(&try_shared);
1492 // Is the full code valid? 1479 // Is the full code valid?
1493 __ Ldr(entry, 1480 __ Ldr(entry,
1494 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1481 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1495 __ Ldr(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); 1482 __ Ldr(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset));
1496 __ Ldr(x5, FieldMemOperand(entry, Code::kFlagsOffset)); 1483 __ Ldr(x5, FieldMemOperand(entry, Code::kFlagsOffset));
1497 __ and_(x5, x5, Operand(Code::KindField::kMask)); 1484 __ and_(x5, x5, Operand(Code::KindField::kMask));
1498 __ Mov(x5, Operand(x5, LSR, Code::KindField::kShift)); 1485 __ Mov(x5, Operand(x5, LSR, Code::KindField::kShift));
1499 __ Cmp(x5, Operand(Code::BUILTIN)); 1486 __ Cmp(x5, Operand(Code::BUILTIN));
1500 __ B(eq, &gotta_call_runtime); 1487 __ B(eq, &gotta_call_runtime);
(...skipping 1521 matching lines...)
3022 __ Unreachable(); 3009 __ Unreachable();
3023 } 3010 }
3024 } 3011 }
3025 3012
3026 #undef __ 3013 #undef __
3027 3014
3028 } // namespace internal 3015 } // namespace internal
3029 } // namespace v8 3016 } // namespace v8
3030 3017
3031 #endif // V8_TARGET_ARCH_ARM 3018 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine