| OLD | NEW | 
|---|
| 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...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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; | 
| 1384   Label try_shared; | 1385   Label try_shared; | 
| 1385   Label loop_top, loop_bottom; | 1386   Label loop_top, loop_bottom; | 
| 1386 | 1387 | 
| 1387   Register closure = x1; | 1388   Register closure = x1; | 
| 1388   Register map = x13; | 1389   Register map = x13; | 
| 1389   Register index = x2; | 1390   Register index = x2; | 
| 1390   __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1391   __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 
| 1391   __ Ldr(map, | 1392   __ Ldr(map, | 
| 1392          FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 1393          FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 
| 1393   __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset)); | 1394   __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset)); | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1431   __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7, | 1432   __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7, | 
| 1432                       kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1433                       kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 
| 1433                       OMIT_SMI_CHECK); | 1434                       OMIT_SMI_CHECK); | 
| 1434 | 1435 | 
| 1435   // Code available? | 1436   // Code available? | 
| 1436   Register entry = x7; | 1437   Register entry = x7; | 
| 1437   __ Ldr(entry, | 1438   __ Ldr(entry, | 
| 1438          FieldMemOperand(array_pointer, | 1439          FieldMemOperand(array_pointer, | 
| 1439                          SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 1440                          SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 
| 1440   __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); | 1441   __ Ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); | 
| 1441   __ JumpIfSmi(entry, &try_shared); | 1442   __ JumpIfSmi(entry, &maybe_call_runtime); | 
| 1442 | 1443 | 
| 1443   // Found literals and code. Get them into the closure and return. | 1444   // Found literals and code. Get them into the closure and return. | 
| 1444   __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1445   __ Add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); | 
|  | 1446 | 
|  | 1447   Label install_optimized_code_and_tailcall; | 
|  | 1448   __ Bind(&install_optimized_code_and_tailcall); | 
| 1445   __ Str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); | 1449   __ Str(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset)); | 
| 1446   __ RecordWriteCodeEntryField(closure, entry, x5); | 1450   __ RecordWriteCodeEntryField(closure, entry, x5); | 
| 1447 | 1451 | 
| 1448   // Link the closure into the optimized function list. | 1452   // Link the closure into the optimized function list. | 
| 1449   // x7 : code entry | 1453   // x7 : code entry | 
| 1450   // x4 : native context | 1454   // x4 : native context | 
| 1451   // x1 : closure | 1455   // x1 : closure | 
| 1452   __ Ldr(x8, | 1456   __ Ldr(x8, | 
| 1453          ContextMemOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST)); | 1457          ContextMemOperand(native_context, Context::OPTIMIZED_FUNCTIONS_LIST)); | 
| 1454   __ Str(x8, FieldMemOperand(closure, JSFunction::kNextFunctionLinkOffset)); | 1458   __ Str(x8, FieldMemOperand(closure, JSFunction::kNextFunctionLinkOffset)); | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 1465   __ Jump(entry); | 1469   __ Jump(entry); | 
| 1466 | 1470 | 
| 1467   __ Bind(&loop_bottom); | 1471   __ Bind(&loop_bottom); | 
| 1468   __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength)); | 1472   __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength)); | 
| 1469   __ Cmp(index, Operand(1)); | 1473   __ Cmp(index, Operand(1)); | 
| 1470   __ B(gt, &loop_top); | 1474   __ B(gt, &loop_top); | 
| 1471 | 1475 | 
| 1472   // We found neither literals nor code. | 1476   // We found neither literals nor code. | 
| 1473   __ B(&gotta_call_runtime); | 1477   __ B(&gotta_call_runtime); | 
| 1474 | 1478 | 
|  | 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 | 
| 1475   __ Bind(&try_shared); | 1491   __ Bind(&try_shared); | 
| 1476   // Is the full code valid? | 1492   // Is the full code valid? | 
| 1477   __ Ldr(entry, | 1493   __ Ldr(entry, | 
| 1478          FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1494          FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 
| 1479   __ Ldr(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); | 1495   __ Ldr(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset)); | 
| 1480   __ Ldr(x5, FieldMemOperand(entry, Code::kFlagsOffset)); | 1496   __ Ldr(x5, FieldMemOperand(entry, Code::kFlagsOffset)); | 
| 1481   __ and_(x5, x5, Operand(Code::KindField::kMask)); | 1497   __ and_(x5, x5, Operand(Code::KindField::kMask)); | 
| 1482   __ Mov(x5, Operand(x5, LSR, Code::KindField::kShift)); | 1498   __ Mov(x5, Operand(x5, LSR, Code::KindField::kShift)); | 
| 1483   __ Cmp(x5, Operand(Code::BUILTIN)); | 1499   __ Cmp(x5, Operand(Code::BUILTIN)); | 
| 1484   __ B(eq, &gotta_call_runtime); | 1500   __ B(eq, &gotta_call_runtime); | 
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3006     __ Unreachable(); | 3022     __ Unreachable(); | 
| 3007   } | 3023   } | 
| 3008 } | 3024 } | 
| 3009 | 3025 | 
| 3010 #undef __ | 3026 #undef __ | 
| 3011 | 3027 | 
| 3012 }  // namespace internal | 3028 }  // namespace internal | 
| 3013 }  // namespace v8 | 3029 }  // namespace v8 | 
| 3014 | 3030 | 
| 3015 #endif  // V8_TARGET_ARCH_ARM | 3031 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW | 
|---|