| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 5765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5776 Dart_Handle script_url = Dart_NewString("theScript"); | 5776 Dart_Handle script_url = Dart_NewString("theScript"); |
| 5777 source = Dart_NewString(kScriptChars); | 5777 source = Dart_NewString(kScriptChars); |
| 5778 Dart_Handle test_script = Dart_LoadScript(script_url, source); | 5778 Dart_Handle test_script = Dart_LoadScript(script_url, source); |
| 5779 EXPECT_VALID(test_script); | 5779 EXPECT_VALID(test_script); |
| 5780 | 5780 |
| 5781 // Make sure that we can compile all of the patched code. | 5781 // Make sure that we can compile all of the patched code. |
| 5782 result = Dart_CompileAll(); | 5782 result = Dart_CompileAll(); |
| 5783 EXPECT_VALID(result); | 5783 EXPECT_VALID(result); |
| 5784 | 5784 |
| 5785 result = Dart_Invoke(test_script, Dart_NewString("e1"), 0, NULL); | 5785 result = Dart_Invoke(test_script, Dart_NewString("e1"), 0, NULL); |
| 5786 EXPECT_ERROR(result, "External implementation missing"); | 5786 EXPECT_ERROR(result, "No such method: 'unpatched'"); |
| 5787 | 5787 |
| 5788 int64_t value = 0; | 5788 int64_t value = 0; |
| 5789 result = Dart_Invoke(test_script, Dart_NewString("m1"), 0, NULL); | 5789 result = Dart_Invoke(test_script, Dart_NewString("m1"), 0, NULL); |
| 5790 EXPECT_VALID(result); | 5790 EXPECT_VALID(result); |
| 5791 EXPECT(Dart_IsInteger(result)); | 5791 EXPECT(Dart_IsInteger(result)); |
| 5792 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); | 5792 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); |
| 5793 EXPECT_EQ(4, value); | 5793 EXPECT_EQ(4, value); |
| 5794 | 5794 |
| 5795 value = 0; | 5795 value = 0; |
| 5796 result = Dart_Invoke(test_script, Dart_NewString("m2"), 0, NULL); | 5796 result = Dart_Invoke(test_script, Dart_NewString("m2"), 0, NULL); |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7146 EXPECT(o2 == reinterpret_cast<void*>(&p2)); | 7146 EXPECT(o2 == reinterpret_cast<void*>(&p2)); |
| 7147 } | 7147 } |
| 7148 Dart_ExitScope(); | 7148 Dart_ExitScope(); |
| 7149 isolate->heap()->CollectGarbage(Heap::kOld); | 7149 isolate->heap()->CollectGarbage(Heap::kOld); |
| 7150 EXPECT_EQ(0, isolate->heap()->PeerCount()); | 7150 EXPECT_EQ(0, isolate->heap()->PeerCount()); |
| 7151 } | 7151 } |
| 7152 | 7152 |
| 7153 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 7153 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 7154 | 7154 |
| 7155 } // namespace dart | 7155 } // namespace dart |
| OLD | NEW |