OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MACRO_ASSEMBLER_H_ | 5 #ifndef V8_MACRO_ASSEMBLER_H_ |
6 #define V8_MACRO_ASSEMBLER_H_ | 6 #define V8_MACRO_ASSEMBLER_H_ |
7 | 7 |
8 | 8 |
9 // Helper types to make boolean flag easier to read at call-site. | 9 // Helper types to make boolean flag easier to read at call-site. |
10 enum InvokeFlag { | 10 enum InvokeFlag { |
(...skipping 21 matching lines...) Expand all Loading... |
32 }; | 32 }; |
33 | 33 |
34 | 34 |
35 // Invalid depth in prototype chain. | 35 // Invalid depth in prototype chain. |
36 const int kInvalidProtoDepth = -1; | 36 const int kInvalidProtoDepth = -1; |
37 | 37 |
38 #if V8_TARGET_ARCH_IA32 | 38 #if V8_TARGET_ARCH_IA32 |
39 #include "src/assembler.h" | 39 #include "src/assembler.h" |
40 #include "src/ia32/assembler-ia32.h" | 40 #include "src/ia32/assembler-ia32.h" |
41 #include "src/ia32/assembler-ia32-inl.h" | 41 #include "src/ia32/assembler-ia32-inl.h" |
42 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
43 #include "src/ia32/macro-assembler-ia32.h" | 42 #include "src/ia32/macro-assembler-ia32.h" |
44 #elif V8_TARGET_ARCH_X64 | 43 #elif V8_TARGET_ARCH_X64 |
45 #include "src/assembler.h" | 44 #include "src/assembler.h" |
46 #include "src/x64/assembler-x64.h" | 45 #include "src/x64/assembler-x64.h" |
47 #include "src/x64/assembler-x64-inl.h" | 46 #include "src/x64/assembler-x64-inl.h" |
48 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
49 #include "src/x64/macro-assembler-x64.h" | 47 #include "src/x64/macro-assembler-x64.h" |
50 #elif V8_TARGET_ARCH_ARM64 | 48 #elif V8_TARGET_ARCH_ARM64 |
51 #include "src/arm64/constants-arm64.h" | 49 #include "src/arm64/constants-arm64.h" |
52 #include "src/assembler.h" | 50 #include "src/assembler.h" |
53 #include "src/arm64/assembler-arm64.h" // NOLINT | 51 #include "src/arm64/assembler-arm64.h" // NOLINT |
54 #include "src/arm64/assembler-arm64-inl.h" | 52 #include "src/arm64/assembler-arm64-inl.h" |
55 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
56 #include "src/arm64/macro-assembler-arm64.h" // NOLINT | 53 #include "src/arm64/macro-assembler-arm64.h" // NOLINT |
57 #include "src/arm64/macro-assembler-arm64-inl.h" | 54 #include "src/arm64/macro-assembler-arm64-inl.h" |
58 #elif V8_TARGET_ARCH_ARM | 55 #elif V8_TARGET_ARCH_ARM |
59 #include "src/arm/constants-arm.h" | 56 #include "src/arm/constants-arm.h" |
60 #include "src/assembler.h" | 57 #include "src/assembler.h" |
61 #include "src/arm/assembler-arm.h" // NOLINT | 58 #include "src/arm/assembler-arm.h" // NOLINT |
62 #include "src/arm/assembler-arm-inl.h" | 59 #include "src/arm/assembler-arm-inl.h" |
63 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
64 #include "src/arm/macro-assembler-arm.h" // NOLINT | 60 #include "src/arm/macro-assembler-arm.h" // NOLINT |
65 #elif V8_TARGET_ARCH_PPC | 61 #elif V8_TARGET_ARCH_PPC |
66 #include "src/ppc/constants-ppc.h" | 62 #include "src/ppc/constants-ppc.h" |
67 #include "src/assembler.h" // NOLINT | 63 #include "src/assembler.h" // NOLINT |
68 #include "src/ppc/assembler-ppc.h" // NOLINT | 64 #include "src/ppc/assembler-ppc.h" // NOLINT |
69 #include "src/ppc/assembler-ppc-inl.h" | 65 #include "src/ppc/assembler-ppc-inl.h" |
70 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
71 #include "src/ppc/macro-assembler-ppc.h" | 66 #include "src/ppc/macro-assembler-ppc.h" |
72 #elif V8_TARGET_ARCH_MIPS | 67 #elif V8_TARGET_ARCH_MIPS |
73 #include "src/mips/constants-mips.h" | 68 #include "src/mips/constants-mips.h" |
74 #include "src/assembler.h" // NOLINT | 69 #include "src/assembler.h" // NOLINT |
75 #include "src/mips/assembler-mips.h" // NOLINT | 70 #include "src/mips/assembler-mips.h" // NOLINT |
76 #include "src/mips/assembler-mips-inl.h" | 71 #include "src/mips/assembler-mips-inl.h" |
77 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
78 #include "src/mips/macro-assembler-mips.h" | 72 #include "src/mips/macro-assembler-mips.h" |
79 #elif V8_TARGET_ARCH_MIPS64 | 73 #elif V8_TARGET_ARCH_MIPS64 |
80 #include "src/mips64/constants-mips64.h" | 74 #include "src/mips64/constants-mips64.h" |
81 #include "src/assembler.h" // NOLINT | 75 #include "src/assembler.h" // NOLINT |
82 #include "src/mips64/assembler-mips64.h" // NOLINT | 76 #include "src/mips64/assembler-mips64.h" // NOLINT |
83 #include "src/mips64/assembler-mips64-inl.h" | 77 #include "src/mips64/assembler-mips64-inl.h" |
84 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
85 #include "src/mips64/macro-assembler-mips64.h" | 78 #include "src/mips64/macro-assembler-mips64.h" |
86 #elif V8_TARGET_ARCH_X87 | 79 #elif V8_TARGET_ARCH_X87 |
87 #include "src/assembler.h" | 80 #include "src/assembler.h" |
88 #include "src/x87/assembler-x87.h" | 81 #include "src/x87/assembler-x87.h" |
89 #include "src/x87/assembler-x87-inl.h" | 82 #include "src/x87/assembler-x87-inl.h" |
90 #include "src/code.h" // NOLINT, must be after assembler_*.h | |
91 #include "src/x87/macro-assembler-x87.h" | 83 #include "src/x87/macro-assembler-x87.h" |
92 #else | 84 #else |
93 #error Unsupported target architecture. | 85 #error Unsupported target architecture. |
94 #endif | 86 #endif |
95 | 87 |
96 namespace v8 { | 88 namespace v8 { |
97 namespace internal { | 89 namespace internal { |
98 | 90 |
99 class FrameScope { | 91 class FrameScope { |
100 public: | 92 public: |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 #else | 230 #else |
239 | 231 |
240 class Comment { | 232 class Comment { |
241 public: | 233 public: |
242 Comment(MacroAssembler*, const char*) {} | 234 Comment(MacroAssembler*, const char*) {} |
243 }; | 235 }; |
244 | 236 |
245 #endif // DEBUG | 237 #endif // DEBUG |
246 | 238 |
247 | 239 |
| 240 // Wrapper class for passing expected and actual parameter counts as |
| 241 // either registers or immediate values. Used to make sure that the |
| 242 // caller provides exactly the expected number of parameters to the |
| 243 // callee. |
| 244 class ParameterCount BASE_EMBEDDED { |
| 245 public: |
| 246 explicit ParameterCount(Register reg) : reg_(reg), immediate_(0) {} |
| 247 explicit ParameterCount(int imm) : reg_(no_reg), immediate_(imm) {} |
| 248 |
| 249 bool is_reg() const { return !reg_.is(no_reg); } |
| 250 bool is_immediate() const { return !is_reg(); } |
| 251 |
| 252 Register reg() const { |
| 253 DCHECK(is_reg()); |
| 254 return reg_; |
| 255 } |
| 256 int immediate() const { |
| 257 DCHECK(is_immediate()); |
| 258 return immediate_; |
| 259 } |
| 260 |
| 261 private: |
| 262 const Register reg_; |
| 263 const int immediate_; |
| 264 |
| 265 DISALLOW_IMPLICIT_CONSTRUCTORS(ParameterCount); |
| 266 }; |
| 267 |
| 268 |
248 class AllocationUtils { | 269 class AllocationUtils { |
249 public: | 270 public: |
250 static ExternalReference GetAllocationTopReference( | 271 static ExternalReference GetAllocationTopReference( |
251 Isolate* isolate, AllocationFlags flags) { | 272 Isolate* isolate, AllocationFlags flags) { |
252 if ((flags & PRETENURE) != 0) { | 273 if ((flags & PRETENURE) != 0) { |
253 return ExternalReference::old_space_allocation_top_address(isolate); | 274 return ExternalReference::old_space_allocation_top_address(isolate); |
254 } | 275 } |
255 return ExternalReference::new_space_allocation_top_address(isolate); | 276 return ExternalReference::new_space_allocation_top_address(isolate); |
256 } | 277 } |
257 | 278 |
258 | 279 |
259 static ExternalReference GetAllocationLimitReference( | 280 static ExternalReference GetAllocationLimitReference( |
260 Isolate* isolate, AllocationFlags flags) { | 281 Isolate* isolate, AllocationFlags flags) { |
261 if ((flags & PRETENURE) != 0) { | 282 if ((flags & PRETENURE) != 0) { |
262 return ExternalReference::old_space_allocation_limit_address(isolate); | 283 return ExternalReference::old_space_allocation_limit_address(isolate); |
263 } | 284 } |
264 return ExternalReference::new_space_allocation_limit_address(isolate); | 285 return ExternalReference::new_space_allocation_limit_address(isolate); |
265 } | 286 } |
266 }; | 287 }; |
267 | 288 |
268 | 289 |
269 } } // namespace v8::internal | 290 } } // namespace v8::internal |
270 | 291 |
271 #endif // V8_MACRO_ASSEMBLER_H_ | 292 #endif // V8_MACRO_ASSEMBLER_H_ |
OLD | NEW |