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

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

Issue 2626863004: Revert of [TypeFeedbackVector] Root literal arrays in function literals 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/ia32/builtins-ia32.cc ('k') | src/builtins/mips64/builtins-mips64.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 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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 // -- a1 : target function (preserved for callee) 1342 // -- a1 : target function (preserved for callee)
1343 // ----------------------------------- 1343 // -----------------------------------
1344 // First lookup code, maybe we don't need to compile! 1344 // First lookup code, maybe we don't need to compile!
1345 Label gotta_call_runtime, gotta_call_runtime_no_stack; 1345 Label gotta_call_runtime, gotta_call_runtime_no_stack;
1346 Label try_shared; 1346 Label try_shared;
1347 Label loop_top, loop_bottom; 1347 Label loop_top, loop_bottom;
1348 1348
1349 Register argument_count = a0; 1349 Register argument_count = a0;
1350 Register closure = a1; 1350 Register closure = a1;
1351 Register new_target = a3; 1351 Register new_target = a3;
1352 Register map = a0;
1353 Register index = a2;
1354
1355 // Do we have a valid feedback vector?
1356 __ lw(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset));
1357 __ lw(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset));
1358 __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex,
1359 &gotta_call_runtime_no_stack);
1360
1361 __ push(argument_count); 1352 __ push(argument_count);
1362 __ push(new_target); 1353 __ push(new_target);
1363 __ push(closure); 1354 __ push(closure);
1364 1355
1356 Register map = a0;
1357 Register index = a2;
1365 __ lw(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1358 __ lw(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1366 __ lw(map, FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 1359 __ lw(map, FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
1367 __ lw(index, FieldMemOperand(map, FixedArray::kLengthOffset)); 1360 __ lw(index, FieldMemOperand(map, FixedArray::kLengthOffset));
1368 __ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2))); 1361 __ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2)));
1369 1362
1363 // Find literals.
1370 // a3 : native context 1364 // a3 : native context
1371 // a2 : length / index 1365 // a2 : length / index
1372 // a0 : optimized code map 1366 // a0 : optimized code map
1373 // stack[0] : new target 1367 // stack[0] : new target
1374 // stack[4] : closure 1368 // stack[4] : closure
1375 Register native_context = a3; 1369 Register native_context = a3;
1376 __ lw(native_context, NativeContextMemOperand()); 1370 __ lw(native_context, NativeContextMemOperand());
1377 1371
1378 __ bind(&loop_top); 1372 __ bind(&loop_top);
1379 Register temp = a1; 1373 Register temp = a1;
1380 Register array_pointer = t1; 1374 Register array_pointer = t1;
1381 1375
1382 // Does the native context match? 1376 // Does the native context match?
1383 __ sll(at, index, kPointerSizeLog2 - kSmiTagSize); 1377 __ sll(at, index, kPointerSizeLog2 - kSmiTagSize);
1384 __ Addu(array_pointer, map, Operand(at)); 1378 __ Addu(array_pointer, map, Operand(at));
1385 __ lw(temp, FieldMemOperand(array_pointer, 1379 __ lw(temp, FieldMemOperand(array_pointer,
1386 SharedFunctionInfo::kOffsetToPreviousContext)); 1380 SharedFunctionInfo::kOffsetToPreviousContext));
1387 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1381 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1388 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); 1382 __ Branch(&loop_bottom, ne, temp, Operand(native_context));
1383 // Literals available?
1384 __ lw(temp, FieldMemOperand(array_pointer,
1385 SharedFunctionInfo::kOffsetToPreviousLiterals));
1386 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1387 __ JumpIfSmi(temp, &gotta_call_runtime);
1388
1389 // Save the literals in the closure.
1390 __ lw(t0, MemOperand(sp, 0));
1391 __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset));
1392 __ push(index);
1393 __ RecordWriteField(t0, JSFunction::kLiteralsOffset, temp, index,
1394 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1395 OMIT_SMI_CHECK);
1396 __ pop(index);
1389 1397
1390 // Code available? 1398 // Code available?
1391 Register entry = t0; 1399 Register entry = t0;
1392 __ lw(entry, 1400 __ lw(entry,
1393 FieldMemOperand(array_pointer, 1401 FieldMemOperand(array_pointer,
1394 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1402 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1395 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1403 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1396 __ JumpIfSmi(entry, &try_shared); 1404 __ JumpIfSmi(entry, &try_shared);
1397 1405
1398 // Found code. Get it into the closure and return. 1406 // Found literals and code. Get them into the closure and return.
1399 __ pop(closure); 1407 __ pop(closure);
1400 // Store code entry in the closure. 1408 // Store code entry in the closure.
1401 __ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1409 __ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1402 __ sw(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); 1410 __ sw(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset));
1403 __ RecordWriteCodeEntryField(closure, entry, t1); 1411 __ RecordWriteCodeEntryField(closure, entry, t1);
1404 1412
1405 // Link the closure into the optimized function list. 1413 // Link the closure into the optimized function list.
1406 // t0 : code entry 1414 // t0 : code entry
1407 // a3 : native context 1415 // a3 : native context
1408 // a1 : closure 1416 // a1 : closure
(...skipping 14 matching lines...) Expand all
1423 __ mov(closure, t1); 1431 __ mov(closure, t1);
1424 __ pop(new_target); 1432 __ pop(new_target);
1425 __ pop(argument_count); 1433 __ pop(argument_count);
1426 __ Jump(entry); 1434 __ Jump(entry);
1427 1435
1428 __ bind(&loop_bottom); 1436 __ bind(&loop_bottom);
1429 __ Subu(index, index, 1437 __ Subu(index, index,
1430 Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength))); 1438 Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
1431 __ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1))); 1439 __ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1)));
1432 1440
1433 // We found no code. 1441 // We found neither literals nor code.
1434 __ jmp(&gotta_call_runtime); 1442 __ jmp(&gotta_call_runtime);
1435 1443
1436 __ bind(&try_shared); 1444 __ bind(&try_shared);
1437 __ pop(closure); 1445 __ pop(closure);
1438 __ pop(new_target); 1446 __ pop(new_target);
1439 __ pop(argument_count); 1447 __ pop(argument_count);
1440 __ lw(entry, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1448 __ lw(entry, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1441 // Is the shared function marked for tier up? 1449 // Is the shared function marked for tier up?
1442 __ lbu(t1, FieldMemOperand(entry, 1450 __ lbu(t1, FieldMemOperand(entry,
1443 SharedFunctionInfo::kMarkedForTierUpByteOffset)); 1451 SharedFunctionInfo::kMarkedForTierUpByteOffset));
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 __ break_(0xCC); 2971 __ break_(0xCC);
2964 } 2972 }
2965 } 2973 }
2966 2974
2967 #undef __ 2975 #undef __
2968 2976
2969 } // namespace internal 2977 } // namespace internal
2970 } // namespace v8 2978 } // namespace v8
2971 2979
2972 #endif // V8_TARGET_ARCH_MIPS 2980 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698