Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Side by Side Diff: runtime/vm/snapshot_test.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/service_test.cc ('k') | runtime/vm/stub_code_arm64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 " static ms6() {\n" 936 " static ms6() {\n"
937 " return '\\t \\n \\x00 \\xFF';\n" 937 " return '\\t \\n \\x00 \\xFF';\n"
938 " }\n" 938 " }\n"
939 "}\n"; 939 "}\n";
940 940
941 String& url = String::Handle(String::New("dart-test:SerializeScript")); 941 String& url = String::Handle(String::New("dart-test:SerializeScript"));
942 String& source = String::Handle(String::New(kScriptChars)); 942 String& source = String::Handle(String::New(kScriptChars));
943 Script& script = Script::Handle(Script::New(url, 943 Script& script = Script::Handle(Script::New(url,
944 source, 944 source,
945 RawScript::kScriptTag)); 945 RawScript::kScriptTag));
946 const String& lib_url = String::Handle(Symbols::New("TestLib")); 946 const String& lib_url = String::Handle(Symbols::New(thread, "TestLib"));
947 Library& lib = Library::Handle(Library::New(lib_url)); 947 Library& lib = Library::Handle(Library::New(lib_url));
948 lib.Register(); 948 lib.Register();
949 EXPECT(CompilerTest::TestCompileScript(lib, script)); 949 EXPECT(CompilerTest::TestCompileScript(lib, script));
950 950
951 // Write snapshot with script content. 951 // Write snapshot with script content.
952 uint8_t* buffer; 952 uint8_t* buffer;
953 TestSnapshotWriter writer(&buffer, &malloc_allocator); 953 TestSnapshotWriter writer(&buffer, &malloc_allocator);
954 writer.WriteScript(script); 954 writer.WriteScript(script);
955 955
956 // Read object back from the snapshot. 956 // Read object back from the snapshot.
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 StackZone zone(Thread::Current()); 3009 StackZone zone(Thread::Current());
3010 uint8_t* buffer; 3010 uint8_t* buffer;
3011 MessageWriter writer(&buffer, &zone_allocator, true); 3011 MessageWriter writer(&buffer, &zone_allocator, true);
3012 writer.WriteInlinedObjectHeader(kOmittedObjectId); 3012 writer.WriteInlinedObjectHeader(kOmittedObjectId);
3013 // For performance, we'd like single-byte headers when ids are omitted. 3013 // For performance, we'd like single-byte headers when ids are omitted.
3014 // If this starts failing, consider renumbering the snapshot ids. 3014 // If this starts failing, consider renumbering the snapshot ids.
3015 EXPECT_EQ(1, writer.BytesWritten()); 3015 EXPECT_EQ(1, writer.BytesWritten());
3016 } 3016 }
3017 3017
3018 } // namespace dart 3018 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service_test.cc ('k') | runtime/vm/stub_code_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698