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

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

Issue 10912146: Finish implementing lazy deoptimization (ia32, x64). Ran tests with --deoptimize-alot. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 // pointer maps for optimized functions, local variables information etc. 2268 // pointer maps for optimized functions, local variables information etc.
2269 kNumberOfEntries = 5, 2269 kNumberOfEntries = 5,
2270 }; 2270 };
2271 2271
2272 public: 2272 public:
2273 enum Kind { 2273 enum Kind {
2274 kDeoptBefore = 0, // Deoptimization continuation point before instruction. 2274 kDeoptBefore = 0, // Deoptimization continuation point before instruction.
2275 kDeoptAfter, // Deoptimization continuation point after instruction. 2275 kDeoptAfter, // Deoptimization continuation point after instruction.
2276 kDeoptIndex, // Index into deopt info array. 2276 kDeoptIndex, // Index into deopt info array.
2277 kPatchCode, // Buffer for patching code entry. 2277 kPatchCode, // Buffer for patching code entry.
2278 kLazyDeoptJump, // Lazy deoptimization trampoline.
2278 kIcCall, // IC call. 2279 kIcCall, // IC call.
2279 kFuncCall, // Call to known target, e.g. static call, closure call. 2280 kFuncCall, // Call to known target, e.g. static call, closure call.
2280 kReturn, // Return from function. 2281 kReturn, // Return from function.
2281 kOther 2282 kOther
2282 }; 2283 };
2283 2284
2284 intptr_t Length() const; 2285 intptr_t Length() const;
2285 2286
2286 uword PC(intptr_t index) const; 2287 uword PC(intptr_t index) const;
2287 PcDescriptors::Kind DescriptorKind(intptr_t index) const; 2288 PcDescriptors::Kind DescriptorKind(intptr_t index) const;
(...skipping 27 matching lines...) Expand all
2315 return 0; 2316 return 0;
2316 } 2317 }
2317 static intptr_t InstanceSize(intptr_t len) { 2318 static intptr_t InstanceSize(intptr_t len) {
2318 ASSERT(0 <= len && len <= kMaxElements); 2319 ASSERT(0 <= len && len <= kMaxElements);
2319 return RoundedAllocationSize( 2320 return RoundedAllocationSize(
2320 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); 2321 sizeof(RawPcDescriptors) + (len * kBytesPerElement));
2321 } 2322 }
2322 2323
2323 static RawPcDescriptors* New(intptr_t num_descriptors); 2324 static RawPcDescriptors* New(intptr_t num_descriptors);
2324 2325
2326 // Returns 0 if not found.
2327 uword GetPcForKind(Kind kind) const;
2328
2325 // Verify (assert) assumptions about pc descriptors in debug mode. 2329 // Verify (assert) assumptions about pc descriptors in debug mode.
2326 void Verify(bool check_ids) const; 2330 void Verify(bool check_ids) const;
2327 2331
2328 static void PrintHeaderString(); 2332 static void PrintHeaderString();
2329 2333
2330 // We would have a VisitPointers function here to traverse the 2334 // We would have a VisitPointers function here to traverse the
2331 // pc descriptors table to visit objects if any in the table. 2335 // pc descriptors table to visit objects if any in the table.
2332 2336
2333 private: 2337 private:
2334 void SetPC(intptr_t index, uword value) const; 2338 void SetPC(intptr_t index, uword value) const;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 } 2652 }
2649 static RawCode* FinalizeCode(const Function& function, Assembler* assembler); 2653 static RawCode* FinalizeCode(const Function& function, Assembler* assembler);
2650 static RawCode* FinalizeCode(const char* name, Assembler* assembler); 2654 static RawCode* FinalizeCode(const char* name, Assembler* assembler);
2651 static RawCode* LookupCode(uword pc); 2655 static RawCode* LookupCode(uword pc);
2652 2656
2653 int32_t GetPointerOffsetAt(int index) const { 2657 int32_t GetPointerOffsetAt(int index) const {
2654 return *PointerOffsetAddrAt(index); 2658 return *PointerOffsetAddrAt(index);
2655 } 2659 }
2656 intptr_t GetTokenIndexOfPC(uword pc) const; 2660 intptr_t GetTokenIndexOfPC(uword pc) const;
2657 2661
2658 // Find pc of patch code buffer. Return 0 if not found. 2662 // Find pc, return 0 if not found.
2659 uword GetPatchCodePc() const; 2663 uword GetPatchCodePc() const;
2664 uword GetLazyDeoptPc() const;
2660 2665
2661 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const; 2666 uword GetDeoptBeforePcAtDeoptId(intptr_t deopt_id) const;
2662 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const; 2667 uword GetDeoptAfterPcAtDeoptId(intptr_t deopt_id) const;
2663 2668
2664 // Returns true if there is an object in the code between 'start_offset' 2669 // Returns true if there is an object in the code between 'start_offset'
2665 // (inclusive) and 'end_offset' (exclusive). 2670 // (inclusive) and 'end_offset' (exclusive).
2666 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const; 2671 bool ObjectExistsInArea(intptr_t start_offest, intptr_t end_offset) const;
2667 2672
2668 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n]. 2673 // Each (*node_ids)[n] has a an extracted ic data array (*arrays)[n].
2669 // Returns the maximum id found. 2674 // Returns the maximum id found.
(...skipping 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after
5568 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5573 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5569 return false; 5574 return false;
5570 } 5575 }
5571 } 5576 }
5572 return true; 5577 return true;
5573 } 5578 }
5574 5579
5575 } // namespace dart 5580 } // namespace dart
5576 5581
5577 #endif // VM_OBJECT_H_ 5582 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698