| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """Command line wrapper to run the frog compiler under the Dart VM""" | 6 """Command line wrapper to run the frog compiler under the Dart VM""" |
| 7 | 7 |
| 8 # TODO(jimhug): This is a temporary hack to enable running on the VM. We need | 8 # TODO(jimhug): This is a temporary hack to enable running on the VM. We need |
| 9 # the ability to get command-line arguments, to return exit codes, and to | 9 # the ability to get command-line arguments, to return exit codes, and to |
| 10 # communicate with spawned processes in the VM for this to go away. | 10 # communicate with spawned processes in the VM for this to go away. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 browser = 'Open' | 180 browser = 'Open' |
| 181 else: | 181 else: |
| 182 # TODO(vsm): This is only available on Goobuntu. | 182 # TODO(vsm): This is only available on Goobuntu. |
| 183 browser = 'google-chrome' | 183 browser = 'google-chrome' |
| 184 | 184 |
| 185 args = ['--libdir=%s/lib' % HOME] + args | 185 args = ['--libdir=%s/lib' % HOME] + args |
| 186 | 186 |
| 187 compiler_cmd = [dart] | 187 compiler_cmd = [dart] |
| 188 if options.vm_flags: | 188 if options.vm_flags: |
| 189 compiler_cmd.extend(options.vm_flags.split(' ')) | 189 compiler_cmd.extend(options.vm_flags.split(' ')) |
| 190 compiler_cmd.append('--new_gen_heap_size=64'); | |
| 191 compiler_cmd.append(join(HOME, 'frogc.dart')) | 190 compiler_cmd.append(join(HOME, 'frogc.dart')) |
| 192 compiler_cmd.extend(args) | 191 compiler_cmd.extend(args) |
| 193 exit_code = execute(compiler_cmd) | 192 exit_code = execute(compiler_cmd) |
| 194 if exit_code: | 193 if exit_code: |
| 195 if options.verbose: print ("cmd exited with status %d" % exit_code) | 194 if options.verbose: print ("cmd exited with status %d" % exit_code) |
| 196 if cleanup: shutil.rmtree(workdir) | 195 if cleanup: shutil.rmtree(workdir) |
| 197 if exit_code < 0: | 196 if exit_code < 0: |
| 198 print("VM exited with signal %d" % (-exit_code)) | 197 print("VM exited with signal %d" % (-exit_code)) |
| 199 # TODO(ahe): Using 253 to signal a crash to test.dart. | 198 # TODO(ahe): Using 253 to signal a crash to test.dart. |
| 200 return 253 | 199 return 253 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 215 else: | 214 else: |
| 216 print 'Compilation succeded. Code generated in: %s' % outfile | 215 print 'Compilation succeded. Code generated in: %s' % outfile |
| 217 | 216 |
| 218 if cleanup: shutil.rmtree(workdir) | 217 if cleanup: shutil.rmtree(workdir) |
| 219 if result != 0: | 218 if result != 0: |
| 220 return 1 | 219 return 1 |
| 221 return 0 | 220 return 0 |
| 222 | 221 |
| 223 if __name__ == '__main__': | 222 if __name__ == '__main__': |
| 224 sys.exit(main(sys.argv)) | 223 sys.exit(main(sys.argv)) |
| OLD | NEW |