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 <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 | 8 |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 test = test->next_; | 46 test = test->next_; |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 Dart_Handle TestCase::LoadTestScript(const char* script, | 51 Dart_Handle TestCase::LoadTestScript(const char* script, |
52 Dart_NativeEntryResolver resolver) { | 52 Dart_NativeEntryResolver resolver) { |
53 Dart_Handle url = Dart_NewString(TestCase::url()); | 53 Dart_Handle url = Dart_NewString(TestCase::url()); |
54 Dart_Handle source = Dart_NewString(script); | 54 Dart_Handle source = Dart_NewString(script); |
55 Dart_Handle lib = Dart_LoadScript(url, source, NULL); | 55 Dart_Handle lib = Dart_LoadScript(url, source, NULL); |
56 ASSERT(!Dart_IsError(lib)); | 56 DART_CHECK_VALID(lib); |
57 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); | 57 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); |
58 ASSERT(!Dart_IsError(result)); | 58 DART_CHECK_VALID(result); |
59 return lib; | 59 return lib; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 Dart_Handle TestCase::lib() { | 63 Dart_Handle TestCase::lib() { |
64 Dart_Handle url = Dart_NewString(TestCase::url()); | 64 Dart_Handle url = Dart_NewString(TestCase::url()); |
65 Dart_Handle lib = Dart_LookupLibrary(url); | 65 Dart_Handle lib = Dart_LookupLibrary(url); |
66 ASSERT(!Dart_IsError(lib)); | 66 DART_CHECK_VALID(lib); |
67 ASSERT(Dart_IsLibrary(lib)); | 67 ASSERT(Dart_IsLibrary(lib)); |
68 return lib; | 68 return lib; |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 uword AssemblerTest::Assemble() { | 72 uword AssemblerTest::Assemble() { |
73 const Code& code = Code::Handle(Code::FinalizeCode(name_, assembler_)); | 73 const Code& code = Code::Handle(Code::FinalizeCode(name_, assembler_)); |
74 if (FLAG_disassemble) { | 74 if (FLAG_disassemble) { |
75 OS::Print("Code for test '%s' {\n", name_); | 75 OS::Print("Code for test '%s' {\n", name_); |
76 const Instructions& instructions = | 76 const Instructions& instructions = |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 Compiler::CompileFunction(function); | 175 Compiler::CompileFunction(function); |
176 retval = true; | 176 retval = true; |
177 } else { | 177 } else { |
178 retval = false; | 178 retval = false; |
179 } | 179 } |
180 isolate->set_long_jump_base(base); | 180 isolate->set_long_jump_base(base); |
181 return retval; | 181 return retval; |
182 } | 182 } |
183 | 183 |
184 } // namespace dart | 184 } // namespace dart |
OLD | NEW |