OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 CHECK_EQ(ExternalReference::debug_break(isolate).address(), | 158 CHECK_EQ(ExternalReference::debug_break(isolate).address(), |
159 decoder.Decode(make_code(UNCLASSIFIED, 16))); | 159 decoder.Decode(make_code(UNCLASSIFIED, 16))); |
160 CHECK_EQ(ExternalReference::new_space_start(isolate).address(), | 160 CHECK_EQ(ExternalReference::new_space_start(isolate).address(), |
161 decoder.Decode(make_code(UNCLASSIFIED, 10))); | 161 decoder.Decode(make_code(UNCLASSIFIED, 10))); |
162 } | 162 } |
163 | 163 |
164 | 164 |
165 class FileByteSink : public SnapshotByteSink { | 165 class FileByteSink : public SnapshotByteSink { |
166 public: | 166 public: |
167 explicit FileByteSink(const char* snapshot_file) { | 167 explicit FileByteSink(const char* snapshot_file) { |
168 fp_ = OS::FOpen(snapshot_file, "wb"); | 168 fp_ = v8::base::OS::FOpen(snapshot_file, "wb"); |
169 file_name_ = snapshot_file; | 169 file_name_ = snapshot_file; |
170 if (fp_ == NULL) { | 170 if (fp_ == NULL) { |
171 PrintF("Unable to write to snapshot file \"%s\"\n", snapshot_file); | 171 PrintF("Unable to write to snapshot file \"%s\"\n", snapshot_file); |
172 exit(1); | 172 exit(1); |
173 } | 173 } |
174 } | 174 } |
175 virtual ~FileByteSink() { | 175 virtual ~FileByteSink() { |
176 if (fp_ != NULL) { | 176 if (fp_ != NULL) { |
177 fclose(fp_); | 177 fclose(fp_); |
178 } | 178 } |
(...skipping 25 matching lines...) Expand all Loading... |
204 int new_space_used, | 204 int new_space_used, |
205 int pointer_space_used, | 205 int pointer_space_used, |
206 int data_space_used, | 206 int data_space_used, |
207 int code_space_used, | 207 int code_space_used, |
208 int map_space_used, | 208 int map_space_used, |
209 int cell_space_used, | 209 int cell_space_used, |
210 int property_cell_space_used) { | 210 int property_cell_space_used) { |
211 int file_name_length = StrLength(file_name_) + 10; | 211 int file_name_length = StrLength(file_name_) + 10; |
212 Vector<char> name = Vector<char>::New(file_name_length + 1); | 212 Vector<char> name = Vector<char>::New(file_name_length + 1); |
213 SNPrintF(name, "%s.size", file_name_); | 213 SNPrintF(name, "%s.size", file_name_); |
214 FILE* fp = OS::FOpen(name.start(), "w"); | 214 FILE* fp = v8::base::OS::FOpen(name.start(), "w"); |
215 name.Dispose(); | 215 name.Dispose(); |
216 fprintf(fp, "new %d\n", new_space_used); | 216 fprintf(fp, "new %d\n", new_space_used); |
217 fprintf(fp, "pointer %d\n", pointer_space_used); | 217 fprintf(fp, "pointer %d\n", pointer_space_used); |
218 fprintf(fp, "data %d\n", data_space_used); | 218 fprintf(fp, "data %d\n", data_space_used); |
219 fprintf(fp, "code %d\n", code_space_used); | 219 fprintf(fp, "code %d\n", code_space_used); |
220 fprintf(fp, "map %d\n", map_space_used); | 220 fprintf(fp, "map %d\n", map_space_used); |
221 fprintf(fp, "cell %d\n", cell_space_used); | 221 fprintf(fp, "cell %d\n", cell_space_used); |
222 fprintf(fp, "property cell %d\n", property_cell_space_used); | 222 fprintf(fp, "property cell %d\n", property_cell_space_used); |
223 fclose(fp); | 223 fclose(fp); |
224 } | 224 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 //---------------------------------------------------------------------------- | 283 //---------------------------------------------------------------------------- |
284 // Tests that the heap can be deserialized. | 284 // Tests that the heap can be deserialized. |
285 | 285 |
286 | 286 |
287 static void ReserveSpaceForSnapshot(Deserializer* deserializer, | 287 static void ReserveSpaceForSnapshot(Deserializer* deserializer, |
288 const char* file_name) { | 288 const char* file_name) { |
289 int file_name_length = StrLength(file_name) + 10; | 289 int file_name_length = StrLength(file_name) + 10; |
290 Vector<char> name = Vector<char>::New(file_name_length + 1); | 290 Vector<char> name = Vector<char>::New(file_name_length + 1); |
291 SNPrintF(name, "%s.size", file_name); | 291 SNPrintF(name, "%s.size", file_name); |
292 FILE* fp = OS::FOpen(name.start(), "r"); | 292 FILE* fp = v8::base::OS::FOpen(name.start(), "r"); |
293 name.Dispose(); | 293 name.Dispose(); |
294 int new_size, pointer_size, data_size, code_size, map_size, cell_size, | 294 int new_size, pointer_size, data_size, code_size, map_size, cell_size, |
295 property_cell_size; | 295 property_cell_size; |
296 #ifdef _MSC_VER | 296 #ifdef _MSC_VER |
297 // Avoid warning about unsafe fscanf from MSVC. | 297 // Avoid warning about unsafe fscanf from MSVC. |
298 // Please note that this is only fine if %c and %s are not being used. | 298 // Please note that this is only fine if %c and %s are not being used. |
299 #define fscanf fscanf_s | 299 #define fscanf fscanf_s |
300 #endif | 300 #endif |
301 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size)); | 301 CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size)); |
302 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size)); | 302 CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size)); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 TEST(TestThatAlwaysFails) { | 654 TEST(TestThatAlwaysFails) { |
655 bool ArtificialFailure = false; | 655 bool ArtificialFailure = false; |
656 CHECK(ArtificialFailure); | 656 CHECK(ArtificialFailure); |
657 } | 657 } |
658 | 658 |
659 | 659 |
660 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 660 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
661 bool ArtificialFailure2 = false; | 661 bool ArtificialFailure2 = false; |
662 CHECK(ArtificialFailure2); | 662 CHECK(ArtificialFailure2); |
663 } | 663 } |
OLD | NEW |