mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
Add test skeletons for arm and mips.
Review URL: https://codereview.chromium.org//11929037 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17330 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
759e9b6706
commit
0bf36986ec
30
runtime/vm/assembler_arm_test.cc
Normal file
30
runtime/vm/assembler_arm_test.cc
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_ARM)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/os.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
#include "vm/virtual_memory.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Simple, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Simple, entry) {
|
||||||
|
typedef int (*SimpleCode)();
|
||||||
|
EXPECT_EQ(42, reinterpret_cast<SimpleCode>(entry)());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_ARM
|
30
runtime/vm/assembler_mips_test.cc
Normal file
30
runtime/vm/assembler_mips_test.cc
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_MIPS)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/os.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
#include "vm/virtual_memory.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Simple, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Simple, entry) {
|
||||||
|
typedef int (*SimpleCode)();
|
||||||
|
EXPECT_EQ(42, reinterpret_cast<SimpleCode>(entry)());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_MIPS
|
64
runtime/vm/code_patcher_arm_test.cc
Normal file
64
runtime/vm/code_patcher_arm_test.cc
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_ARM)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/code_generator.h"
|
||||||
|
#include "vm/code_patcher.h"
|
||||||
|
#include "vm/dart_entry.h"
|
||||||
|
#include "vm/instructions.h"
|
||||||
|
#include "vm/native_entry.h"
|
||||||
|
#include "vm/native_entry_test.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/symbols.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
CODEGEN_TEST_GENERATE(NativePatchStaticCall, test) {
|
||||||
|
SequenceNode* node_seq = test->node_sequence();
|
||||||
|
const String& native_name =
|
||||||
|
String::ZoneHandle(Symbols::New("TestStaticCallPatching"));
|
||||||
|
NativeFunction native_function =
|
||||||
|
reinterpret_cast<NativeFunction>(TestStaticCallPatching);
|
||||||
|
test->function().set_is_native(true);
|
||||||
|
node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex,
|
||||||
|
new NativeBodyNode(Scanner::kDummyTokenIndex,
|
||||||
|
test->function(),
|
||||||
|
native_name,
|
||||||
|
native_function)));
|
||||||
|
}
|
||||||
|
|
||||||
|
CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) {
|
||||||
|
SequenceNode* node_seq = test->node_sequence();
|
||||||
|
ArgumentListNode* arguments = new ArgumentListNode(Scanner::kDummyTokenIndex);
|
||||||
|
node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex,
|
||||||
|
new StaticCallNode(Scanner::kDummyTokenIndex,
|
||||||
|
function, arguments)));
|
||||||
|
}
|
||||||
|
|
||||||
|
CODEGEN_TEST2_RUN(PatchStaticCall, NativePatchStaticCall, Instance::null());
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(IcDataAccess, entry) {
|
||||||
|
uword return_address = entry + CodePatcher::InstanceCallSizeInBytes();
|
||||||
|
ICData& ic_data = ICData::Handle();
|
||||||
|
CodePatcher::GetInstanceCallAt(return_address, &ic_data, NULL);
|
||||||
|
EXPECT_STREQ("targetFunction",
|
||||||
|
String::Handle(ic_data.target_name()).ToCString());
|
||||||
|
EXPECT_EQ(1, ic_data.num_args_tested());
|
||||||
|
EXPECT_EQ(0, ic_data.NumberOfChecks());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // TARGET_ARCH_ARM
|
64
runtime/vm/code_patcher_mips_test.cc
Normal file
64
runtime/vm/code_patcher_mips_test.cc
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_MIPS)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/code_generator.h"
|
||||||
|
#include "vm/code_patcher.h"
|
||||||
|
#include "vm/dart_entry.h"
|
||||||
|
#include "vm/instructions.h"
|
||||||
|
#include "vm/native_entry.h"
|
||||||
|
#include "vm/native_entry_test.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/symbols.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
CODEGEN_TEST_GENERATE(NativePatchStaticCall, test) {
|
||||||
|
SequenceNode* node_seq = test->node_sequence();
|
||||||
|
const String& native_name =
|
||||||
|
String::ZoneHandle(Symbols::New("TestStaticCallPatching"));
|
||||||
|
NativeFunction native_function =
|
||||||
|
reinterpret_cast<NativeFunction>(TestStaticCallPatching);
|
||||||
|
test->function().set_is_native(true);
|
||||||
|
node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex,
|
||||||
|
new NativeBodyNode(Scanner::kDummyTokenIndex,
|
||||||
|
test->function(),
|
||||||
|
native_name,
|
||||||
|
native_function)));
|
||||||
|
}
|
||||||
|
|
||||||
|
CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) {
|
||||||
|
SequenceNode* node_seq = test->node_sequence();
|
||||||
|
ArgumentListNode* arguments = new ArgumentListNode(Scanner::kDummyTokenIndex);
|
||||||
|
node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex,
|
||||||
|
new StaticCallNode(Scanner::kDummyTokenIndex,
|
||||||
|
function, arguments)));
|
||||||
|
}
|
||||||
|
|
||||||
|
CODEGEN_TEST2_RUN(PatchStaticCall, NativePatchStaticCall, Instance::null());
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(IcDataAccess, entry) {
|
||||||
|
uword return_address = entry + CodePatcher::InstanceCallSizeInBytes();
|
||||||
|
ICData& ic_data = ICData::Handle();
|
||||||
|
CodePatcher::GetInstanceCallAt(return_address, &ic_data, NULL);
|
||||||
|
EXPECT_STREQ("targetFunction",
|
||||||
|
String::Handle(ic_data.target_name()).ToCString());
|
||||||
|
EXPECT_EQ(1, ic_data.num_args_tested());
|
||||||
|
EXPECT_EQ(0, ic_data.NumberOfChecks());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // TARGET_ARCH_MIPS
|
53
runtime/vm/instructions_arm_test.cc
Normal file
53
runtime/vm/instructions_arm_test.cc
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_ARM)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/instructions.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Call, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Call, entry) {
|
||||||
|
CallPattern call(entry);
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
call.TargetAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Jump, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Jump, entry) {
|
||||||
|
JumpPattern jump1(entry);
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
jump1.TargetAddress());
|
||||||
|
JumpPattern jump2(entry + jump1.pattern_length_in_bytes());
|
||||||
|
EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
|
||||||
|
jump2.TargetAddress());
|
||||||
|
uword target1 = jump1.TargetAddress();
|
||||||
|
uword target2 = jump2.TargetAddress();
|
||||||
|
jump1.SetTargetAddress(target2);
|
||||||
|
jump2.SetTargetAddress(target1);
|
||||||
|
EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
|
||||||
|
jump1.TargetAddress());
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
jump2.TargetAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_ARM
|
53
runtime/vm/instructions_mips_test.cc
Normal file
53
runtime/vm/instructions_mips_test.cc
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_MIPS)
|
||||||
|
|
||||||
|
#include "vm/assembler.h"
|
||||||
|
#include "vm/instructions.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Call, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Call, entry) {
|
||||||
|
CallPattern call(entry);
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
call.TargetAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_GENERATE(Jump, assembler) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ASSEMBLER_TEST_RUN(Jump, entry) {
|
||||||
|
JumpPattern jump1(entry);
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
jump1.TargetAddress());
|
||||||
|
JumpPattern jump2(entry + jump1.pattern_length_in_bytes());
|
||||||
|
EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
|
||||||
|
jump2.TargetAddress());
|
||||||
|
uword target1 = jump1.TargetAddress();
|
||||||
|
uword target2 = jump2.TargetAddress();
|
||||||
|
jump1.SetTargetAddress(target2);
|
||||||
|
jump2.SetTargetAddress(target1);
|
||||||
|
EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
|
||||||
|
jump1.TargetAddress());
|
||||||
|
EXPECT_EQ(StubCode::InstanceFunctionLookupLabel().address(),
|
||||||
|
jump2.TargetAddress());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_MIPS
|
89
runtime/vm/stub_code_arm_test.cc
Normal file
89
runtime/vm/stub_code_arm_test.cc
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_ARM)
|
||||||
|
|
||||||
|
#include "vm/isolate.h"
|
||||||
|
#include "vm/dart_entry.h"
|
||||||
|
#include "vm/native_entry.h"
|
||||||
|
#include "vm/native_entry_test.h"
|
||||||
|
#include "vm/object.h"
|
||||||
|
#include "vm/runtime_entry.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/symbols.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
DECLARE_RUNTIME_ENTRY(TestSmiSub);
|
||||||
|
DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
|
||||||
|
|
||||||
|
|
||||||
|
static Function* CreateFunction(const char* name) {
|
||||||
|
const String& class_name = String::Handle(Symbols::New("ownerClass"));
|
||||||
|
const Script& script = Script::Handle();
|
||||||
|
const Class& owner_class =
|
||||||
|
Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex));
|
||||||
|
const String& function_name = String::ZoneHandle(Symbols::New(name));
|
||||||
|
Function& function = Function::ZoneHandle(
|
||||||
|
Function::New(function_name, RawFunction::kRegularFunction,
|
||||||
|
true, false, false, false, owner_class, 0));
|
||||||
|
return &function;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test calls to stub code which calls into the runtime.
|
||||||
|
static void GenerateCallToCallRuntimeStub(Assembler* assembler,
|
||||||
|
int value1, int value2) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE(CallRuntimeStubCode) {
|
||||||
|
extern const Function& RegisterFakeFunction(const char* name,
|
||||||
|
const Code& code);
|
||||||
|
const int value1 = 10;
|
||||||
|
const int value2 = 20;
|
||||||
|
const char* kName = "Test_CallRuntimeStubCode";
|
||||||
|
Assembler _assembler_;
|
||||||
|
GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
|
||||||
|
const Code& code = Code::Handle(Code::FinalizeCode(
|
||||||
|
*CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
|
||||||
|
const Function& function = RegisterFakeFunction(kName, code);
|
||||||
|
Smi& result = Smi::Handle();
|
||||||
|
result |= DartEntry::InvokeStatic(function, Object::empty_array());
|
||||||
|
EXPECT_EQ((value1 - value2), result.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test calls to stub code which calls into a leaf runtime entry.
|
||||||
|
static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
|
||||||
|
int value1,
|
||||||
|
int value2) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE(CallLeafRuntimeStubCode) {
|
||||||
|
extern const Function& RegisterFakeFunction(const char* name,
|
||||||
|
const Code& code);
|
||||||
|
const int value1 = 10;
|
||||||
|
const int value2 = 20;
|
||||||
|
const char* kName = "Test_CallLeafRuntimeStubCode";
|
||||||
|
Assembler _assembler_;
|
||||||
|
GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
|
||||||
|
const Code& code = Code::Handle(Code::FinalizeCode(
|
||||||
|
*CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_));
|
||||||
|
const Function& function = RegisterFakeFunction(kName, code);
|
||||||
|
Smi& result = Smi::Handle();
|
||||||
|
result |= DartEntry::InvokeStatic(function, Object::empty_array());
|
||||||
|
EXPECT_EQ((value1 + value2), result.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_ARM
|
89
runtime/vm/stub_code_mips_test.cc
Normal file
89
runtime/vm/stub_code_mips_test.cc
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "vm/globals.h"
|
||||||
|
#if defined(TARGET_ARCH_MIPS)
|
||||||
|
|
||||||
|
#include "vm/isolate.h"
|
||||||
|
#include "vm/dart_entry.h"
|
||||||
|
#include "vm/native_entry.h"
|
||||||
|
#include "vm/native_entry_test.h"
|
||||||
|
#include "vm/object.h"
|
||||||
|
#include "vm/runtime_entry.h"
|
||||||
|
#include "vm/stub_code.h"
|
||||||
|
#include "vm/symbols.h"
|
||||||
|
#include "vm/unit_test.h"
|
||||||
|
|
||||||
|
#define __ assembler->
|
||||||
|
|
||||||
|
namespace dart {
|
||||||
|
|
||||||
|
DECLARE_RUNTIME_ENTRY(TestSmiSub);
|
||||||
|
DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
|
||||||
|
|
||||||
|
|
||||||
|
static Function* CreateFunction(const char* name) {
|
||||||
|
const String& class_name = String::Handle(Symbols::New("ownerClass"));
|
||||||
|
const Script& script = Script::Handle();
|
||||||
|
const Class& owner_class =
|
||||||
|
Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex));
|
||||||
|
const String& function_name = String::ZoneHandle(Symbols::New(name));
|
||||||
|
Function& function = Function::ZoneHandle(
|
||||||
|
Function::New(function_name, RawFunction::kRegularFunction,
|
||||||
|
true, false, false, false, owner_class, 0));
|
||||||
|
return &function;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test calls to stub code which calls into the runtime.
|
||||||
|
static void GenerateCallToCallRuntimeStub(Assembler* assembler,
|
||||||
|
int value1, int value2) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE(CallRuntimeStubCode) {
|
||||||
|
extern const Function& RegisterFakeFunction(const char* name,
|
||||||
|
const Code& code);
|
||||||
|
const int value1 = 10;
|
||||||
|
const int value2 = 20;
|
||||||
|
const char* kName = "Test_CallRuntimeStubCode";
|
||||||
|
Assembler _assembler_;
|
||||||
|
GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
|
||||||
|
const Code& code = Code::Handle(Code::FinalizeCode(
|
||||||
|
*CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
|
||||||
|
const Function& function = RegisterFakeFunction(kName, code);
|
||||||
|
Smi& result = Smi::Handle();
|
||||||
|
result |= DartEntry::InvokeStatic(function, Object::empty_array());
|
||||||
|
EXPECT_EQ((value1 - value2), result.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Test calls to stub code which calls into a leaf runtime entry.
|
||||||
|
static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
|
||||||
|
int value1,
|
||||||
|
int value2) {
|
||||||
|
UNIMPLEMENTED();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE(CallLeafRuntimeStubCode) {
|
||||||
|
extern const Function& RegisterFakeFunction(const char* name,
|
||||||
|
const Code& code);
|
||||||
|
const int value1 = 10;
|
||||||
|
const int value2 = 20;
|
||||||
|
const char* kName = "Test_CallLeafRuntimeStubCode";
|
||||||
|
Assembler _assembler_;
|
||||||
|
GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
|
||||||
|
const Code& code = Code::Handle(Code::FinalizeCode(
|
||||||
|
*CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_));
|
||||||
|
const Function& function = RegisterFakeFunction(kName, code);
|
||||||
|
Smi& result = Smi::Handle();
|
||||||
|
result |= DartEntry::InvokeStatic(function, Object::empty_array());
|
||||||
|
EXPECT_EQ((value1 + value2), result.Value());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace dart
|
||||||
|
|
||||||
|
#endif // defined TARGET_ARCH_MIPS
|
|
@ -14,6 +14,7 @@
|
||||||
'assembler_test.cc',
|
'assembler_test.cc',
|
||||||
'assembler_arm.cc',
|
'assembler_arm.cc',
|
||||||
'assembler_arm.h',
|
'assembler_arm.h',
|
||||||
|
'assembler_arm_test.cc',
|
||||||
'assembler_ia32.cc',
|
'assembler_ia32.cc',
|
||||||
'assembler_ia32.h',
|
'assembler_ia32.h',
|
||||||
'assembler_ia32_test.cc',
|
'assembler_ia32_test.cc',
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
'assembler_macros_x64.h',
|
'assembler_macros_x64.h',
|
||||||
'assembler_mips.cc',
|
'assembler_mips.cc',
|
||||||
'assembler_mips.h',
|
'assembler_mips.h',
|
||||||
|
'assembler_mips_test.cc',
|
||||||
'assembler_x64.cc',
|
'assembler_x64.cc',
|
||||||
'assembler_x64.h',
|
'assembler_x64.h',
|
||||||
'assembler_x64_test.cc',
|
'assembler_x64_test.cc',
|
||||||
|
@ -76,9 +78,11 @@
|
||||||
'code_patcher.h',
|
'code_patcher.h',
|
||||||
'code_patcher.cc',
|
'code_patcher.cc',
|
||||||
'code_patcher_arm.cc',
|
'code_patcher_arm.cc',
|
||||||
|
'code_patcher_arm_test.cc',
|
||||||
'code_patcher_ia32.cc',
|
'code_patcher_ia32.cc',
|
||||||
'code_patcher_ia32_test.cc',
|
'code_patcher_ia32_test.cc',
|
||||||
'code_patcher_mips.cc',
|
'code_patcher_mips.cc',
|
||||||
|
'code_patcher_mips_test.cc',
|
||||||
'code_patcher_x64.cc',
|
'code_patcher_x64.cc',
|
||||||
'code_patcher_x64_test.cc',
|
'code_patcher_x64_test.cc',
|
||||||
'compiler.h',
|
'compiler.h',
|
||||||
|
@ -186,11 +190,13 @@
|
||||||
'instructions.h',
|
'instructions.h',
|
||||||
'instructions_arm.cc',
|
'instructions_arm.cc',
|
||||||
'instructions_arm.h',
|
'instructions_arm.h',
|
||||||
|
'instructions_arm_test.cc',
|
||||||
'instructions_ia32.cc',
|
'instructions_ia32.cc',
|
||||||
'instructions_ia32.h',
|
'instructions_ia32.h',
|
||||||
'instructions_ia32_test.cc',
|
'instructions_ia32_test.cc',
|
||||||
'instructions_mips.cc',
|
'instructions_mips.cc',
|
||||||
'instructions_mips.h',
|
'instructions_mips.h',
|
||||||
|
'instructions_mips_test.cc',
|
||||||
'instructions_x64.cc',
|
'instructions_x64.cc',
|
||||||
'instructions_x64.h',
|
'instructions_x64.h',
|
||||||
'instructions_x64_test.cc',
|
'instructions_x64_test.cc',
|
||||||
|
@ -296,9 +302,11 @@
|
||||||
'stub_code.cc',
|
'stub_code.cc',
|
||||||
'stub_code.h',
|
'stub_code.h',
|
||||||
'stub_code_arm.cc',
|
'stub_code_arm.cc',
|
||||||
|
'stub_code_arm_test.cc',
|
||||||
'stub_code_ia32.cc',
|
'stub_code_ia32.cc',
|
||||||
'stub_code_ia32_test.cc',
|
'stub_code_ia32_test.cc',
|
||||||
'stub_code_mips.cc',
|
'stub_code_mips.cc',
|
||||||
|
'stub_code_mips_test.cc',
|
||||||
'stub_code_x64.cc',
|
'stub_code_x64.cc',
|
||||||
'stub_code_x64_test.cc',
|
'stub_code_x64_test.cc',
|
||||||
'symbols.cc',
|
'symbols.cc',
|
||||||
|
|
Loading…
Reference in a new issue