OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "include/libplatform/libplatform.h" | 9 #include "include/libplatform/libplatform.h" |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 return fp; | 105 return fp; |
106 } | 106 } |
107 | 107 |
108 FILE* fp_; | 108 FILE* fp_; |
109 FILE* startup_blob_file_; | 109 FILE* startup_blob_file_; |
110 }; | 110 }; |
111 | 111 |
112 char* GetExtraCode(char* filename, const char* description) { | 112 char* GetExtraCode(char* filename, const char* description) { |
113 if (filename == NULL || strlen(filename) == 0) return NULL; | 113 if (filename == NULL || strlen(filename) == 0) return NULL; |
114 if (strcmp(filename, "-") == 0) return NULL; | |
115 ::printf("Loading script for %s: %s\n", description, filename); | 114 ::printf("Loading script for %s: %s\n", description, filename); |
116 FILE* file = base::OS::FOpen(filename, "rb"); | 115 FILE* file = base::OS::FOpen(filename, "rb"); |
117 if (file == NULL) { | 116 if (file == NULL) { |
118 fprintf(stderr, "Failed to open '%s': errno %d\n", filename, errno); | 117 fprintf(stderr, "Failed to open '%s': errno %d\n", filename, errno); |
119 exit(1); | 118 exit(1); |
120 } | 119 } |
121 fseek(file, 0, SEEK_END); | 120 fseek(file, 0, SEEK_END); |
122 size_t size = ftell(file); | 121 size_t size = ftell(file); |
123 rewind(file); | 122 rewind(file); |
124 char* chars = new char[size + 1]; | 123 char* chars = new char[size + 1]; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 CHECK(blob.data); | 176 CHECK(blob.data); |
178 writer.WriteSnapshot(blob); | 177 writer.WriteSnapshot(blob); |
179 delete[] blob.data; | 178 delete[] blob.data; |
180 } | 179 } |
181 | 180 |
182 V8::Dispose(); | 181 V8::Dispose(); |
183 V8::ShutdownPlatform(); | 182 V8::ShutdownPlatform(); |
184 delete platform; | 183 delete platform; |
185 return 0; | 184 return 0; |
186 } | 185 } |
OLD | NEW |