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 "platform/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "include/dart_tools_api.h" | 7 #include "include/dart_tools_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 for (intptr_t i = 0; i < lib_scripts.Length(); i++) { | 1112 for (intptr_t i = 0; i < lib_scripts.Length(); i++) { |
1113 script ^= lib_scripts.At(i); | 1113 script ^= lib_scripts.At(i); |
1114 EXPECT(!script.IsNull()); | 1114 EXPECT(!script.IsNull()); |
1115 uri = script.url(); | 1115 uri = script.url(); |
1116 OS::Print("Generating source for part: %s\n", uri.ToCString()); | 1116 OS::Print("Generating source for part: %s\n", uri.ToCString()); |
1117 GenerateSourceAndCheck(script); | 1117 GenerateSourceAndCheck(script); |
1118 } | 1118 } |
1119 } | 1119 } |
1120 | 1120 |
1121 TEST_CASE(GenerateSource) { | 1121 TEST_CASE(GenerateSource) { |
1122 Isolate* isolate = Isolate::Current(); | 1122 Zone* zone = thread->zone(); |
| 1123 Isolate* isolate = thread->isolate(); |
1123 const GrowableObjectArray& libs = GrowableObjectArray::Handle( | 1124 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
1124 isolate, isolate->object_store()->libraries()); | 1125 zone, isolate->object_store()->libraries()); |
1125 Library& lib = Library::Handle(); | 1126 Library& lib = Library::Handle(); |
1126 String& uri = String::Handle(); | 1127 String& uri = String::Handle(); |
1127 for (intptr_t i = 0; i < libs.Length(); i++) { | 1128 for (intptr_t i = 0; i < libs.Length(); i++) { |
1128 lib ^= libs.At(i); | 1129 lib ^= libs.At(i); |
1129 EXPECT(!lib.IsNull()); | 1130 EXPECT(!lib.IsNull()); |
1130 uri = lib.url(); | 1131 uri = lib.url(); |
1131 OS::Print("Generating source for library: %s\n", uri.ToCString()); | 1132 OS::Print("Generating source for library: %s\n", uri.ToCString()); |
1132 IterateScripts(lib); | 1133 IterateScripts(lib); |
1133 } | 1134 } |
1134 } | 1135 } |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 StackZone zone(Thread::Current()); | 2996 StackZone zone(Thread::Current()); |
2996 uint8_t* buffer; | 2997 uint8_t* buffer; |
2997 MessageWriter writer(&buffer, &zone_allocator, true); | 2998 MessageWriter writer(&buffer, &zone_allocator, true); |
2998 writer.WriteInlinedObjectHeader(kOmittedObjectId); | 2999 writer.WriteInlinedObjectHeader(kOmittedObjectId); |
2999 // For performance, we'd like single-byte headers when ids are omitted. | 3000 // For performance, we'd like single-byte headers when ids are omitted. |
3000 // If this starts failing, consider renumbering the snapshot ids. | 3001 // If this starts failing, consider renumbering the snapshot ids. |
3001 EXPECT_EQ(1, writer.BytesWritten()); | 3002 EXPECT_EQ(1, writer.BytesWritten()); |
3002 } | 3003 } |
3003 | 3004 |
3004 } // namespace dart | 3005 } // namespace dart |
OLD | NEW |