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

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

Issue 1322043002: More elimination of new space allocation, fix bugs in Symbols::FromConcatAll (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: synced Created 5 years, 3 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/object.h ('k') | runtime/vm/parser.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 "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 return name.Hash(); 2096 return name.Hash();
2097 } 2097 }
2098 }; 2098 };
2099 typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet; 2099 typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet;
2100 2100
2101 2101
2102 void Class::SetFunctions(const Array& value) const { 2102 void Class::SetFunctions(const Array& value) const {
2103 ASSERT(!value.IsNull()); 2103 ASSERT(!value.IsNull());
2104 StorePointer(&raw_ptr()->functions_, value.raw()); 2104 StorePointer(&raw_ptr()->functions_, value.raw());
2105 const intptr_t len = value.Length(); 2105 const intptr_t len = value.Length();
2106 ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len)); 2106 ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len, Heap::kOld));
2107 if (len >= kFunctionLookupHashTreshold) { 2107 if (len >= kFunctionLookupHashTreshold) {
2108 Function& func = Function::Handle(); 2108 Function& func = Function::Handle();
2109 for (intptr_t i = 0; i < len; ++i) { 2109 for (intptr_t i = 0; i < len; ++i) {
2110 func ^= value.At(i); 2110 func ^= value.At(i);
2111 // Verify that all the functions in the array have this class as owner. 2111 // Verify that all the functions in the array have this class as owner.
2112 ASSERT(func.Owner() == raw()); 2112 ASSERT(func.Owner() == raw());
2113 set.Insert(func); 2113 set.Insert(func);
2114 } 2114 }
2115 } 2115 }
2116 StorePointer(&raw_ptr()->functions_hash_table_, set.Release().raw()); 2116 StorePointer(&raw_ptr()->functions_hash_table_, set.Release().raw());
(...skipping 19373 matching lines...) Expand 10 before | Expand all | Expand 10 after
21490 return tag_label.ToCString(); 21490 return tag_label.ToCString();
21491 } 21491 }
21492 21492
21493 21493
21494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21495 Instance::PrintJSONImpl(stream, ref); 21495 Instance::PrintJSONImpl(stream, ref);
21496 } 21496 }
21497 21497
21498 21498
21499 } // namespace dart 21499 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698