Flutter Engine
The Flutter Engine
instructions_arm64_test.cc
Go to the documentation of this 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
3// BSD-style license that can be found in the LICENSE file.
4
5#include "vm/globals.h"
6#if defined(TARGET_ARCH_ARM64)
7
9#include "vm/cpu.h"
10#include "vm/instructions.h"
11#include "vm/stub_code.h"
12#include "vm/unit_test.h"
13
14namespace dart {
15
16#define __ assembler->
17
18ASSEMBLER_TEST_GENERATE(Call, assembler) {
19 // Code is generated, but not executed. Just parsed with CallPattern
20 __ set_constant_pool_allowed(true); // Uninitialized pp is OK.
21 SPILLS_LR_TO_FRAME({}); // Clobbered LR is OK.
22 __ BranchLinkPatchable(StubCode::InvokeDartCode());
23 RESTORES_LR_FROM_FRAME({}); // Clobbered LR is OK.
24 __ ret();
25}
26
28 // The return address, which must be the address of an instruction contained
29 // in the code, points to the Ret instruction above, i.e. one instruction
30 // before the end of the code buffer.
31 uword end = test->payload_start() + test->code().Size();
32 CallPattern call(end - Instr::kInstrSize, test->code());
33 EXPECT_EQ(StubCode::InvokeDartCode().ptr(), call.TargetCode());
34}
35
36} // namespace dart
37
38#endif // defined TARGET_ARCH_ARM64
#define __
glong glong end
Definition: dart_vm.cc:33
uintptr_t uword
Definition: globals.h:501
ASSEMBLER_TEST_RUN(StoreIntoObject, test)
def call(args)
Definition: dom.py:159
#define ASSEMBLER_TEST_GENERATE(name, assembler)
Definition: unit_test.h:89