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

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

Issue 1189573004: Use object pool for runtime calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/assembler_x64.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) 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 4
5 #ifndef VM_ASSEMBLER_X64_H_ 5 #ifndef VM_ASSEMBLER_X64_H_
6 #define VM_ASSEMBLER_X64_H_ 6 #define VM_ASSEMBLER_X64_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_x64.h directly; use assembler.h instead. 9 #error Do not include assembler_x64.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 return allow_constant_pool_; 755 return allow_constant_pool_;
756 } 756 }
757 void set_allow_constant_pool(bool b) { 757 void set_allow_constant_pool(bool b) {
758 allow_constant_pool_ = b; 758 allow_constant_pool_ = b;
759 } 759 }
760 760
761 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp); 761 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp);
762 void LoadImmediate(Register reg, const Immediate& imm, Register pp); 762 void LoadImmediate(Register reg, const Immediate& imm, Register pp);
763 void LoadIsolate(Register dst); 763 void LoadIsolate(Register dst);
764 void LoadObject(Register dst, const Object& obj, Register pp); 764 void LoadObject(Register dst, const Object& obj, Register pp);
765 void LoadExternalLabel(Register dst,
766 const ExternalLabel* label,
767 Patchability patchable,
768 Register pp);
765 void JmpPatchable(const ExternalLabel* label, Register pp); 769 void JmpPatchable(const ExternalLabel* label, Register pp);
766 void Jmp(const ExternalLabel* label, Register pp); 770 void Jmp(const ExternalLabel* label, Register pp);
767 void J(Condition condition, const ExternalLabel* label, Register pp); 771 void J(Condition condition, const ExternalLabel* label, Register pp);
768 void CallPatchable(const ExternalLabel* label); 772 void CallPatchable(const ExternalLabel* label);
769 void Call(const ExternalLabel* label, Register pp); 773 void Call(const ExternalLabel* label, Register pp);
770 // Unaware of write barrier (use StoreInto* methods for storing to objects). 774 // Unaware of write barrier (use StoreInto* methods for storing to objects).
771 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse. 775 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse.
772 void StoreObject(const Address& dst, const Object& obj, Register pp); 776 void StoreObject(const Address& dst, const Object& obj, Register pp);
773 void PushObject(const Object& object, Register pp); 777 void PushObject(const Object& object, Register pp);
774 void CompareObject(Register reg, const Object& object, Register pp); 778 void CompareObject(Register reg, const Object& object, Register pp);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 // .... <=== RSP 959 // .... <=== RSP
956 // pc (used to derive the RawInstruction Object of the stub) 960 // pc (used to derive the RawInstruction Object of the stub)
957 // saved RBP <=== RBP 961 // saved RBP <=== RBP
958 // ret PC 962 // ret PC
959 // ..... 963 // .....
960 // This code sets this up with the sequence: 964 // This code sets this up with the sequence:
961 // pushq rbp 965 // pushq rbp
962 // movq rbp, rsp 966 // movq rbp, rsp
963 // pushq immediate(0) 967 // pushq immediate(0)
964 // ..... 968 // .....
965 void EnterStubFrame(bool load_pp = false); 969 void EnterStubFrame();
966 void LeaveStubFrame(); 970 void LeaveStubFrame();
967 971
968 // Instruction pattern from entrypoint is used in dart frame prologues 972 // Instruction pattern from entrypoint is used in dart frame prologues
969 // to set up the frame and save a PC which can be used to figure out the 973 // to set up the frame and save a PC which can be used to figure out the
970 // RawInstruction object corresponding to the code running in the frame. 974 // RawInstruction object corresponding to the code running in the frame.
971 // entrypoint: 975 // entrypoint:
972 // pushq rbp (size is 1 byte) 976 // pushq rbp (size is 1 byte)
973 // movq rbp, rsp (size is 3 bytes) 977 // movq rbp, rsp (size is 3 bytes)
974 // call L (size is 5 bytes) 978 // call L (size is 5 bytes)
975 // L: 979 // L:
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 intptr_t pc_offset_; 1058 intptr_t pc_offset_;
1055 const String& comment_; 1059 const String& comment_;
1056 1060
1057 DISALLOW_COPY_AND_ASSIGN(CodeComment); 1061 DISALLOW_COPY_AND_ASSIGN(CodeComment);
1058 }; 1062 };
1059 1063
1060 GrowableArray<CodeComment*> comments_; 1064 GrowableArray<CodeComment*> comments_;
1061 bool allow_constant_pool_; 1065 bool allow_constant_pool_;
1062 1066
1063 intptr_t FindImmediate(int64_t imm); 1067 intptr_t FindImmediate(int64_t imm);
1064 void LoadExternalLabel(Register dst,
1065 const ExternalLabel* label,
1066 Patchability patchable,
1067 Register pp);
1068 bool CanLoadFromObjectPool(const Object& object); 1068 bool CanLoadFromObjectPool(const Object& object);
1069 void LoadWordFromPoolOffset(Register dst, Register pp, int32_t offset); 1069 void LoadWordFromPoolOffset(Register dst, Register pp, int32_t offset);
1070 1070
1071 inline void EmitUint8(uint8_t value); 1071 inline void EmitUint8(uint8_t value);
1072 inline void EmitInt32(int32_t value); 1072 inline void EmitInt32(int32_t value);
1073 inline void EmitInt64(int64_t value); 1073 inline void EmitInt64(int64_t value);
1074 1074
1075 inline void EmitRegisterREX(Register reg, uint8_t rex); 1075 inline void EmitRegisterREX(Register reg, uint8_t rex);
1076 inline void EmitOperandREX(int rm, const Operand& operand, uint8_t rex); 1076 inline void EmitOperandREX(int rm, const Operand& operand, uint8_t rex);
1077 inline void EmitXmmRegisterOperand(int rm, XmmRegister reg); 1077 inline void EmitXmmRegisterOperand(int rm, XmmRegister reg);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 } 1199 }
1200 1200
1201 1201
1202 inline void Assembler::EmitOperandSizeOverride() { 1202 inline void Assembler::EmitOperandSizeOverride() {
1203 EmitUint8(0x66); 1203 EmitUint8(0x66);
1204 } 1204 }
1205 1205
1206 } // namespace dart 1206 } // namespace dart
1207 1207
1208 #endif // VM_ASSEMBLER_X64_H_ 1208 #endif // VM_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/assembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698