OLD | NEW |
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/symbols.h" | 8 #include "vm/symbols.h" |
9 #include "vm/verifier.h" | 9 #include "vm/verifier.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Ignoring overflow in the calculation below. | 42 // Ignoring overflow in the calculation below. |
43 intptr_t result = left.Value() - right.Value(); | 43 intptr_t result = left.Value() - right.Value(); |
44 arguments.SetReturn(Smi::Handle(Smi::New(result))); | 44 arguments.SetReturn(Smi::Handle(Smi::New(result))); |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 // A leaf runtime call for test purposes. | 48 // A leaf runtime call for test purposes. |
49 // arg0: a smi. | 49 // arg0: a smi. |
50 // arg1: a smi. | 50 // arg1: a smi. |
51 // returns a smi representing arg0 + arg1. | 51 // returns a smi representing arg0 + arg1. |
52 DEFINE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, | 52 DEFINE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, 2, |
53 RawObject* arg0, RawObject* arg1) { | 53 RawObject* arg0, RawObject* arg1) { |
54 // Ignoring overflow in the calculation below and using the internal | 54 // Ignoring overflow in the calculation below and using the internal |
55 // representation of Smi directly without using any handlized code. | 55 // representation of Smi directly without using any handlized code. |
56 intptr_t result = reinterpret_cast<intptr_t>(arg0) + | 56 intptr_t result = reinterpret_cast<intptr_t>(arg0) + |
57 reinterpret_cast<intptr_t>(arg1); | 57 reinterpret_cast<intptr_t>(arg1); |
58 return reinterpret_cast<RawObject*>(result); | 58 return reinterpret_cast<RawObject*>(result); |
59 } | 59 } |
60 END_LEAF_RUNTIME_ENTRY | 60 END_LEAF_RUNTIME_ENTRY |
61 | 61 |
62 } // namespace dart | 62 } // namespace dart |
OLD | NEW |