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

Side by Side Diff: runtime/vm/stub_code_arm64.cc

Issue 311963002: In class Function replace current code field with current instruction field, that way we save one l… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.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 (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 __ Drop(3); 591 __ Drop(3);
592 __ Pop(R0); // Get result into R0 (target function). 592 __ Pop(R0); // Get result into R0 (target function).
593 593
594 // Restore IC data and arguments descriptor. 594 // Restore IC data and arguments descriptor.
595 __ Pop(R4); 595 __ Pop(R4);
596 __ Pop(R5); 596 __ Pop(R5);
597 597
598 __ LeaveStubFrame(); 598 __ LeaveStubFrame();
599 599
600 // Tail-call to target function. 600 // Tail-call to target function.
601 __ LoadFieldFromOffset(R2, R0, Function::code_offset(), kNoPP); 601 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
602 __ LoadFieldFromOffset(R2, R2, Code::instructions_offset(), kNoPP);
603 __ AddImmediate(R2, R2, Instructions::HeaderSize() - kHeapObjectTag, PP); 602 __ AddImmediate(R2, R2, Instructions::HeaderSize() - kHeapObjectTag, PP);
604 __ br(R2); 603 __ br(R2);
605 } 604 }
606 605
607 606
608 // Called for inline allocation of arrays. 607 // Called for inline allocation of arrays.
609 // Input parameters: 608 // Input parameters:
610 // LR: return address. 609 // LR: return address.
611 // R2: array length as Smi. 610 // R2: array length as Smi.
612 // R1: array element type (either NULL or an instantiated type). 611 // R1: array element type (either NULL or an instantiated type).
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 __ LoadFromOffset(R0, R6, target_offset, kNoPP); 1470 __ LoadFromOffset(R0, R6, target_offset, kNoPP);
1472 __ LoadFromOffset(R1, R6, count_offset, kNoPP); 1471 __ LoadFromOffset(R1, R6, count_offset, kNoPP);
1473 __ adds(R1, R1, Operand(Smi::RawValue(1))); 1472 __ adds(R1, R1, Operand(Smi::RawValue(1)));
1474 __ StoreToOffset(R1, R6, count_offset, kNoPP); 1473 __ StoreToOffset(R1, R6, count_offset, kNoPP);
1475 __ b(&call_target_function, VC); // No overflow. 1474 __ b(&call_target_function, VC); // No overflow.
1476 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue), kNoPP); 1475 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue), kNoPP);
1477 __ StoreToOffset(R1, R6, count_offset, kNoPP); 1476 __ StoreToOffset(R1, R6, count_offset, kNoPP);
1478 1477
1479 __ Bind(&call_target_function); 1478 __ Bind(&call_target_function);
1480 // R0: target function. 1479 // R0: target function.
1481 __ LoadFieldFromOffset(R2, R0, Function::code_offset(), kNoPP); 1480 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
1482 __ LoadFieldFromOffset(R2, R2, Code::instructions_offset(), kNoPP);
1483 __ AddImmediate( 1481 __ AddImmediate(
1484 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); 1482 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
1485 __ br(R2); 1483 __ br(R2);
1486 } 1484 }
1487 1485
1488 1486
1489 // Use inline cache data array to invoke the target or continue in inline 1487 // Use inline cache data array to invoke the target or continue in inline
1490 // cache miss handler. Stub for 1-argument check (receiver class). 1488 // cache miss handler. Stub for 1-argument check (receiver class).
1491 // LR: return address. 1489 // LR: return address.
1492 // R5: inline cache data object. 1490 // R5: inline cache data object.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 __ b(&increment_done, VC); // No overflow. 1593 __ b(&increment_done, VC); // No overflow.
1596 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue), kNoPP); 1594 __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue), kNoPP);
1597 __ StoreToOffset(R1, R6, count_offset, kNoPP); 1595 __ StoreToOffset(R1, R6, count_offset, kNoPP);
1598 __ Bind(&increment_done); 1596 __ Bind(&increment_done);
1599 1597
1600 // Load arguments descriptor into R4. 1598 // Load arguments descriptor into R4.
1601 __ LoadFieldFromOffset(R4, R5, ICData::arguments_descriptor_offset(), kNoPP); 1599 __ LoadFieldFromOffset(R4, R5, ICData::arguments_descriptor_offset(), kNoPP);
1602 1600
1603 // Get function and call it, if possible. 1601 // Get function and call it, if possible.
1604 __ LoadFromOffset(R0, R6, target_offset, kNoPP); 1602 __ LoadFromOffset(R0, R6, target_offset, kNoPP);
1605 __ LoadFieldFromOffset(R2, R0, Function::code_offset(), kNoPP); 1603 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
1606 1604
1607 // R0: function. 1605 // R0: function.
1608 // R2: target code. 1606 // R2: target instructons.
1609 __ LoadFieldFromOffset(R2, R2, Code::instructions_offset(), kNoPP);
1610 __ AddImmediate( 1607 __ AddImmediate(
1611 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); 1608 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
1612 __ br(R2); 1609 __ br(R2);
1613 } 1610 }
1614 1611
1615 1612
1616 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) { 1613 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
1617 GenerateUsageCounterIncrement(assembler, R6); 1614 GenerateUsageCounterIncrement(assembler, R6);
1618 GenerateNArgsCheckInlineCacheStub( 1615 GenerateNArgsCheckInlineCacheStub(
1619 assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry); 1616 assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry);
1620 } 1617 }
1621 1618
1622 1619
1623 // Stub for compiling a function and jumping to the compiled code. 1620 // Stub for compiling a function and jumping to the compiled code.
1624 // R5: IC-Data (for methods). 1621 // R5: IC-Data (for methods).
1625 // R4: Arguments descriptor. 1622 // R4: Arguments descriptor.
1626 // R0: Function. 1623 // R0: Function.
1627 void StubCode::GenerateLazyCompileStub(Assembler* assembler) { 1624 void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
1628 // Preserve arg desc. and IC data object. 1625 // Preserve arg desc. and IC data object.
1629 __ EnterStubFrame(); 1626 __ EnterStubFrame();
1630 __ Push(R5); // Save IC Data. 1627 __ Push(R5); // Save IC Data.
1631 __ Push(R4); // Save arg. desc. 1628 __ Push(R4); // Save arg. desc.
1632 __ Push(R0); // Pass function. 1629 __ Push(R0); // Pass function.
1633 __ CallRuntime(kCompileFunctionRuntimeEntry, 1); 1630 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1634 __ Pop(R0); // Restore argument. 1631 __ Pop(R0); // Restore argument.
1635 __ Pop(R4); // Restore arg desc. 1632 __ Pop(R4); // Restore arg desc.
1636 __ Pop(R5); // Restore IC Data. 1633 __ Pop(R5); // Restore IC Data.
1637 __ LeaveStubFrame(); 1634 __ LeaveStubFrame();
1638 1635
1639 __ LoadFieldFromOffset(R2, R0, Function::code_offset(), kNoPP); 1636 __ LoadFieldFromOffset(R2, R0, Function::instructions_offset(), kNoPP);
1640 __ LoadFieldFromOffset(R2, R2, Code::instructions_offset(), kNoPP);
1641 __ AddImmediate( 1637 __ AddImmediate(
1642 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP); 1638 R2, R2, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
1643 __ br(R2); 1639 __ br(R2);
1644 } 1640 }
1645 1641
1646 1642
1647 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { 1643 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
1648 __ EnterStubFrame(); 1644 __ EnterStubFrame();
1649 __ Push(R5); // Save IC Data. 1645 __ Push(R5); // Save IC Data.
1650 __ Push(R4); // Save arg. desc. 1646 __ Push(R4); // Save arg. desc.
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 const Register right = R0; 1920 const Register right = R0;
1925 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 1921 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
1926 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 1922 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
1927 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1923 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1928 __ ret(); 1924 __ ret();
1929 } 1925 }
1930 1926
1931 } // namespace dart 1927 } // namespace dart
1932 1928
1933 #endif // defined TARGET_ARCH_ARM64 1929 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698