| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 DECLARE_RUNTIME_ENTRY(TestSmiSub) |
| 14 DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*) |
| 15 |
| 16 |
| 13 // Add function to a class and that class to the class dictionary so that | 17 // Add function to a class and that class to the class dictionary so that |
| 14 // frame walking can be used. | 18 // frame walking can be used. |
| 15 const Function& RegisterFakeFunction(const char* name, const Code& code) { | 19 const Function& RegisterFakeFunction(const char* name, const Code& code) { |
| 16 const String& class_name = String::Handle(Symbols::New("ownerClass")); | 20 const String& class_name = String::Handle(Symbols::New("ownerClass")); |
| 17 const Script& script = Script::Handle(); | 21 const Script& script = Script::Handle(); |
| 18 const Class& owner_class = | 22 const Class& owner_class = |
| 19 Class::Handle(Class::New(class_name, script, Scanner::kNoSourcePos)); | 23 Class::Handle(Class::New(class_name, script, Scanner::kNoSourcePos)); |
| 20 const String& function_name = String::ZoneHandle(Symbols::New(name)); | 24 const String& function_name = String::ZoneHandle(Symbols::New(name)); |
| 21 const Function& function = Function::ZoneHandle( | 25 const Function& function = Function::ZoneHandle( |
| 22 Function::New(function_name, RawFunction::kRegularFunction, | 26 Function::New(function_name, RawFunction::kRegularFunction, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 RawObject* arg0, RawObject* arg1) { | 56 RawObject* arg0, RawObject* arg1) { |
| 53 // Ignoring overflow in the calculation below and using the internal | 57 // Ignoring overflow in the calculation below and using the internal |
| 54 // representation of Smi directly without using any handlized code. | 58 // representation of Smi directly without using any handlized code. |
| 55 intptr_t result = reinterpret_cast<intptr_t>(arg0) + | 59 intptr_t result = reinterpret_cast<intptr_t>(arg0) + |
| 56 reinterpret_cast<intptr_t>(arg1); | 60 reinterpret_cast<intptr_t>(arg1); |
| 57 return reinterpret_cast<RawObject*>(result); | 61 return reinterpret_cast<RawObject*>(result); |
| 58 } | 62 } |
| 59 END_LEAF_RUNTIME_ENTRY | 63 END_LEAF_RUNTIME_ENTRY |
| 60 | 64 |
| 61 } // namespace dart | 65 } // namespace dart |
| OLD | NEW |