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

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

Issue 203523011: Introduce a lazy-compile stub for functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased & added MIPS code Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/runtime_entry_test.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/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/class_table.h" 7 #include "vm/class_table.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/freelist.h" 9 #include "vm/freelist.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 case kTypeArgumentsCid: { 130 case kTypeArgumentsCid: {
131 const RawTypeArguments* raw_array = 131 const RawTypeArguments* raw_array =
132 reinterpret_cast<const RawTypeArguments*>(this); 132 reinterpret_cast<const RawTypeArguments*>(this);
133 intptr_t array_length = Smi::Value(raw_array->ptr()->length_); 133 intptr_t array_length = Smi::Value(raw_array->ptr()->length_);
134 instance_size = TypeArguments::InstanceSize(array_length); 134 instance_size = TypeArguments::InstanceSize(array_length);
135 break; 135 break;
136 } 136 }
137 case kPcDescriptorsCid: { 137 case kPcDescriptorsCid: {
138 const RawPcDescriptors* raw_descriptors = 138 const RawPcDescriptors* raw_descriptors =
139 reinterpret_cast<const RawPcDescriptors*>(this); 139 reinterpret_cast<const RawPcDescriptors*>(this);
140 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); 140 intptr_t num_descriptors = raw_descriptors->ptr()->length_;
141 instance_size = PcDescriptors::InstanceSize(num_descriptors); 141 instance_size = PcDescriptors::InstanceSize(num_descriptors);
142 break; 142 break;
143 } 143 }
144 case kStackmapCid: { 144 case kStackmapCid: {
145 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this); 145 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this);
146 intptr_t length = map->ptr()->length_; 146 intptr_t length = map->ptr()->length_;
147 instance_size = Stackmap::InstanceSize(length); 147 instance_size = Stackmap::InstanceSize(length);
148 break; 148 break;
149 } 149 }
150 case kLocalVarDescriptorsCid: { 150 case kLocalVarDescriptorsCid: {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // be able to reuse the handle based code and avoid having to add 366 // be able to reuse the handle based code and avoid having to add
367 // helper functions to the raw object interface. 367 // helper functions to the raw object interface.
368 Function fn; 368 Function fn;
369 fn = raw_fun; 369 fn = raw_fun;
370 370
371 Code code; 371 Code code;
372 code = fn.CurrentCode(); 372 code = fn.CurrentCode();
373 373
374 if (!code.IsNull() && // The function may not have code. 374 if (!code.IsNull() && // The function may not have code.
375 !code.is_optimized() && 375 !code.is_optimized() &&
376 (fn.CurrentCode() == fn.unoptimized_code()) && 376 (fn.CurrentCode() == fn.unoptimized_code()) &&
zra 2014/03/21 14:44:31 I think you also need to modify this logic, otherw
Florian Schneider 2014/03/21 15:13:58 Yes, thanks. This also means that collection of cl
377 !code.HasBreakpoint() && 377 !code.HasBreakpoint() &&
378 (fn.usage_counter() >= 0)) { 378 (fn.usage_counter() >= 0)) {
379 fn.set_usage_counter(fn.usage_counter() / 2); 379 fn.set_usage_counter(fn.usage_counter() / 2);
380 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) { 380 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) {
381 return true; 381 return true;
382 } 382 }
383 } 383 }
384 return false; 384 return false;
385 } 385 }
386 386
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 if ((pc >= start_pc) && (pc < end_pc)) { 488 if ((pc >= start_pc) && (pc < end_pc)) {
489 return true; 489 return true;
490 } 490 }
491 } 491 }
492 return false; 492 return false;
493 } 493 }
494 494
495 495
496 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( 496 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers(
497 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 497 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
498 RawPcDescriptors* obj = raw_obj->ptr(); 498 return PcDescriptors::InstanceSize(raw_obj->ptr()->length_);
499 intptr_t length = Smi::Value(obj->length_);
500 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_));
501 return PcDescriptors::InstanceSize(length);
502 } 499 }
503 500
504 501
505 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj, 502 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj,
506 ObjectPointerVisitor* visitor) { 503 ObjectPointerVisitor* visitor) {
507 RawStackmap* obj = raw_obj->ptr(); 504 return Stackmap::InstanceSize(raw_obj->ptr()->length_);
508 intptr_t length = obj->length_;
509 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->code_));
510 return Stackmap::InstanceSize(length);
511 } 505 }
512 506
513 507
514 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( 508 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers(
515 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 509 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
516 RawLocalVarDescriptors* obj = raw_obj->ptr(); 510 RawLocalVarDescriptors* obj = raw_obj->ptr();
517 intptr_t len = obj->length_; 511 intptr_t len = obj->length_;
518 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); 512 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_));
519 return LocalVarDescriptors::InstanceSize(len); 513 return LocalVarDescriptors::InstanceSize(len);
520 } 514 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 829
836 intptr_t RawMirrorReference::VisitMirrorReferencePointers( 830 intptr_t RawMirrorReference::VisitMirrorReferencePointers(
837 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { 831 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) {
838 // Make sure that we got here with the tagged pointer as this. 832 // Make sure that we got here with the tagged pointer as this.
839 ASSERT(raw_obj->IsHeapObject()); 833 ASSERT(raw_obj->IsHeapObject());
840 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 834 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
841 return MirrorReference::InstanceSize(); 835 return MirrorReference::InstanceSize();
842 } 836 }
843 837
844 } // namespace dart 838 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/runtime_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698