Chromium Code Reviews| Index: vm/runtime_entry_test.cc |
| =================================================================== |
| --- vm/runtime_entry_test.cc (revision 8520) |
| +++ vm/runtime_entry_test.cc (working copy) |
| @@ -41,4 +41,17 @@ |
| arguments.SetReturn(Smi::Handle(Smi::New(result))); |
| } |
| + |
| +// A leaf runtime call for test purposes. |
| +// Arg0: a smi. |
| +// Arg1: a smi. |
| +// returns a smi representing arg0 + arg1. |
| +DEFINE_LEAF_RUNTIME_ENTRY(TestLeafSmiAdd, 2) { |
| + ASSERT(args.Count() == kTestLeafSmiAddRuntimeEntry.argument_count()); |
| + // Ignoring overflow in the calculation below. |
| + intptr_t result = Smi::Value(reinterpret_cast<RawSmi*>(args.At(0))) + |
| + Smi::Value(reinterpret_cast<RawSmi*>(args.At(1))); |
| + return Smi::New(result); |
|
Ivan Posva
2012/06/14 04:09:35
I would avoid any calls to handle based methods he
siva
2012/06/15 00:09:41
Done.
|
| +} |
| + |
| } // namespace dart |