| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2776 const Object& result = | 2776 const Object& result = |
| 2777 Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array())); | 2777 Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array())); |
| 2778 EXPECT(Smi::Cast(result).Value() == kSmiTestValue); | 2778 EXPECT(Smi::Cast(result).Value() == kSmiTestValue); |
| 2779 } | 2779 } |
| 2780 | 2780 |
| 2781 | 2781 |
| 2782 #if defined(ARCH_IS_64_BIT) | 2782 #if defined(ARCH_IS_64_BIT) |
| 2783 // Test for Embedded Smi object in the instructions. | 2783 // Test for Embedded Smi object in the instructions. |
| 2784 TEST_CASE(EmbedSmiIn64BitCode) { | 2784 TEST_CASE(EmbedSmiIn64BitCode) { |
| 2785 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value); | 2785 extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value); |
| 2786 const intptr_t kSmiTestValue = 5L << 32; | 2786 const intptr_t kSmiTestValue = DART_INT64_C(5) << 32; |
| 2787 Assembler _assembler_; | 2787 Assembler _assembler_; |
| 2788 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue); | 2788 GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue); |
| 2789 const Function& function = | 2789 const Function& function = |
| 2790 Function::Handle(CreateFunction("Test_EmbedSmiIn64BitCode")); | 2790 Function::Handle(CreateFunction("Test_EmbedSmiIn64BitCode")); |
| 2791 const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_)); | 2791 const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_)); |
| 2792 function.AttachCode(code); | 2792 function.AttachCode(code); |
| 2793 const Object& result = | 2793 const Object& result = |
| 2794 Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array())); | 2794 Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array())); |
| 2795 EXPECT(Smi::Cast(result).Value() == kSmiTestValue); | 2795 EXPECT(Smi::Cast(result).Value() == kSmiTestValue); |
| 2796 } | 2796 } |
| (...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4785 String& test = String::Handle(); | 4785 String& test = String::Handle(); |
| 4786 String& result = String::Handle(); | 4786 String& result = String::Handle(); |
| 4787 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4787 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { |
| 4788 test = String::New(tests[i].in); | 4788 test = String::New(tests[i].in); |
| 4789 result = String::IdentifierPrettyName(test); | 4789 result = String::IdentifierPrettyName(test); |
| 4790 EXPECT_STREQ(tests[i].out, result.ToCString()); | 4790 EXPECT_STREQ(tests[i].out, result.ToCString()); |
| 4791 } | 4791 } |
| 4792 } | 4792 } |
| 4793 | 4793 |
| 4794 } // namespace dart | 4794 } // namespace dart |
| OLD | NEW |