| 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 "vm/unit_test.h" | 5 #include "vm/unit_test.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 sourcefiles, kernel_pgm, incrementally); | 184 sourcefiles, kernel_pgm, incrementally); |
| 185 } | 185 } |
| 186 | 186 |
| 187 char* TestCase::CompileTestScriptWithDFE(const char* url, | 187 char* TestCase::CompileTestScriptWithDFE(const char* url, |
| 188 int sourcefiles_count, | 188 int sourcefiles_count, |
| 189 Dart_SourceFile sourcefiles[], | 189 Dart_SourceFile sourcefiles[], |
| 190 void** kernel_pgm, | 190 void** kernel_pgm, |
| 191 bool incrementally) { | 191 bool incrementally) { |
| 192 Zone* zone = Thread::Current()->zone(); | 192 Zone* zone = Thread::Current()->zone(); |
| 193 Dart_KernelCompilationResult compilation_result = Dart_CompileSourcesToKernel( | 193 Dart_KernelCompilationResult compilation_result = Dart_CompileSourcesToKernel( |
| 194 url, sourcefiles_count, sourcefiles, incrementally); | 194 url, NULL /* platform binary can be found at the default location */, |
| 195 sourcefiles_count, sourcefiles, incrementally); |
| 195 | 196 |
| 196 if (compilation_result.status != Dart_KernelCompilationStatus_Ok) { | 197 if (compilation_result.status != Dart_KernelCompilationStatus_Ok) { |
| 197 return OS::SCreate(zone, "Compilation failed %s", compilation_result.error); | 198 return OS::SCreate(zone, "Compilation failed %s", compilation_result.error); |
| 198 } | 199 } |
| 199 const uint8_t* kernel_file = compilation_result.kernel; | 200 const uint8_t* kernel_file = compilation_result.kernel; |
| 200 intptr_t kernel_length = compilation_result.kernel_size; | 201 intptr_t kernel_length = compilation_result.kernel_size; |
| 201 if (kernel_file == NULL) { | 202 if (kernel_file == NULL) { |
| 202 return OS::SCreate(zone, "front end generated a NULL kernel file"); | 203 return OS::SCreate(zone, "front end generated a NULL kernel file"); |
| 203 } | 204 } |
| 204 *kernel_pgm = Dart_ReadKernelBinary(kernel_file, kernel_length); | 205 *kernel_pgm = Dart_ReadKernelBinary(kernel_file, kernel_length); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 pos = strstr(in, prefix); | 623 pos = strstr(in, prefix); |
| 623 } | 624 } |
| 624 // Copy the remainder of in to out. | 625 // Copy the remainder of in to out. |
| 625 while (*in != '\0') { | 626 while (*in != '\0') { |
| 626 *out++ = *in++; | 627 *out++ = *in++; |
| 627 } | 628 } |
| 628 *out = '\0'; | 629 *out = '\0'; |
| 629 } | 630 } |
| 630 | 631 |
| 631 } // namespace dart | 632 } // namespace dart |
| OLD | NEW |