Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2227 ASSERT(0 <= len && len <= kMaxElements); | 2227 ASSERT(0 <= len && len <= kMaxElements); |
| 2228 return RoundedAllocationSize( | 2228 return RoundedAllocationSize( |
| 2229 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); | 2229 sizeof(RawPcDescriptors) + (len * kBytesPerElement)); |
| 2230 } | 2230 } |
| 2231 | 2231 |
| 2232 static RawPcDescriptors* New(intptr_t num_descriptors); | 2232 static RawPcDescriptors* New(intptr_t num_descriptors); |
| 2233 | 2233 |
| 2234 // Verify (assert) assumptions about pc descriptors in debug mode. | 2234 // Verify (assert) assumptions about pc descriptors in debug mode. |
| 2235 void Verify(bool check_ids) const; | 2235 void Verify(bool check_ids) const; |
| 2236 | 2236 |
| 2237 static void PrintHeaderString(); | |
| 2238 | |
| 2237 // We would have a VisitPointers function here to traverse the | 2239 // We would have a VisitPointers function here to traverse the |
| 2238 // pc descriptors table to visit objects if any in the table. | 2240 // pc descriptors table to visit objects if any in the table. |
| 2239 | 2241 |
| 2240 private: | 2242 private: |
| 2241 void SetPC(intptr_t index, uword value) const; | 2243 void SetPC(intptr_t index, uword value) const; |
| 2242 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; | 2244 void SetKind(intptr_t index, PcDescriptors::Kind kind) const; |
| 2243 void SetDeoptId(intptr_t index, intptr_t value) const; | 2245 void SetDeoptId(intptr_t index, intptr_t value) const; |
| 2244 void SetTokenPos(intptr_t index, intptr_t value) const; | 2246 void SetTokenPos(intptr_t index, intptr_t value) const; |
| 2245 void SetTryIndex(intptr_t index, intptr_t value) const; | 2247 void SetTryIndex(intptr_t index, intptr_t value) const; |
| 2246 | 2248 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2440 } | 2442 } |
| 2441 intptr_t pointer_offsets_length() const { | 2443 intptr_t pointer_offsets_length() const { |
| 2442 return raw_ptr()->pointer_offsets_length_; | 2444 return raw_ptr()->pointer_offsets_length_; |
| 2443 } | 2445 } |
| 2444 bool is_optimized() const { | 2446 bool is_optimized() const { |
| 2445 return (raw_ptr()->is_optimized_ == 1); | 2447 return (raw_ptr()->is_optimized_ == 1); |
| 2446 } | 2448 } |
| 2447 void set_is_optimized(bool value) const { | 2449 void set_is_optimized(bool value) const { |
| 2448 raw_ptr()->is_optimized_ = value ? 1 : 0; | 2450 raw_ptr()->is_optimized_ = value ? 1 : 0; |
| 2449 } | 2451 } |
| 2452 intptr_t spill_slot_count() const { | |
| 2453 return raw_ptr()->spill_slot_count_; | |
| 2454 } | |
| 2455 void set_spill_slot_count(intptr_t count) const { | |
|
srdjan
2012/08/10 23:11:05
ASSERT(is_optimized()) ?
Kevin Millikin (Google)
2012/08/13 15:10:37
Hmmm. It's called for unoptimized code to set it
| |
| 2456 raw_ptr()->spill_slot_count_ = count; | |
| 2457 } | |
| 2458 | |
| 2450 uword EntryPoint() const { | 2459 uword EntryPoint() const { |
| 2451 const Instructions& instr = Instructions::Handle(instructions()); | 2460 const Instructions& instr = Instructions::Handle(instructions()); |
| 2452 return instr.EntryPoint(); | 2461 return instr.EntryPoint(); |
| 2453 } | 2462 } |
| 2454 intptr_t Size() const { | 2463 intptr_t Size() const { |
| 2455 const Instructions& instr = Instructions::Handle(instructions()); | 2464 const Instructions& instr = Instructions::Handle(instructions()); |
| 2456 return instr.size(); | 2465 return instr.size(); |
| 2457 } | 2466 } |
| 2458 | 2467 |
| 2459 RawPcDescriptors* pc_descriptors() const { | 2468 RawPcDescriptors* pc_descriptors() const { |
| (...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5419 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5428 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5420 return false; | 5429 return false; |
| 5421 } | 5430 } |
| 5422 } | 5431 } |
| 5423 return true; | 5432 return true; |
| 5424 } | 5433 } |
| 5425 | 5434 |
| 5426 } // namespace dart | 5435 } // namespace dart |
| 5427 | 5436 |
| 5428 #endif // VM_OBJECT_H_ | 5437 #endif // VM_OBJECT_H_ |
| OLD | NEW |