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

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

Issue 1368173002: Do not eagerly finalize when optimizing. Remove allocation of temporary strings in new space. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: "Cleanup" Created 5 years, 2 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 | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 instantiated_bound.Equals(declared_bound))) { 838 instantiated_bound.Equals(declared_bound))) {
839 // If type_arg is a type parameter, its declared bound may not be 839 // If type_arg is a type parameter, its declared bound may not be
840 // resolved yet. 840 // resolved yet.
841 if (type_arg.IsTypeParameter()) { 841 if (type_arg.IsTypeParameter()) {
842 const Class& type_arg_cls = Class::Handle( 842 const Class& type_arg_cls = Class::Handle(
843 TypeParameter::Cast(type_arg).parameterized_class()); 843 TypeParameter::Cast(type_arg).parameterized_class());
844 const AbstractType& bound = AbstractType::Handle( 844 const AbstractType& bound = AbstractType::Handle(
845 TypeParameter::Cast(type_arg).bound()); 845 TypeParameter::Cast(type_arg).bound());
846 ResolveType(type_arg_cls, bound); 846 ResolveType(type_arg_cls, bound);
847 } 847 }
848 if (!type_param.CheckBound(type_arg, instantiated_bound, &error) && 848 // This may be called only if type needs to be finalized, therefore
849 error.IsNull()) { 849 // seems OK to allocate temporary type in old space.
regis 2015/09/25 20:55:23 The comment is hard to read. I am not sure what is
srdjan 2015/09/25 21:15:59 Done.
850 if (!type_param.CheckBound(type_arg, instantiated_bound,
851 &error, Heap::kOld) && error.IsNull()) {
850 // The bound cannot be checked at compile time; postpone to run time. 852 // The bound cannot be checked at compile time; postpone to run time.
851 type_arg = BoundedType::New(type_arg, instantiated_bound, type_param); 853 type_arg = BoundedType::New(type_arg, instantiated_bound, type_param);
852 arguments.SetTypeAt(offset + i, type_arg); 854 arguments.SetTypeAt(offset + i, type_arg);
853 } 855 }
854 } 856 }
855 if (!error.IsNull() && bound_error->IsNull()) { 857 if (!error.IsNull() && bound_error->IsNull()) {
856 *bound_error = error.raw(); 858 *bound_error = error.raw();
857 } 859 }
858 } 860 }
859 } 861 }
(...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after
3218 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); 3220 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
3219 field ^= fields_array.At(0); 3221 field ^= fields_array.At(0);
3220 ASSERT(field.Offset() == ByteBuffer::data_offset()); 3222 ASSERT(field.Offset() == ByteBuffer::data_offset());
3221 name ^= field.name(); 3223 name ^= field.name();
3222 expected_name ^= String::New("_data"); 3224 expected_name ^= String::New("_data");
3223 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3225 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3224 #endif 3226 #endif
3225 } 3227 }
3226 3228
3227 } // namespace dart 3229 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698