OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 int32_t lo_32 = static_cast<int32_t>(value); | 835 int32_t lo_32 = static_cast<int32_t>(value); |
836 | 836 |
837 iihf(r1, Operand(hi_32)); | 837 iihf(r1, Operand(hi_32)); |
838 iilf(r1, Operand(lo_32)); | 838 iilf(r1, Operand(lo_32)); |
839 #else | 839 #else |
840 iilf(r1, Operand(reinterpret_cast<uint32_t>(&v8::base::OS::DebugBreak))); | 840 iilf(r1, Operand(reinterpret_cast<uint32_t>(&v8::base::OS::DebugBreak))); |
841 #endif | 841 #endif |
842 basr(r14, r1); | 842 basr(r14, r1); |
843 } | 843 } |
844 | 844 |
845 void call(Handle<Code> target, RelocInfo::Mode rmode, | 845 void call(Handle<Code> target, RelocInfo::Mode rmode); |
846 TypeFeedbackId ast_id = TypeFeedbackId::None()); | |
847 void jump(Handle<Code> target, RelocInfo::Mode rmode, Condition cond); | 846 void jump(Handle<Code> target, RelocInfo::Mode rmode, Condition cond); |
848 | 847 |
849 // S390 instruction generation | 848 // S390 instruction generation |
850 #define I_FORM(name) void name(const Operand& i) | 849 #define I_FORM(name) void name(const Operand& i) |
851 | 850 |
852 #define RR_FORM(name) void name(Register r1, Register r2) | 851 #define RR_FORM(name) void name(Register r1, Register r2) |
853 | 852 |
854 #define RR2_FORM(name) void name(Condition m1, Register r2) | 853 #define RR2_FORM(name) void name(Condition m1, Register r2) |
855 | 854 |
856 #define RI1_FORM(name) void name(Register r, const Operand& i) | 855 #define RI1_FORM(name) void name(Register r, const Operand& i) |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 // Check the code size generated from label to here. | 1265 // Check the code size generated from label to here. |
1267 int SizeOfCodeGeneratedSince(Label* label) { | 1266 int SizeOfCodeGeneratedSince(Label* label) { |
1268 return pc_offset() - label->pos(); | 1267 return pc_offset() - label->pos(); |
1269 } | 1268 } |
1270 | 1269 |
1271 // Debugging | 1270 // Debugging |
1272 | 1271 |
1273 // Mark address of a debug break slot. | 1272 // Mark address of a debug break slot. |
1274 void RecordDebugBreakSlot(RelocInfo::Mode mode); | 1273 void RecordDebugBreakSlot(RelocInfo::Mode mode); |
1275 | 1274 |
1276 // Record the AST id of the CallIC being compiled, so that it can be placed | |
1277 // in the relocation information. | |
1278 void SetRecordedAstId(TypeFeedbackId ast_id) { recorded_ast_id_ = ast_id; } | |
1279 | |
1280 TypeFeedbackId RecordedAstId() { | |
1281 // roohack - another issue??? DCHECK(!recorded_ast_id_.IsNone()); | |
1282 return recorded_ast_id_; | |
1283 } | |
1284 | |
1285 void ClearRecordedAstId() { recorded_ast_id_ = TypeFeedbackId::None(); } | |
1286 | |
1287 // Record a comment relocation entry that can be used by a disassembler. | 1275 // Record a comment relocation entry that can be used by a disassembler. |
1288 // Use --code-comments to enable. | 1276 // Use --code-comments to enable. |
1289 void RecordComment(const char* msg); | 1277 void RecordComment(const char* msg); |
1290 | 1278 |
1291 // Record a deoptimization reason that can be used by a log or cpu profiler. | 1279 // Record a deoptimization reason that can be used by a log or cpu profiler. |
1292 // Use --trace-deopt to enable. | 1280 // Use --trace-deopt to enable. |
1293 void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position, | 1281 void RecordDeoptReason(DeoptimizeReason reason, SourcePosition position, |
1294 int id); | 1282 int id); |
1295 | 1283 |
1296 // Writes a single byte or word of data in the code stream. Used | 1284 // Writes a single byte or word of data in the code stream. Used |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 // This function allows outside callers to check and grow the buffer | 1333 // This function allows outside callers to check and grow the buffer |
1346 void EnsureSpaceFor(int space_needed); | 1334 void EnsureSpaceFor(int space_needed); |
1347 | 1335 |
1348 void EmitRelocations(); | 1336 void EmitRelocations(); |
1349 void emit_label_addr(Label* label); | 1337 void emit_label_addr(Label* label); |
1350 | 1338 |
1351 public: | 1339 public: |
1352 byte* buffer_pos() const { return buffer_; } | 1340 byte* buffer_pos() const { return buffer_; } |
1353 | 1341 |
1354 protected: | 1342 protected: |
1355 // Relocation for a type-recording IC has the AST id added to it. This | |
1356 // member variable is a way to pass the information from the call site to | |
1357 // the relocation info. | |
1358 TypeFeedbackId recorded_ast_id_; | |
1359 | |
1360 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1343 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
1361 | 1344 |
1362 // Decode instruction(s) at pos and return backchain to previous | 1345 // Decode instruction(s) at pos and return backchain to previous |
1363 // label reference or kEndOfChain. | 1346 // label reference or kEndOfChain. |
1364 int target_at(int pos); | 1347 int target_at(int pos); |
1365 | 1348 |
1366 // Patch instruction(s) at pos to target target_pos (e.g. branch) | 1349 // Patch instruction(s) at pos to target target_pos (e.g. branch) |
1367 void target_at_put(int pos, int target_pos, bool* is_branch = nullptr); | 1350 void target_at_put(int pos, int target_pos, bool* is_branch = nullptr); |
1368 | 1351 |
1369 // Record reloc info for current pc_ | 1352 // Record reloc info for current pc_ |
(...skipping 19 matching lines...) Expand all Loading... |
1389 // The bound position, before this we cannot do instruction elimination. | 1372 // The bound position, before this we cannot do instruction elimination. |
1390 int last_bound_pos_; | 1373 int last_bound_pos_; |
1391 | 1374 |
1392 // Code emission | 1375 // Code emission |
1393 inline void CheckBuffer(); | 1376 inline void CheckBuffer(); |
1394 void GrowBuffer(int needed = 0); | 1377 void GrowBuffer(int needed = 0); |
1395 inline void TrackBranch(); | 1378 inline void TrackBranch(); |
1396 inline void UntrackBranch(); | 1379 inline void UntrackBranch(); |
1397 | 1380 |
1398 inline int32_t emit_code_target( | 1381 inline int32_t emit_code_target( |
1399 Handle<Code> target, RelocInfo::Mode rmode, | 1382 Handle<Code> target, RelocInfo::Mode rmode); |
1400 TypeFeedbackId ast_id = TypeFeedbackId::None()); | |
1401 | 1383 |
1402 // Helpers to emit binary encoding of 2/4/6 byte instructions. | 1384 // Helpers to emit binary encoding of 2/4/6 byte instructions. |
1403 inline void emit2bytes(uint16_t x); | 1385 inline void emit2bytes(uint16_t x); |
1404 inline void emit4bytes(uint32_t x); | 1386 inline void emit4bytes(uint32_t x); |
1405 inline void emit6bytes(uint64_t x); | 1387 inline void emit6bytes(uint64_t x); |
1406 | 1388 |
1407 // Helpers to emit binary encoding for various instruction formats. | 1389 // Helpers to emit binary encoding for various instruction formats. |
1408 | 1390 |
1409 inline void rr2_form(uint8_t op, Condition m1, Register r2); | 1391 inline void rr2_form(uint8_t op, Condition m1, Register r2); |
1410 | 1392 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 | 1464 |
1483 class EnsureSpace BASE_EMBEDDED { | 1465 class EnsureSpace BASE_EMBEDDED { |
1484 public: | 1466 public: |
1485 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } | 1467 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } |
1486 }; | 1468 }; |
1487 | 1469 |
1488 } // namespace internal | 1470 } // namespace internal |
1489 } // namespace v8 | 1471 } // namespace v8 |
1490 | 1472 |
1491 #endif // V8_S390_ASSEMBLER_S390_H_ | 1473 #endif // V8_S390_ASSEMBLER_S390_H_ |
OLD | NEW |