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

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

Issue 2597163002: Revert of [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: Created 3 years, 12 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/ast/ast-numbering.cc ('k') | src/builtins/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 1343
1344 Register map = argument_count; 1344 Register map = argument_count;
1345 Register index = r2; 1345 Register index = r2;
1346 __ ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1346 __ ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1347 __ ldr(map, 1347 __ ldr(map,
1348 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); 1348 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
1349 __ ldr(index, FieldMemOperand(map, FixedArray::kLengthOffset)); 1349 __ ldr(index, FieldMemOperand(map, FixedArray::kLengthOffset));
1350 __ cmp(index, Operand(Smi::FromInt(2))); 1350 __ cmp(index, Operand(Smi::FromInt(2)));
1351 __ b(lt, &gotta_call_runtime); 1351 __ b(lt, &gotta_call_runtime);
1352 1352
1353 // Find literals.
1353 // r3 : native context 1354 // r3 : native context
1354 // r2 : length / index 1355 // r2 : length / index
1355 // r0 : optimized code map 1356 // r0 : optimized code map
1356 // stack[0] : new target 1357 // stack[0] : new target
1357 // stack[4] : closure 1358 // stack[4] : closure
1358 Register native_context = r3; 1359 Register native_context = r3;
1359 __ ldr(native_context, NativeContextMemOperand()); 1360 __ ldr(native_context, NativeContextMemOperand());
1360 1361
1361 __ bind(&loop_top); 1362 __ bind(&loop_top);
1362 Register temp = r1; 1363 Register temp = r1;
1363 Register array_pointer = r5; 1364 Register array_pointer = r5;
1364 1365
1365 // Does the native context match? 1366 // Does the native context match?
1366 __ add(array_pointer, map, Operand::PointerOffsetFromSmiKey(index)); 1367 __ add(array_pointer, map, Operand::PointerOffsetFromSmiKey(index));
1367 __ ldr(temp, FieldMemOperand(array_pointer, 1368 __ ldr(temp, FieldMemOperand(array_pointer,
1368 SharedFunctionInfo::kOffsetToPreviousContext)); 1369 SharedFunctionInfo::kOffsetToPreviousContext));
1369 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1370 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1370 __ cmp(temp, native_context); 1371 __ cmp(temp, native_context);
1371 __ b(ne, &loop_bottom); 1372 __ b(ne, &loop_bottom);
1373 // Literals available?
1374 __ ldr(temp, FieldMemOperand(array_pointer,
1375 SharedFunctionInfo::kOffsetToPreviousLiterals));
1376 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1377 __ JumpIfSmi(temp, &gotta_call_runtime);
1378
1379 // Save the literals in the closure.
1380 __ ldr(r4, MemOperand(sp, 0));
1381 __ str(temp, FieldMemOperand(r4, JSFunction::kLiteralsOffset));
1382 __ push(index);
1383 __ RecordWriteField(r4, JSFunction::kLiteralsOffset, temp, index,
1384 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1385 OMIT_SMI_CHECK);
1386 __ pop(index);
1372 1387
1373 // Code available? 1388 // Code available?
1374 Register entry = r4; 1389 Register entry = r4;
1375 __ ldr(entry, 1390 __ ldr(entry,
1376 FieldMemOperand(array_pointer, 1391 FieldMemOperand(array_pointer,
1377 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1392 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1378 __ ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1393 __ ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
1379 __ JumpIfSmi(entry, &try_shared); 1394 __ JumpIfSmi(entry, &try_shared);
1380 1395
1381 // Found code. Get it into the closure and return. 1396 // Found literals and code. Get them into the closure and return.
1382 __ pop(closure); 1397 __ pop(closure);
1383 // Store code entry in the closure. 1398 // Store code entry in the closure.
1384 __ add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); 1399 __ add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
1385 __ str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); 1400 __ str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset));
1386 __ RecordWriteCodeEntryField(closure, entry, r5); 1401 __ RecordWriteCodeEntryField(closure, entry, r5);
1387 1402
1388 // Link the closure into the optimized function list. 1403 // Link the closure into the optimized function list.
1389 // r4 : code entry 1404 // r4 : code entry
1390 // r3 : native context 1405 // r3 : native context
1391 // r1 : closure 1406 // r1 : closure
(...skipping 14 matching lines...) Expand all
1406 __ mov(closure, r5); 1421 __ mov(closure, r5);
1407 __ pop(new_target); 1422 __ pop(new_target);
1408 __ pop(argument_count); 1423 __ pop(argument_count);
1409 __ Jump(entry); 1424 __ Jump(entry);
1410 1425
1411 __ bind(&loop_bottom); 1426 __ bind(&loop_bottom);
1412 __ sub(index, index, Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength))); 1427 __ sub(index, index, Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
1413 __ cmp(index, Operand(Smi::FromInt(1))); 1428 __ cmp(index, Operand(Smi::FromInt(1)));
1414 __ b(gt, &loop_top); 1429 __ b(gt, &loop_top);
1415 1430
1416 // We found no code. 1431 // We found neither literals nor code.
1417 __ jmp(&gotta_call_runtime); 1432 __ jmp(&gotta_call_runtime);
1418 1433
1419 __ bind(&try_shared); 1434 __ bind(&try_shared);
1420 __ pop(closure); 1435 __ pop(closure);
1421 __ pop(new_target); 1436 __ pop(new_target);
1422 __ pop(argument_count); 1437 __ pop(argument_count);
1423 __ ldr(entry, 1438 __ ldr(entry,
1424 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); 1439 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
1425 // Is the shared function marked for tier up? 1440 // Is the shared function marked for tier up?
1426 __ ldrb(r5, FieldMemOperand(entry, 1441 __ ldrb(r5, FieldMemOperand(entry,
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 __ bkpt(0); 2887 __ bkpt(0);
2873 } 2888 }
2874 } 2889 }
2875 2890
2876 #undef __ 2891 #undef __
2877 2892
2878 } // namespace internal 2893 } // namespace internal
2879 } // namespace v8 2894 } // namespace v8
2880 2895
2881 #endif // V8_TARGET_ARCH_ARM 2896 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ast/ast-numbering.cc ('k') | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698