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

Unified Diff: runtime/vm/code_patcher_mips_test.cc

Issue 13474009: Implements optional parameter handling in MIPS vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/code_patcher_mips_test.cc
===================================================================
--- runtime/vm/code_patcher_mips_test.cc (revision 20887)
+++ runtime/vm/code_patcher_mips_test.cc (working copy)
@@ -45,12 +45,34 @@
#define __ assembler->
ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) {
- UNIMPLEMENTED();
+ 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("callerFunction"));
+ const Function& function = Function::ZoneHandle(
+ Function::New(function_name, RawFunction::kRegularFunction,
+ true, false, false, false, owner_class, 0));
+
+ const String& target_name = String::Handle(String::New("targetFunction"));
+ const ICData& ic_data =
+ ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
+ const Array& arg_descriptor =
+ Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
+
+ __ LoadObject(S4, arg_descriptor);
+ __ LoadObject(S5, ic_data);
+ ExternalLabel target_label(
+ "InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
+ __ BranchLinkPatchable(&target_label);
+ __ Ret();
}
ASSEMBLER_TEST_RUN(IcDataAccess, test) {
- uword return_address = test->entry() + CodePatcher::InstanceCallSizeInBytes();
+ uword return_address =
+ test->entry() + test->code().Size() - 2 * Instr::kInstrSize;
ICData& ic_data = ICData::Handle();
CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data, NULL);
EXPECT_STREQ("targetFunction",

Powered by Google App Engine
This is Rietveld 408576698