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

Side by Side Diff: src/builtins/mips/builtins-mips.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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1364 }
1365 1365
1366 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1366 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1367 // ----------- S t a t e ------------- 1367 // ----------- S t a t e -------------
1368 // -- a0 : argument count (preserved for callee) 1368 // -- a0 : argument count (preserved for callee)
1369 // -- a3 : new target (preserved for callee) 1369 // -- a3 : new target (preserved for callee)
1370 // -- a1 : target function (preserved for callee) 1370 // -- a1 : target function (preserved for callee)
1371 // ----------------------------------- 1371 // -----------------------------------
1372 // First lookup code, maybe we don't need to compile! 1372 // First lookup code, maybe we don't need to compile!
1373 Label gotta_call_runtime, gotta_call_runtime_no_stack; 1373 Label gotta_call_runtime, gotta_call_runtime_no_stack;
1374 Label maybe_call_runtime;
1375 Label try_shared; 1374 Label try_shared;
1376 Label loop_top, loop_bottom; 1375 Label loop_top, loop_bottom;
1377 1376
1378 Register argument_count = a0; 1377 Register argument_count = a0;
1379 Register closure = a1; 1378 Register closure = a1;
1380 Register new_target = a3; 1379 Register new_target = a3;
1381 __ push(argument_count); 1380 __ push(argument_count);
1382 __ push(new_target); 1381 __ push(new_target);
1383 __ push(closure); 1382 __ push(closure);
1384 1383
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1427 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1429 OMIT_SMI_CHECK); 1428 OMIT_SMI_CHECK);
1430 __ pop(index); 1429 __ pop(index);
1431 1430
1432 // Code available? 1431 // Code available?
1433 Register entry = t0; 1432 Register entry = t0;
1434 __ lw(entry, 1433 __ lw(entry,
1435 FieldMemOperand(array_pointer, 1434 FieldMemOperand(array_pointer,
1436 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1435 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1437 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1436 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1438 __ JumpIfSmi(entry, &maybe_call_runtime); 1437 __ JumpIfSmi(entry, &try_shared);
1439 1438
1440 // Found literals and code. Get them into the closure and return. 1439 // Found literals and code. Get them into the closure and return.
1441 __ pop(closure); 1440 __ pop(closure);
1442 // Store code entry in the closure. 1441 // Store code entry in the closure.
1443 __ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1442 __ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1444 1443
1445 Label install_optimized_code_and_tailcall; 1444 Label install_optimized_code_and_tailcall;
1446 __ bind(&install_optimized_code_and_tailcall); 1445 __ bind(&install_optimized_code_and_tailcall);
1447 __ sw(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); 1446 __ sw(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset));
1448 __ RecordWriteCodeEntryField(closure, entry, t1); 1447 __ RecordWriteCodeEntryField(closure, entry, t1);
(...skipping 22 matching lines...) Expand all
1471 __ Jump(entry); 1470 __ Jump(entry);
1472 1471
1473 __ bind(&loop_bottom); 1472 __ bind(&loop_bottom);
1474 __ Subu(index, index, 1473 __ Subu(index, index,
1475 Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength))); 1474 Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
1476 __ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1))); 1475 __ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1)));
1477 1476
1478 // We found neither literals nor code. 1477 // We found neither literals nor code.
1479 __ jmp(&gotta_call_runtime); 1478 __ jmp(&gotta_call_runtime);
1480 1479
1481 __ bind(&maybe_call_runtime); 1480 __ bind(&try_shared);
1482 __ pop(closure); 1481 __ pop(closure);
1483
1484 // Last possibility. Check the context free optimized code map entry.
1485 __ lw(entry, FieldMemOperand(map, FixedArray::kHeaderSize +
1486 SharedFunctionInfo::kSharedCodeIndex));
1487 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1488 __ JumpIfSmi(entry, &try_shared);
1489
1490 // Store code entry in the closure.
1491 __ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1492 __ jmp(&install_optimized_code_and_tailcall);
1493
1494 __ bind(&try_shared);
1495 __ pop(new_target); 1482 __ pop(new_target);
1496 __ pop(argument_count); 1483 __ pop(argument_count);
1497 // Is the full code valid? 1484 // Is the full code valid?
1498 __ lw(entry, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1485 __ lw(entry, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1499 __ lw(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); 1486 __ lw(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset));
1500 __ lw(t1, FieldMemOperand(entry, Code::kFlagsOffset)); 1487 __ lw(t1, FieldMemOperand(entry, Code::kFlagsOffset));
1501 __ And(t1, t1, Operand(Code::KindField::kMask)); 1488 __ And(t1, t1, Operand(Code::KindField::kMask));
1502 __ srl(t1, t1, Code::KindField::kShift); 1489 __ srl(t1, t1, Code::KindField::kShift);
1503 __ Branch(&gotta_call_runtime_no_stack, eq, t1, Operand(Code::BUILTIN)); 1490 __ Branch(&gotta_call_runtime_no_stack, eq, t1, Operand(Code::BUILTIN));
1504 // Yes, install the full code. 1491 // Yes, install the full code.
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 __ break_(0xCC); 2984 __ break_(0xCC);
2998 } 2985 }
2999 } 2986 }
3000 2987
3001 #undef __ 2988 #undef __
3002 2989
3003 } // namespace internal 2990 } // namespace internal
3004 } // namespace v8 2991 } // namespace v8
3005 2992
3006 #endif // V8_TARGET_ARCH_MIPS 2993 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698