| 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/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 intptr_t retval = 0; | 2334 intptr_t retval = 0; |
| 2335 #if defined(USING_SIMULATOR) | 2335 #if defined(USING_SIMULATOR) |
| 2336 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( | 2336 retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call( |
| 2337 static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0)); | 2337 static_cast<int32_t>(instructions.EntryPoint()), 0, 0, 0, 0)); |
| 2338 #else | 2338 #else |
| 2339 typedef intptr_t (*EmbedSmiCode)(); | 2339 typedef intptr_t (*EmbedSmiCode)(); |
| 2340 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())(); | 2340 retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())(); |
| 2341 #endif | 2341 #endif |
| 2342 EXPECT((retval >> kSmiTagShift) == kSmiTestValue); | 2342 EXPECT((retval >> kSmiTagShift) == kSmiTestValue); |
| 2343 } | 2343 } |
| 2344 #endif // ARCH_IS_64_BIT |
| 2344 | 2345 |
| 2345 | 2346 |
| 2346 TEST_CASE(ExceptionHandlers) { | 2347 TEST_CASE(ExceptionHandlers) { |
| 2347 const int kNumEntries = 4; | 2348 const int kNumEntries = 4; |
| 2348 // Add an exception handler table to the code. | 2349 // Add an exception handler table to the code. |
| 2349 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle(); | 2350 ExceptionHandlers& exception_handlers = ExceptionHandlers::Handle(); |
| 2350 exception_handlers ^= ExceptionHandlers::New(kNumEntries); | 2351 exception_handlers ^= ExceptionHandlers::New(kNumEntries); |
| 2351 exception_handlers.SetHandlerInfo(0, -1, 20); | 2352 exception_handlers.SetHandlerInfo(0, -1, 20); |
| 2352 exception_handlers.SetHandlerInfo(1, 0, 30); | 2353 exception_handlers.SetHandlerInfo(1, 0, 30); |
| 2353 exception_handlers.SetHandlerInfo(2, -1, 40); | 2354 exception_handlers.SetHandlerInfo(2, -1, 40); |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3196 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); | 3197 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); |
| 3197 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); | 3198 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); |
| 3198 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); | 3199 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); |
| 3199 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); | 3200 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); |
| 3200 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); | 3201 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); |
| 3201 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); | 3202 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); |
| 3202 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); | 3203 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); |
| 3203 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); | 3204 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); |
| 3204 } | 3205 } |
| 3205 | 3206 |
| 3206 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM | |
| 3207 | |
| 3208 } // namespace dart | 3207 } // namespace dart |
| OLD | NEW |