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

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

Issue 1392893003: In precompilation, finalize all classes eagerly. Use the stable class hierarchy for doing CHA based… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
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 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2766 return raw_ptr()->invocation_dispatcher_cache_; 2766 return raw_ptr()->invocation_dispatcher_cache_;
2767 } 2767 }
2768 2768
2769 2769
2770 void Class::set_invocation_dispatcher_cache(const Array& cache) const { 2770 void Class::set_invocation_dispatcher_cache(const Array& cache) const {
2771 StorePointer(&raw_ptr()->invocation_dispatcher_cache_, cache.raw()); 2771 StorePointer(&raw_ptr()->invocation_dispatcher_cache_, cache.raw());
2772 } 2772 }
2773 2773
2774 2774
2775 void Class::Finalize() const { 2775 void Class::Finalize() const {
2776 ASSERT(IsSignatureClass() || !Isolate::Current()->all_classes_finalized());
rmacnak 2015/10/14 16:38:48 Add note that signature classes may be added after
srdjan 2015/10/14 16:51:58 Done.
2776 ASSERT(!is_finalized()); 2777 ASSERT(!is_finalized());
2777 // Prefinalized classes have a VM internal representation and no Dart fields. 2778 // Prefinalized classes have a VM internal representation and no Dart fields.
2778 // Their instance size is precomputed and field offsets are known. 2779 // Their instance size is precomputed and field offsets are known.
2779 if (!is_prefinalized()) { 2780 if (!is_prefinalized()) {
2780 // Compute offsets of instance fields and instance size. 2781 // Compute offsets of instance fields and instance size.
2781 CalculateFieldOffsets(); 2782 CalculateFieldOffsets();
2782 } 2783 }
2783 set_is_finalized(); 2784 set_is_finalized();
2784 } 2785 }
2785 2786
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3030 const Array& param_values) const { 3031 const Array& param_values) const {
3031 const Function& eval_func = 3032 const Function& eval_func =
3032 Function::Handle(EvaluateHelper(*this, expr, param_names, true)); 3033 Function::Handle(EvaluateHelper(*this, expr, param_names, true));
3033 const Object& result = 3034 const Object& result =
3034 Object::Handle(DartEntry::InvokeFunction(eval_func, param_values)); 3035 Object::Handle(DartEntry::InvokeFunction(eval_func, param_values));
3035 return result.raw(); 3036 return result.raw();
3036 } 3037 }
3037 3038
3038 3039
3039 // Ensure that top level parsing of the class has been done. 3040 // Ensure that top level parsing of the class has been done.
3040 // TODO(24109): Migrate interface to Thread*.
3041 RawError* Class::EnsureIsFinalized(Thread* thread) const { 3041 RawError* Class::EnsureIsFinalized(Thread* thread) const {
3042 // Finalized classes have already been parsed. 3042 // Finalized classes have already been parsed.
3043 if (is_finalized()) { 3043 if (is_finalized()) {
3044 return Error::null(); 3044 return Error::null();
3045 } 3045 }
3046 ASSERT(thread != NULL); 3046 ASSERT(thread != NULL);
3047 const Error& error = Error::Handle( 3047 const Error& error = Error::Handle(
3048 thread->zone(), Compiler::CompileClass(*this)); 3048 thread->zone(), Compiler::CompileClass(*this));
3049 if (!error.IsNull()) { 3049 if (!error.IsNull()) {
3050 ASSERT(thread == Thread::Current()); 3050 ASSERT(thread == Thread::Current());
(...skipping 18514 matching lines...) Expand 10 before | Expand all | Expand 10 after
21565 return tag_label.ToCString(); 21565 return tag_label.ToCString();
21566 } 21566 }
21567 21567
21568 21568
21569 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21569 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21570 Instance::PrintJSONImpl(stream, ref); 21570 Instance::PrintJSONImpl(stream, ref);
21571 } 21571 }
21572 21572
21573 21573
21574 } // namespace dart 21574 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/precompiler.h » ('j') | runtime/vm/precompiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698