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

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

Issue 1294113004: VM: Link native calls lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added flag Created 5 years, 4 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Classes that describe assembly patterns as used by inline caches. 4 // Classes that describe assembly patterns as used by inline caches.
5 5
6 #ifndef VM_INSTRUCTIONS_MIPS_H_ 6 #ifndef VM_INSTRUCTIONS_MIPS_H_
7 #define VM_INSTRUCTIONS_MIPS_H_ 7 #define VM_INSTRUCTIONS_MIPS_H_
8 8
9 #ifndef VM_INSTRUCTIONS_H_ 9 #ifndef VM_INSTRUCTIONS_H_
10 #error Do not include instructions_mips.h directly; use instructions.h instead. 10 #error Do not include instructions_mips.h directly; use instructions.h instead.
11 #endif 11 #endif
12 12
13 #include "vm/constants_mips.h" 13 #include "vm/constants_mips.h"
14 #include "vm/native_entry.h"
14 #include "vm/object.h" 15 #include "vm/object.h"
15 16
16 namespace dart { 17 namespace dart {
17 18
18 class InstructionPattern : public AllStatic { 19 class InstructionPattern : public AllStatic {
19 public: 20 public:
20 // Decodes a load sequence ending at 'end' (the last instruction of the 21 // Decodes a load sequence ending at 'end' (the last instruction of the
21 // load sequence is the instruction before the one at end). Returns the 22 // load sequence is the instruction before the one at end). Returns the
22 // address of the first instruction in the sequence. Returns the register 23 // address of the first instruction in the sequence. Returns the register
23 // being loaded and the loaded object in the output parameters 'reg' and 24 // being loaded and the loaded object in the output parameters 'reg' and
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 uword ic_data_load_end_; 72 uword ic_data_load_end_;
72 73
73 intptr_t target_address_pool_index_; 74 intptr_t target_address_pool_index_;
74 Array& args_desc_; 75 Array& args_desc_;
75 ICData& ic_data_; 76 ICData& ic_data_;
76 77
77 DISALLOW_COPY_AND_ASSIGN(CallPattern); 78 DISALLOW_COPY_AND_ASSIGN(CallPattern);
78 }; 79 };
79 80
80 81
82 class NativeCallPattern : public ValueObject {
83 public:
84 NativeCallPattern(uword pc, const Code& code);
85
86 uword target() const;
87 void set_target(uword target_address) const;
88
89 NativeFunction native_function() const;
90 void set_native_function(NativeFunction target) const;
91
92 private:
93 const ObjectPool& object_pool_;
94
95 uword end_;
96 intptr_t native_function_pool_index_;
97 intptr_t target_address_pool_index_;
98
99 DISALLOW_COPY_AND_ASSIGN(NativeCallPattern);
100 };
101
102
81 class JumpPattern : public ValueObject { 103 class JumpPattern : public ValueObject {
82 public: 104 public:
83 JumpPattern(uword pc, const Code& code); 105 JumpPattern(uword pc, const Code& code);
84 106
85 // lui; ori; jr; nop (in delay slot) = 4. 107 // lui; ori; jr; nop (in delay slot) = 4.
86 static const int kLengthInBytes = 4*Instr::kInstrSize; 108 static const int kLengthInBytes = 4*Instr::kInstrSize;
87 109
88 int pattern_length_in_bytes() const { 110 int pattern_length_in_bytes() const {
89 return kLengthInBytes; 111 return kLengthInBytes;
90 } 112 }
(...skipping 22 matching lines...) Expand all
113 135
114 bool IsValid() const; 136 bool IsValid() const;
115 137
116 private: 138 private:
117 const uword pc_; 139 const uword pc_;
118 }; 140 };
119 141
120 } // namespace dart 142 } // namespace dart
121 143
122 #endif // VM_INSTRUCTIONS_MIPS_H_ 144 #endif // VM_INSTRUCTIONS_MIPS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698