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

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

Issue 14935005: Implement a variation of scalar replacement for non-escaping allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 years, 7 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/isolate.cc ('k') | runtime/vm/object.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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 // for a function. This value is used to catch potentially 2589 // for a function. This value is used to catch potentially
2590 // malicious code. 2590 // malicious code.
2591 static const intptr_t kMaxHandlers = 1024 * 1024; 2591 static const intptr_t kMaxHandlers = 1024 * 1024;
2592 2592
2593 void set_handled_types_data(const Array& value) const; 2593 void set_handled_types_data(const Array& value) const;
2594 FINAL_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers, Object); 2594 FINAL_HEAP_OBJECT_IMPLEMENTATION(ExceptionHandlers, Object);
2595 friend class Class; 2595 friend class Class;
2596 }; 2596 };
2597 2597
2598 2598
2599 // Holds deopt information at one deoptimization point. The information 2599 // Holds deopt information at one deoptimization point. The information consists
2600 // is a list of DeoptInstr objects, specifying transformation information 2600 // of two parts:
2601 // for each slot in unoptimized frame(s). 2601 // - first a prefix consiting of kMaterializeObject instructions describing
2602 // objects which had their allocation removed as part of AllocationSinking
2603 // pass and have to be materialized;
2604 // - followed by a list of DeoptInstr objects, specifying transformation
2605 // information for each slot in unoptimized frame(s).
2606 // Arguments for object materialization (class of instance to be allocated and
2607 // field-value pairs) are added as artificial slots to the expression stack
2608 // of the bottom-most frame. They are removed from the stack at the very end
2609 // of deoptimization by the deoptimization stub.
2602 class DeoptInfo : public Object { 2610 class DeoptInfo : public Object {
2603 private: 2611 private:
2604 // Describes the layout of deopt info data. The index of a deopt-info entry 2612 // Describes the layout of deopt info data. The index of a deopt-info entry
2605 // is implicitly the target slot in which the value is written into. 2613 // is implicitly the target slot in which the value is written into.
2606 enum { 2614 enum {
2607 kInstruction = 0, 2615 kInstruction = 0,
2608 kFromIndex, 2616 kFromIndex,
2609 kNumberOfEntries, 2617 kNumberOfEntries,
2610 }; 2618 };
2611 2619
2612 public: 2620 public:
2613 // The number of instructions. 2621 // The number of instructions.
2614 intptr_t Length() const; 2622 intptr_t Length() const;
2615 2623
2616 // The number of real (non-suffix) instructions needed to execute the 2624 // The number of real (non-suffix) instructions needed to execute the
2617 // deoptimization translation. 2625 // deoptimization translation.
2618 intptr_t TranslationLength() const; 2626 intptr_t TranslationLength() const;
2619 2627
2628 // Size of the frame part of the translation not counting kMaterializeObject
2629 // instructions in the prefix.
2630 intptr_t FrameSize() const;
2631
2620 static RawDeoptInfo* New(intptr_t num_commands); 2632 static RawDeoptInfo* New(intptr_t num_commands);
2621 2633
2622 static const intptr_t kBytesPerElement = (kNumberOfEntries * kWordSize); 2634 static const intptr_t kBytesPerElement = (kNumberOfEntries * kWordSize);
2623 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; 2635 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement;
2624 2636
2625 static intptr_t InstanceSize() { 2637 static intptr_t InstanceSize() {
2626 ASSERT(sizeof(RawDeoptInfo) == OFFSET_OF(RawDeoptInfo, data_)); 2638 ASSERT(sizeof(RawDeoptInfo) == OFFSET_OF(RawDeoptInfo, data_));
2627 return 0; 2639 return 0;
2628 } 2640 }
2629 2641
(...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after
5726 5738
5727 5739
5728 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 5740 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
5729 intptr_t index) { 5741 intptr_t index) {
5730 return array.At((index * kEntryLength) + kTargetFunctionIndex); 5742 return array.At((index * kEntryLength) + kTargetFunctionIndex);
5731 } 5743 }
5732 5744
5733 } // namespace dart 5745 } // namespace dart
5734 5746
5735 #endif // VM_OBJECT_H_ 5747 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698