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

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

Issue 1151523002: VM-internalize the default Map implementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Ready for review. Created 5 years, 7 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
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 "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4445 matching lines...) Expand 10 before | Expand all | Expand 10 after
4456 elideSubstring("_GrowableList@", buffer, buffer); 4456 elideSubstring("_GrowableList@", buffer, buffer);
4457 EXPECT_STREQ( 4457 EXPECT_STREQ(
4458 "{\"type\":\"@List\",\"_vmType\":\"@GrowableObjectArray\"," 4458 "{\"type\":\"@List\",\"_vmType\":\"@GrowableObjectArray\","
4459 "\"class\":{\"type\":\"@Class\",\"id\":\"\",\"name\":\"_GrowableList\"," 4459 "\"class\":{\"type\":\"@Class\",\"id\":\"\",\"name\":\"_GrowableList\","
4460 "\"_vmName\":\"\"},\"id\":\"\",\"length\":0}", 4460 "\"_vmName\":\"\"},\"id\":\"\",\"length\":0}",
4461 buffer); 4461 buffer);
4462 } 4462 }
4463 // LinkedHashMap reference 4463 // LinkedHashMap reference
4464 { 4464 {
4465 JSONStream js; 4465 JSONStream js;
4466 const LinkedHashMap& array = LinkedHashMap::Handle(LinkedHashMap::New()); 4466 const LinkedHashMap& array =
4467 LinkedHashMap::Handle(LinkedHashMap::NewDefault());
4467 array.PrintJSON(&js, true); 4468 array.PrintJSON(&js, true);
4468 elideSubstring("classes", js.ToCString(), buffer); 4469 elideSubstring("classes", js.ToCString(), buffer);
4469 elideSubstring("objects", buffer, buffer); 4470 elideSubstring("objects", buffer, buffer);
4470 elideSubstring("_InternalLinkedHashMap@", buffer, buffer); 4471 elideSubstring("_InternalLinkedHashMap@", buffer, buffer);
4471 EXPECT_STREQ( 4472 EXPECT_STREQ(
4472 "{\"type\":\"@Instance\",\"_vmType\":\"@LinkedHashMap\"," 4473 "{\"type\":\"@Instance\",\"_vmType\":\"@LinkedHashMap\","
4473 "\"class\":{\"type\":\"@Class\",\"id\":\"\"," 4474 "\"class\":{\"type\":\"@Class\",\"id\":\"\","
4474 "\"name\":\"_InternalLinkedHashMap\",\"_vmName\":\"\"},\"id\":\"\"}", 4475 "\"name\":\"_InternalLinkedHashMap\",\"_vmName\":\"\"},\"id\":\"\"}",
4475 buffer); 4476 buffer);
4476 } 4477 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
4593 EXPECT_VALID(h_result); 4594 EXPECT_VALID(h_result);
4594 Integer& result = Integer::Handle(); 4595 Integer& result = Integer::Handle();
4595 result ^= Api::UnwrapHandle(h_result); 4596 result ^= Api::UnwrapHandle(h_result);
4596 String& foo = String::Handle(String::New("foo")); 4597 String& foo = String::Handle(String::New("foo"));
4597 Integer& expected = Integer::Handle(); 4598 Integer& expected = Integer::Handle();
4598 expected ^= foo.HashCode(); 4599 expected ^= foo.HashCode();
4599 EXPECT(result.IsIdenticalTo(expected)); 4600 EXPECT(result.IsIdenticalTo(expected));
4600 } 4601 }
4601 4602
4602 } // namespace dart 4603 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698