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

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

Issue 2949803002: New growth strategy for growable arrays (Closed)
Patch Set: Branch-free grow size computation. Renamed function names to be clearer. Created 3 years, 6 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/clustered_snapshot.cc ('k') | runtime/vm/dart_api_impl.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/code_descriptors.h" 5 #include "vm/code_descriptors.h"
6 6
7 #include "vm/log.h" 7 #include "vm/log.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return true; 66 return true;
67 } 67 }
68 68
69 69
70 RawArray* StackMapTableBuilder::FinalizeStackMaps(const Code& code) { 70 RawArray* StackMapTableBuilder::FinalizeStackMaps(const Code& code) {
71 ASSERT(Verify()); 71 ASSERT(Verify());
72 intptr_t num_entries = Length(); 72 intptr_t num_entries = Length();
73 if (num_entries == 0) { 73 if (num_entries == 0) {
74 return Object::empty_array().raw(); 74 return Object::empty_array().raw();
75 } 75 }
76 return Array::MakeArray(list_); 76 return Array::MakeFixedLength(list_);
77 } 77 }
78 78
79 79
80 RawStackMap* StackMapTableBuilder::MapAt(intptr_t index) const { 80 RawStackMap* StackMapTableBuilder::MapAt(intptr_t index) const {
81 StackMap& map = StackMap::Handle(); 81 StackMap& map = StackMap::Handle();
82 map ^= list_.At(index); 82 map ^= list_.At(index);
83 return map.raw(); 83 return map.raw();
84 } 84 }
85 85
86 86
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 399 }
400 inlined_functions_.Add(function, Heap::kOld); 400 inlined_functions_.Add(function, Heap::kOld);
401 return inlined_functions_.Length() - 1; 401 return inlined_functions_.Length() - 1;
402 } 402 }
403 403
404 404
405 RawArray* CodeSourceMapBuilder::InliningIdToFunction() { 405 RawArray* CodeSourceMapBuilder::InliningIdToFunction() {
406 if (inlined_functions_.Length() == 0) { 406 if (inlined_functions_.Length() == 0) {
407 return Object::empty_array().raw(); 407 return Object::empty_array().raw();
408 } 408 }
409 return Array::MakeArray(inlined_functions_); 409 return Array::MakeFixedLength(inlined_functions_);
410 } 410 }
411 411
412 412
413 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() { 413 RawCodeSourceMap* CodeSourceMapBuilder::Finalize() {
414 if (!stack_traces_only_) { 414 if (!stack_traces_only_) {
415 FlushBuffer(); 415 FlushBuffer();
416 } 416 }
417 intptr_t length = stream_.bytes_written(); 417 intptr_t length = stream_.bytes_written();
418 const CodeSourceMap& map = CodeSourceMap::Handle(CodeSourceMap::New(length)); 418 const CodeSourceMap& map = CodeSourceMap::Handle(CodeSourceMap::New(length));
419 NoSafepointScope no_safepoint; 419 NoSafepointScope no_safepoint;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 break; 648 break;
649 } 649 }
650 default: 650 default:
651 UNREACHABLE(); 651 UNREACHABLE();
652 } 652 }
653 } 653 }
654 THR_Print("}\n"); 654 THR_Print("}\n");
655 } 655 }
656 656
657 } // namespace dart 657 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698