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

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

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