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

Side by Side Diff: vm/runtime_entry_test.cc

Issue 10592006: Rework leaf calls as just simple C calls with a signature and not the NativeArgumentDescriptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/runtime_entry_ia32.cc ('k') | vm/runtime_entry_x64.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/runtime_entry.h" 5 #include "vm/runtime_entry.h"
6 6
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/verifier.h" 8 #include "vm/verifier.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 25 matching lines...) Expand all
36 ASSERT(arguments.Count() == kTestSmiSubRuntimeEntry.argument_count()); 36 ASSERT(arguments.Count() == kTestSmiSubRuntimeEntry.argument_count());
37 const Smi& left = Smi::CheckedHandle(arguments.At(0)); 37 const Smi& left = Smi::CheckedHandle(arguments.At(0));
38 const Smi& right = Smi::CheckedHandle(arguments.At(1)); 38 const Smi& right = Smi::CheckedHandle(arguments.At(1));
39 // Ignoring overflow in the calculation below. 39 // Ignoring overflow in the calculation below.
40 intptr_t result = left.Value() - right.Value(); 40 intptr_t result = left.Value() - right.Value();
41 arguments.SetReturn(Smi::Handle(Smi::New(result))); 41 arguments.SetReturn(Smi::Handle(Smi::New(result)));
42 } 42 }
43 43
44 44
45 // A leaf runtime call for test purposes. 45 // A leaf runtime call for test purposes.
46 // Arg0: a smi. 46 // arg0: a smi.
47 // Arg1: a smi. 47 // arg1: a smi.
48 // returns a smi representing arg0 + arg1. 48 // returns a smi representing arg0 + arg1.
49 DEFINE_LEAF_RUNTIME_ENTRY(TestLeafSmiAdd, 2) { 49 DEFINE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd,
50 ASSERT(args.Count() == kTestLeafSmiAddRuntimeEntry.argument_count()); 50 RawObject* arg0, RawObject* arg1) {
51 // Ignoring overflow in the calculation below and using the internal 51 // Ignoring overflow in the calculation below and using the internal
52 // representation of Smi directly without using any handlized code. 52 // representation of Smi directly without using any handlized code.
53 intptr_t result = reinterpret_cast<intptr_t>(args.At(0)) + 53 intptr_t result = reinterpret_cast<intptr_t>(arg0) +
54 reinterpret_cast<intptr_t>(args.At(1)); 54 reinterpret_cast<intptr_t>(arg1);
55 return reinterpret_cast<RawObject*>(result); 55 return reinterpret_cast<RawObject*>(result);
56 } 56 }
57 END_LEAF_RUNTIME_ENTRY
57 58
58 } // namespace dart 59 } // namespace dart
OLDNEW
« no previous file with comments | « vm/runtime_entry_ia32.cc ('k') | vm/runtime_entry_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698