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

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

Issue 2326483005: Shrink AOT snapshot size and memory usage. (Closed)
Patch Set: . Created 4 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
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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 return raw_ptr()->target_name_; 1879 return raw_ptr()->target_name_;
1880 } 1880 }
1881 1881
1882 RawArray* arguments_descriptor() const { 1882 RawArray* arguments_descriptor() const {
1883 return raw_ptr()->args_descriptor_; 1883 return raw_ptr()->args_descriptor_;
1884 } 1884 }
1885 1885
1886 intptr_t NumArgsTested() const; 1886 intptr_t NumArgsTested() const;
1887 1887
1888 intptr_t deopt_id() const { 1888 intptr_t deopt_id() const {
1889 #if defined(DART_PRECOMPILED_RUNTIME)
1890 UNREACHABLE();
1891 return -1;
1892 #else
1889 return raw_ptr()->deopt_id_; 1893 return raw_ptr()->deopt_id_;
1894 #endif
1890 } 1895 }
1891 1896
1892 bool IsImmutable() const; 1897 bool IsImmutable() const;
1893 1898
1894 void Reset(Zone* zone) const; 1899 void Reset(Zone* zone) const;
1895 void ResetSwitchable(Zone* zone) const; 1900 void ResetSwitchable(Zone* zone) const;
1896 1901
1897 // Note: only deopts with reasons before Unknown in this list are recorded in 1902 // Note: only deopts with reasons before Unknown in this list are recorded in
1898 // the ICData. All other reasons are used purely for informational messages 1903 // the ICData. All other reasons are used purely for informational messages
1899 // printed during deoptimization itself. 1904 // printed during deoptimization itself.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 2305
2301 // Compiles unoptimized code (if necessary) and attaches it to the function. 2306 // Compiles unoptimized code (if necessary) and attaches it to the function.
2302 void EnsureHasCompiledUnoptimizedCode() const; 2307 void EnsureHasCompiledUnoptimizedCode() const;
2303 2308
2304 // Return the most recently compiled and installed code for this function. 2309 // Return the most recently compiled and installed code for this function.
2305 // It is not the only Code object that points to this function. 2310 // It is not the only Code object that points to this function.
2306 RawCode* CurrentCode() const { 2311 RawCode* CurrentCode() const {
2307 return raw_ptr()->code_; 2312 return raw_ptr()->code_;
2308 } 2313 }
2309 2314
2310 RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; } 2315 RawCode* unoptimized_code() const {
2316 #if defined(DART_PRECOMPILED_RUNTIME)
2317 return static_cast<RawCode*>(Object::null());
2318 #else
2319 return raw_ptr()->unoptimized_code_;
2320 #endif
2321 }
2311 void set_unoptimized_code(const Code& value) const; 2322 void set_unoptimized_code(const Code& value) const;
2312 bool HasCode() const; 2323 bool HasCode() const;
2313 2324
2314 static intptr_t code_offset() { 2325 static intptr_t code_offset() {
2315 return OFFSET_OF(RawFunction, code_); 2326 return OFFSET_OF(RawFunction, code_);
2316 } 2327 }
2317 2328
2318 static intptr_t entry_point_offset() { 2329 static intptr_t entry_point_offset() {
2319 return OFFSET_OF(RawFunction, entry_point_); 2330 return OFFSET_OF(RawFunction, entry_point_);
2320 } 2331 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 case RawFunction::kClosureFunction: 2445 case RawFunction::kClosureFunction:
2435 case RawFunction::kConstructor: 2446 case RawFunction::kConstructor:
2436 return false; 2447 return false;
2437 default: 2448 default:
2438 UNREACHABLE(); 2449 UNREACHABLE();
2439 return false; 2450 return false;
2440 } 2451 }
2441 } 2452 }
2442 bool IsInFactoryScope() const; 2453 bool IsInFactoryScope() const;
2443 2454
2444 TokenPosition token_pos() const { return raw_ptr()->token_pos_; } 2455 TokenPosition token_pos() const {
2456 #if defined(DART_PRECOMPILED_RUNTIME)
2457 return TokenPosition();
2458 #else
2459 return raw_ptr()->token_pos_;
2460 #endif
2461 }
2445 void set_token_pos(TokenPosition value) const; 2462 void set_token_pos(TokenPosition value) const;
2446 2463
2447 TokenPosition end_token_pos() const { return raw_ptr()->end_token_pos_; } 2464 TokenPosition end_token_pos() const {
2465 #if defined(DART_PRECOMPILED_RUNTIME)
2466 return TokenPosition();
2467 #else
2468 return raw_ptr()->end_token_pos_;
2469 #endif
2470 }
2448 void set_end_token_pos(TokenPosition value) const { 2471 void set_end_token_pos(TokenPosition value) const {
2472 #if defined(DART_PRECOMPILED_RUNTIME)
2473 UNREACHABLE();
2474 #else
2449 StoreNonPointer(&raw_ptr()->end_token_pos_, value); 2475 StoreNonPointer(&raw_ptr()->end_token_pos_, value);
2476 #endif
2450 } 2477 }
2451 2478
2452 intptr_t num_fixed_parameters() const { 2479 intptr_t num_fixed_parameters() const {
2453 return raw_ptr()->num_fixed_parameters_; 2480 return raw_ptr()->num_fixed_parameters_;
2454 } 2481 }
2455 void set_num_fixed_parameters(intptr_t value) const; 2482 void set_num_fixed_parameters(intptr_t value) const;
2456 2483
2457 bool HasOptionalParameters() const { 2484 bool HasOptionalParameters() const {
2458 return raw_ptr()->num_optional_parameters_ != 0; 2485 return raw_ptr()->num_optional_parameters_ != 0;
2459 } 2486 }
(...skipping 17 matching lines...) Expand all
2477 intptr_t NumOptionalNamedParameters() const { 2504 intptr_t NumOptionalNamedParameters() const {
2478 const intptr_t num_opt_params = raw_ptr()->num_optional_parameters_; 2505 const intptr_t num_opt_params = raw_ptr()->num_optional_parameters_;
2479 return (num_opt_params < 0) ? -num_opt_params : 0; 2506 return (num_opt_params < 0) ? -num_opt_params : 0;
2480 } 2507 }
2481 2508
2482 intptr_t NumParameters() const; 2509 intptr_t NumParameters() const;
2483 2510
2484 intptr_t NumImplicitParameters() const; 2511 intptr_t NumImplicitParameters() const;
2485 2512
2486 static intptr_t usage_counter_offset() { 2513 static intptr_t usage_counter_offset() {
2514 #if defined(DART_PRECOMPILED_RUNTIME)
2515 UNREACHABLE();
2516 return 0;
2517 #else
2487 return OFFSET_OF(RawFunction, usage_counter_); 2518 return OFFSET_OF(RawFunction, usage_counter_);
2519 #endif
2488 } 2520 }
2489 intptr_t usage_counter() const { 2521 intptr_t usage_counter() const {
2522 #if defined(DART_PRECOMPILED_RUNTIME)
2523 return 0;
2524 #else
2490 return raw_ptr()->usage_counter_; 2525 return raw_ptr()->usage_counter_;
2526 #endif
2491 } 2527 }
2492 void set_usage_counter(intptr_t value) const { 2528 void set_usage_counter(intptr_t value) const {
2529 #if defined(DART_PRECOMPILED_RUNTIME)
2530 UNREACHABLE();
2531 #else
2493 // TODO(Srdjan): Assert that this is thread-safe, i.e., only 2532 // TODO(Srdjan): Assert that this is thread-safe, i.e., only
2494 // set from mutator-thread or while at a safepoint (e.g., during marking). 2533 // set from mutator-thread or while at a safepoint (e.g., during marking).
2495 StoreNonPointer(&raw_ptr()->usage_counter_, value); 2534 StoreNonPointer(&raw_ptr()->usage_counter_, value);
2535 #endif
2496 } 2536 }
2497 2537
2498 int8_t deoptimization_counter() const { 2538 int8_t deoptimization_counter() const {
2539 #if defined(DART_PRECOMPILED_RUNTIME)
2540 return 0;
2541 #else
2499 return raw_ptr()->deoptimization_counter_; 2542 return raw_ptr()->deoptimization_counter_;
2543 #endif
2500 } 2544 }
2501 void set_deoptimization_counter(int8_t value) const { 2545 void set_deoptimization_counter(int8_t value) const {
2546 #if defined(DART_PRECOMPILED_RUNTIME)
2547 UNREACHABLE();
2548 #else
2502 ASSERT(value >= 0); 2549 ASSERT(value >= 0);
2503 StoreNonPointer(&raw_ptr()->deoptimization_counter_, value); 2550 StoreNonPointer(&raw_ptr()->deoptimization_counter_, value);
2551 #endif
2504 } 2552 }
2505 2553
2506 static const intptr_t kMaxInstructionCount = (1 << 16) - 1; 2554 static const intptr_t kMaxInstructionCount = (1 << 16) - 1;
2507 intptr_t optimized_instruction_count() const { 2555 intptr_t optimized_instruction_count() const {
2556 #if defined(DART_PRECOMPILED_RUNTIME)
2557 UNREACHABLE();
2558 return 0;
2559 #else
2508 return raw_ptr()->optimized_instruction_count_; 2560 return raw_ptr()->optimized_instruction_count_;
2561 #endif
2509 } 2562 }
2510 void set_optimized_instruction_count(intptr_t value) const { 2563 void set_optimized_instruction_count(intptr_t value) const {
2564 #if defined(DART_PRECOMPILED_RUNTIME)
2565 UNREACHABLE();
2566 #else
2511 ASSERT(value >= 0); 2567 ASSERT(value >= 0);
2512 if (value > kMaxInstructionCount) { 2568 if (value > kMaxInstructionCount) {
2513 value = kMaxInstructionCount; 2569 value = kMaxInstructionCount;
2514 } 2570 }
2515 StoreNonPointer(&raw_ptr()->optimized_instruction_count_, 2571 StoreNonPointer(&raw_ptr()->optimized_instruction_count_,
2516 static_cast<uint16_t>(value)); 2572 static_cast<uint16_t>(value));
2573 #endif
2517 } 2574 }
2518 2575
2519 intptr_t optimized_call_site_count() const { 2576 intptr_t optimized_call_site_count() const {
2577 #if defined(DART_PRECOMPILED_RUNTIME)
2578 return 0;
2579 #else
2520 return raw_ptr()->optimized_call_site_count_; 2580 return raw_ptr()->optimized_call_site_count_;
2581 #endif
2521 } 2582 }
2522 void set_optimized_call_site_count(intptr_t value) const { 2583 void set_optimized_call_site_count(intptr_t value) const {
2584 #if defined(DART_PRECOMPILED_RUNTIME)
2585 UNREACHABLE();
2586 #else
2523 ASSERT(value >= 0); 2587 ASSERT(value >= 0);
2524 if (value > kMaxInstructionCount) { 2588 if (value > kMaxInstructionCount) {
2525 value = kMaxInstructionCount; 2589 value = kMaxInstructionCount;
2526 } 2590 }
2527 StoreNonPointer(&raw_ptr()->optimized_call_site_count_, 2591 StoreNonPointer(&raw_ptr()->optimized_call_site_count_,
2528 static_cast<uint16_t>(value)); 2592 static_cast<uint16_t>(value));
2593 #endif
2529 } 2594 }
2530 2595
2531 bool IsOptimizable() const; 2596 bool IsOptimizable() const;
2532 bool IsNativeAutoSetupScope() const; 2597 bool IsNativeAutoSetupScope() const;
2533 void SetIsOptimizable(bool value) const; 2598 void SetIsOptimizable(bool value) const;
2534 void SetIsNativeAutoSetupScope(bool value) const; 2599 void SetIsNativeAutoSetupScope(bool value) const;
2535 2600
2536 bool CanBeInlined() const; 2601 bool CanBeInlined() const;
2537 2602
2538 MethodRecognizer::Kind recognized_kind() const { 2603 MethodRecognizer::Kind recognized_kind() const {
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 2843
2779 // Sets deopt reason in all ICData-s with given deopt_id. 2844 // Sets deopt reason in all ICData-s with given deopt_id.
2780 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason); 2845 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason);
2781 2846
2782 void set_modifier(RawFunction::AsyncModifier value) const; 2847 void set_modifier(RawFunction::AsyncModifier value) const;
2783 2848
2784 // 'was_compiled' is true if the function was compiled once in this 2849 // 'was_compiled' is true if the function was compiled once in this
2785 // VM instantiation. It is independent from presence of type feedback 2850 // VM instantiation. It is independent from presence of type feedback
2786 // (ic_data_array) and code, which may be loaded from a snapshot. 2851 // (ic_data_array) and code, which may be loaded from a snapshot.
2787 void set_was_compiled(bool value) const { 2852 void set_was_compiled(bool value) const {
2853 #if defined(DART_PRECOMPILED_RUNTIME)
2854 UNREACHABLE();
2855 #else
2788 StoreNonPointer(&raw_ptr()->was_compiled_, value ? 1 : 0); 2856 StoreNonPointer(&raw_ptr()->was_compiled_, value ? 1 : 0);
2857 #endif
2789 } 2858 }
2790 bool was_compiled() const { return raw_ptr()->was_compiled_ == 1; } 2859 bool was_compiled() const {
2860 #if defined(DART_PRECOMPILED_RUNTIME)
2861 UNREACHABLE();
2862 return true;
2863 #else
2864 return raw_ptr()->was_compiled_ == 1;
2865 #endif
2866 }
2791 2867
2792 // static: Considered during class-side or top-level resolution rather than 2868 // static: Considered during class-side or top-level resolution rather than
2793 // instance-side resolution. 2869 // instance-side resolution.
2794 // const: Valid target of a const constructor call. 2870 // const: Valid target of a const constructor call.
2795 // abstract: Skipped during instance-side resolution. 2871 // abstract: Skipped during instance-side resolution.
2796 // reflectable: Enumerated by mirrors, invocable by mirrors. False for private 2872 // reflectable: Enumerated by mirrors, invocable by mirrors. False for private
2797 // functions of dart: libraries. 2873 // functions of dart: libraries.
2798 // debuggable: Valid location of a breakpoint. Synthetic code is not 2874 // debuggable: Valid location of a breakpoint. Synthetic code is not
2799 // debuggable. 2875 // debuggable.
2800 // visible: Frame is included in stack traces. Synthetic code such as 2876 // visible: Frame is included in stack traces. Synthetic code such as
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4497 static void UnpackInto(const Array& table, 4573 static void UnpackInto(const Array& table,
4498 const TypedData& packed, 4574 const TypedData& packed,
4499 GrowableArray<DeoptInstr*>* instructions, 4575 GrowableArray<DeoptInstr*>* instructions,
4500 intptr_t length); 4576 intptr_t length);
4501 }; 4577 };
4502 4578
4503 4579
4504 class Code : public Object { 4580 class Code : public Object {
4505 public: 4581 public:
4506 RawInstructions* active_instructions() const { 4582 RawInstructions* active_instructions() const {
4583 #if defined(DART_PRECOMPILED_RUNTIME)
4584 UNREACHABLE();
4585 return NULL;
4586 #else
4507 return raw_ptr()->active_instructions_; 4587 return raw_ptr()->active_instructions_;
4588 #endif
4508 } 4589 }
4509 4590
4510 RawInstructions* instructions() const { return raw_ptr()->instructions_; } 4591 RawInstructions* instructions() const { return raw_ptr()->instructions_; }
4511 4592
4512 static intptr_t saved_instructions_offset() { 4593 static intptr_t saved_instructions_offset() {
4513 return OFFSET_OF(RawCode, instructions_); 4594 return OFFSET_OF(RawCode, instructions_);
4514 } 4595 }
4515 4596
4516 static intptr_t entry_point_offset() { 4597 static intptr_t entry_point_offset() {
4517 return OFFSET_OF(RawCode, entry_point_); 4598 return OFFSET_OF(RawCode, entry_point_);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
4565 4646
4566 RawPcDescriptors* pc_descriptors() const { 4647 RawPcDescriptors* pc_descriptors() const {
4567 return raw_ptr()->pc_descriptors_; 4648 return raw_ptr()->pc_descriptors_;
4568 } 4649 }
4569 void set_pc_descriptors(const PcDescriptors& descriptors) const { 4650 void set_pc_descriptors(const PcDescriptors& descriptors) const {
4570 ASSERT(descriptors.IsOld()); 4651 ASSERT(descriptors.IsOld());
4571 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw()); 4652 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw());
4572 } 4653 }
4573 4654
4574 RawCodeSourceMap* code_source_map() const { 4655 RawCodeSourceMap* code_source_map() const {
4656 #if defined(DART_PRECOMPILED_RUNTIME)
4657 return CodeSourceMap::null();
4658 #else
4575 return raw_ptr()->code_source_map_; 4659 return raw_ptr()->code_source_map_;
4660 #endif
4576 } 4661 }
4577 4662
4578 void set_code_source_map(const CodeSourceMap& code_source_map) const { 4663 void set_code_source_map(const CodeSourceMap& code_source_map) const {
4664 #if defined(DART_PRECOMPILED_RUNTIME)
4665 UNREACHABLE();
4666 #else
4579 ASSERT(code_source_map.IsOld()); 4667 ASSERT(code_source_map.IsOld());
4580 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw()); 4668 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
4669 #endif
4581 } 4670 }
4582 4671
4583 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas 4672 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas
4584 // that are embedded inside the Code object. 4673 // that are embedded inside the Code object.
4585 void ResetICDatas(Zone* zone) const; 4674 void ResetICDatas(Zone* zone) const;
4586 4675
4587 TokenPosition GetTokenPositionAt(intptr_t offset) const; 4676 TokenPosition GetTokenPositionAt(intptr_t offset) const;
4588 4677
4589 // Array of DeoptInfo objects. 4678 // Array of DeoptInfo objects.
4590 RawArray* deopt_info_array() const { 4679 RawArray* deopt_info_array() const {
4680 #if defined(DART_PRECOMPILED_RUNTIME)
4681 UNREACHABLE();
4682 return NULL;
4683 #else
4591 return raw_ptr()->deopt_info_array_; 4684 return raw_ptr()->deopt_info_array_;
4685 #endif
4592 } 4686 }
4593 void set_deopt_info_array(const Array& array) const; 4687 void set_deopt_info_array(const Array& array) const;
4594 4688
4595 RawArray* stackmaps() const { 4689 RawArray* stackmaps() const {
4596 return raw_ptr()->stackmaps_; 4690 return raw_ptr()->stackmaps_;
4597 } 4691 }
4598 void set_stackmaps(const Array& maps) const; 4692 void set_stackmaps(const Array& maps) const;
4599 RawStackmap* GetStackmap( 4693 RawStackmap* GetStackmap(
4600 uint32_t pc_offset, Array* stackmaps, Stackmap* map) const; 4694 uint32_t pc_offset, Array* stackmaps, Stackmap* map) const;
4601 4695
4602 enum { 4696 enum {
4603 kSCallTableOffsetEntry = 0, 4697 kSCallTableOffsetEntry = 0,
4604 kSCallTableFunctionEntry = 1, 4698 kSCallTableFunctionEntry = 1,
4605 kSCallTableCodeEntry = 2, 4699 kSCallTableCodeEntry = 2,
4606 kSCallTableEntryLength = 3, 4700 kSCallTableEntryLength = 3,
4607 }; 4701 };
4608 4702
4609 void set_static_calls_target_table(const Array& value) const; 4703 void set_static_calls_target_table(const Array& value) const;
4610 RawArray* static_calls_target_table() const { 4704 RawArray* static_calls_target_table() const {
4705 #if defined(DART_PRECOMPILED_RUNTIME)
4706 UNREACHABLE();
4707 return NULL;
4708 #else
4611 return raw_ptr()->static_calls_target_table_; 4709 return raw_ptr()->static_calls_target_table_;
4710 #endif
4612 } 4711 }
4613 4712
4614 RawTypedData* GetDeoptInfoAtPc(uword pc, 4713 RawTypedData* GetDeoptInfoAtPc(uword pc,
4615 ICData::DeoptReasonId* deopt_reason, 4714 ICData::DeoptReasonId* deopt_reason,
4616 uint32_t* deopt_flags) const; 4715 uint32_t* deopt_flags) const;
4617 4716
4618 // Returns null if there is no static call at 'pc'. 4717 // Returns null if there is no static call at 'pc'.
4619 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const; 4718 RawFunction* GetStaticCallTargetFunctionAt(uword pc) const;
4620 // Returns null if there is no static call at 'pc'. 4719 // Returns null if there is no static call at 'pc'.
4621 RawCode* GetStaticCallTargetCodeAt(uword pc) const; 4720 RawCode* GetStaticCallTargetCodeAt(uword pc) const;
(...skipping 30 matching lines...) Expand all
4652 friend class Code; 4751 friend class Code;
4653 4752
4654 DISALLOW_COPY_AND_ASSIGN(Comments); 4753 DISALLOW_COPY_AND_ASSIGN(Comments);
4655 }; 4754 };
4656 4755
4657 4756
4658 const Comments& comments() const; 4757 const Comments& comments() const;
4659 void set_comments(const Comments& comments) const; 4758 void set_comments(const Comments& comments) const;
4660 4759
4661 RawObject* return_address_metadata() const { 4760 RawObject* return_address_metadata() const {
4761 #if defined(DART_PRECOMPILED_RUNTIME)
4762 UNREACHABLE();
4763 return NULL;
4764 #else
4662 return raw_ptr()->return_address_metadata_; 4765 return raw_ptr()->return_address_metadata_;
4766 #endif
4663 } 4767 }
4664 // Sets |return_address_metadata|. 4768 // Sets |return_address_metadata|.
4665 void SetPrologueOffset(intptr_t offset) const; 4769 void SetPrologueOffset(intptr_t offset) const;
4666 // Returns -1 if no prologue offset is available. 4770 // Returns -1 if no prologue offset is available.
4667 intptr_t GetPrologueOffset() const; 4771 intptr_t GetPrologueOffset() const;
4668 4772
4669 enum InlinedIntervalEntries { 4773 enum InlinedIntervalEntries {
4670 kInlIntStart = 0, 4774 kInlIntStart = 0,
4671 kInlIntInliningId = 1, 4775 kInlIntInliningId = 1,
4672 kInlIntNumEntries = 2, 4776 kInlIntNumEntries = 2,
(...skipping 14 matching lines...) Expand all
4687 // If |token_positions| is not NULL it will be populated with the token 4791 // If |token_positions| is not NULL it will be populated with the token
4688 // positions of the inlined calls. 4792 // positions of the inlined calls.
4689 void GetInlinedFunctionsAt( 4793 void GetInlinedFunctionsAt(
4690 intptr_t offset, 4794 intptr_t offset,
4691 GrowableArray<Function*>* fs, 4795 GrowableArray<Function*>* fs,
4692 GrowableArray<TokenPosition>* token_positions = NULL) const; 4796 GrowableArray<TokenPosition>* token_positions = NULL) const;
4693 4797
4694 void DumpInlinedIntervals() const; 4798 void DumpInlinedIntervals() const;
4695 4799
4696 RawLocalVarDescriptors* var_descriptors() const { 4800 RawLocalVarDescriptors* var_descriptors() const {
4801 #if defined(DART_PRECOMPILED_RUNTIME)
4802 UNREACHABLE();
4803 return NULL;
4804 #else
4697 return raw_ptr()->var_descriptors_; 4805 return raw_ptr()->var_descriptors_;
4806 #endif
4698 } 4807 }
4699 void set_var_descriptors(const LocalVarDescriptors& value) const { 4808 void set_var_descriptors(const LocalVarDescriptors& value) const {
4809 #if defined(DART_PRECOMPILED_RUNTIME)
4810 UNREACHABLE();
4811 #else
4700 ASSERT(value.IsOld()); 4812 ASSERT(value.IsOld());
4701 StorePointer(&raw_ptr()->var_descriptors_, value.raw()); 4813 StorePointer(&raw_ptr()->var_descriptors_, value.raw());
4814 #endif
4702 } 4815 }
4703 4816
4704 // Will compute local var descriptors is necessary. 4817 // Will compute local var descriptors is necessary.
4705 RawLocalVarDescriptors* GetLocalVarDescriptors() const; 4818 RawLocalVarDescriptors* GetLocalVarDescriptors() const;
4706 4819
4707 RawExceptionHandlers* exception_handlers() const { 4820 RawExceptionHandlers* exception_handlers() const {
4708 return raw_ptr()->exception_handlers_; 4821 return raw_ptr()->exception_handlers_;
4709 } 4822 }
4710 void set_exception_handlers(const ExceptionHandlers& handlers) const { 4823 void set_exception_handlers(const ExceptionHandlers& handlers) const {
4711 ASSERT(handlers.IsOld()); 4824 ASSERT(handlers.IsOld());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4772 uword GetLazyDeoptPc() const; 4885 uword GetLazyDeoptPc() const;
4773 4886
4774 // Find pc, return 0 if not found. 4887 // Find pc, return 0 if not found.
4775 uword GetPcForDeoptId(intptr_t deopt_id, RawPcDescriptors::Kind kind) const; 4888 uword GetPcForDeoptId(intptr_t deopt_id, RawPcDescriptors::Kind kind) const;
4776 intptr_t GetDeoptIdForOsr(uword pc) const; 4889 intptr_t GetDeoptIdForOsr(uword pc) const;
4777 4890
4778 RawString* Name() const; 4891 RawString* Name() const;
4779 RawString* QualifiedName() const; 4892 RawString* QualifiedName() const;
4780 4893
4781 int64_t compile_timestamp() const { 4894 int64_t compile_timestamp() const {
4895 #if defined(DART_PRECOMPILED_RUNTIME)
4896 return 0;
4897 #else
4782 return raw_ptr()->compile_timestamp_; 4898 return raw_ptr()->compile_timestamp_;
4899 #endif
4783 } 4900 }
4784 4901
4785 intptr_t lazy_deopt_pc_offset() const { 4902 intptr_t lazy_deopt_pc_offset() const {
4903 #if defined(DART_PRECOMPILED_RUNTIME)
Florian Schneider 2016/09/15 17:17:37 Is this used in AOT? UNREACHABLE as well?
rmacnak 2016/09/16 21:59:02 From the profiler.
4904 return 0;
4905 #else
4786 return raw_ptr()->lazy_deopt_pc_offset_; 4906 return raw_ptr()->lazy_deopt_pc_offset_;
4907 #endif
4787 } 4908 }
4788 void set_lazy_deopt_pc_offset(intptr_t pc) const { 4909 void set_lazy_deopt_pc_offset(intptr_t pc) const {
4910 #if defined(DART_PRECOMPILED_RUNTIME)
4911 UNREACHABLE();
4912 #else
4789 StoreNonPointer(&raw_ptr()->lazy_deopt_pc_offset_, pc); 4913 StoreNonPointer(&raw_ptr()->lazy_deopt_pc_offset_, pc);
4914 #endif
4790 } 4915 }
4791 4916
4792 bool IsAllocationStubCode() const; 4917 bool IsAllocationStubCode() const;
4793 bool IsStubCode() const; 4918 bool IsStubCode() const;
4794 bool IsFunctionCode() const; 4919 bool IsFunctionCode() const;
4795 4920
4796 void DisableDartCode() const; 4921 void DisableDartCode() const;
4797 4922
4798 void DisableStubCode() const; 4923 void DisableStubCode() const;
4799 4924
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
4843 DISALLOW_COPY_AND_ASSIGN(SlowFindRawCodeVisitor); 4968 DISALLOW_COPY_AND_ASSIGN(SlowFindRawCodeVisitor);
4844 }; 4969 };
4845 4970
4846 static bool IsOptimized(RawCode* code) { 4971 static bool IsOptimized(RawCode* code) {
4847 return Code::OptimizedBit::decode(code->ptr()->state_bits_); 4972 return Code::OptimizedBit::decode(code->ptr()->state_bits_);
4848 } 4973 }
4849 4974
4850 static const intptr_t kEntrySize = sizeof(int32_t); // NOLINT 4975 static const intptr_t kEntrySize = sizeof(int32_t); // NOLINT
4851 4976
4852 void set_compile_timestamp(int64_t timestamp) const { 4977 void set_compile_timestamp(int64_t timestamp) const {
4978 #if defined(DART_PRECOMPILED_RUNTIME)
4979 UNREACHABLE();
4980 #else
4853 StoreNonPointer(&raw_ptr()->compile_timestamp_, timestamp); 4981 StoreNonPointer(&raw_ptr()->compile_timestamp_, timestamp);
4982 #endif
4854 } 4983 }
4855 4984
4856 void SetActiveInstructions(RawInstructions* instructions) const; 4985 void SetActiveInstructions(RawInstructions* instructions) const;
4857 4986
4858 void set_instructions(RawInstructions* instructions) const { 4987 void set_instructions(RawInstructions* instructions) const {
4859 ASSERT(Thread::Current()->IsMutatorThread() || !is_alive()); 4988 ASSERT(Thread::Current()->IsMutatorThread() || !is_alive());
4860 StorePointer(&raw_ptr()->instructions_, instructions); 4989 StorePointer(&raw_ptr()->instructions_, instructions);
4861 } 4990 }
4862 4991
4863 void set_pointer_offsets_length(intptr_t value) { 4992 void set_pointer_offsets_length(intptr_t value) {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
5073 5202
5074 void Insert(const Smi& class_id, const Function& target) const; 5203 void Insert(const Smi& class_id, const Function& target) const;
5075 5204
5076 static intptr_t InstanceSize() { 5205 static intptr_t InstanceSize() {
5077 return RoundedAllocationSize(sizeof(RawMegamorphicCache)); 5206 return RoundedAllocationSize(sizeof(RawMegamorphicCache));
5078 } 5207 }
5079 5208
5080 private: 5209 private:
5081 friend class Class; 5210 friend class Class;
5082 friend class MegamorphicCacheTable; 5211 friend class MegamorphicCacheTable;
5212 friend class Precompiler;
5083 5213
5084 static RawMegamorphicCache* New(); 5214 static RawMegamorphicCache* New();
5085 5215
5086 void set_target_name(const String& value) const; 5216 void set_target_name(const String& value) const;
5087 void set_arguments_descriptor(const Array& value) const; 5217 void set_arguments_descriptor(const Array& value) const;
5088 5218
5089 enum { 5219 enum {
5090 kClassIdIndex, 5220 kClassIdIndex,
5091 kTargetFunctionIndex, 5221 kTargetFunctionIndex,
5092 kEntryLength, 5222 kEntryLength,
(...skipping 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after
8818 8948
8819 inline void TypeArguments::SetHash(intptr_t value) const { 8949 inline void TypeArguments::SetHash(intptr_t value) const {
8820 // This is only safe because we create a new Smi, which does not cause 8950 // This is only safe because we create a new Smi, which does not cause
8821 // heap allocation. 8951 // heap allocation.
8822 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8952 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8823 } 8953 }
8824 8954
8825 } // namespace dart 8955 } // namespace dart
8826 8956
8827 #endif // VM_OBJECT_H_ 8957 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/raw_object_snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698