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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 // The maximum pc delta that will use the short encoding. | 378 // The maximum pc delta that will use the short encoding. |
379 static const int kMaxSmallPCDelta; | 379 static const int kMaxSmallPCDelta; |
380 | 380 |
381 enum Mode { | 381 enum Mode { |
382 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). | 382 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
383 CODE_TARGET, // Code target which is not any of the above. | 383 CODE_TARGET, // Code target which is not any of the above. |
384 CODE_TARGET_WITH_ID, | 384 CODE_TARGET_WITH_ID, |
385 DEBUGGER_STATEMENT, // Code target for the debugger statement. | 385 DEBUGGER_STATEMENT, // Code target for the debugger statement. |
386 EMBEDDED_OBJECT, | 386 EMBEDDED_OBJECT, |
387 CELL, | 387 CELL, |
388 // Marker for relocation when the heap changes, used only on wasm code | |
389 // objects | |
Yang
2016/03/03 06:21:56
Can you change the comment to say "To relocate poi
gdeepti1
2016/03/03 18:00:10
Done.
| |
390 WASM_HEAP_OBJECT, | |
titzer
2016/03/03 18:11:59
Can we name this WASM_MEMORY_REFERENCE?
We've bee
gdeepti1
2016/03/03 22:59:15
Done.
| |
388 | 391 |
389 // Everything after runtime_entry (inclusive) is not GC'ed. | 392 // Everything after runtime_entry (inclusive) is not GC'ed. |
390 RUNTIME_ENTRY, | 393 RUNTIME_ENTRY, |
391 COMMENT, | 394 COMMENT, |
392 POSITION, // See comment for kNoPosition above. | 395 POSITION, // See comment for kNoPosition above. |
393 STATEMENT_POSITION, // See comment for kNoPosition above. | 396 STATEMENT_POSITION, // See comment for kNoPosition above. |
394 | 397 |
395 // Additional code inserted for debug break slot. | 398 // Additional code inserted for debug break slot. |
396 DEBUG_BREAK_SLOT_AT_POSITION, | 399 DEBUG_BREAK_SLOT_AT_POSITION, |
397 DEBUG_BREAK_SLOT_AT_RETURN, | 400 DEBUG_BREAK_SLOT_AT_RETURN, |
(...skipping 22 matching lines...) Expand all Loading... | |
420 // Pseudo-types | 423 // Pseudo-types |
421 NUMBER_OF_MODES, | 424 NUMBER_OF_MODES, |
422 NONE32, // never recorded 32-bit value | 425 NONE32, // never recorded 32-bit value |
423 NONE64, // never recorded 64-bit value | 426 NONE64, // never recorded 64-bit value |
424 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 427 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
425 // code aging. | 428 // code aging. |
426 | 429 |
427 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 430 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
428 LAST_REAL_RELOC_MODE = VENEER_POOL, | 431 LAST_REAL_RELOC_MODE = VENEER_POOL, |
429 LAST_CODE_ENUM = DEBUGGER_STATEMENT, | 432 LAST_CODE_ENUM = DEBUGGER_STATEMENT, |
430 LAST_GCED_ENUM = CELL, | 433 LAST_GCED_ENUM = WASM_HEAP_OBJECT, |
431 }; | 434 }; |
432 | 435 |
433 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); | 436 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); |
434 | 437 |
435 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { | 438 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { |
436 DCHECK_NOT_NULL(isolate); | 439 DCHECK_NOT_NULL(isolate); |
437 } | 440 } |
438 | 441 |
439 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) | 442 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) |
440 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) { | 443 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 } | 507 } |
505 static inline bool IsNone(Mode mode) { | 508 static inline bool IsNone(Mode mode) { |
506 return mode == NONE32 || mode == NONE64; | 509 return mode == NONE32 || mode == NONE64; |
507 } | 510 } |
508 static inline bool IsCodeAgeSequence(Mode mode) { | 511 static inline bool IsCodeAgeSequence(Mode mode) { |
509 return mode == CODE_AGE_SEQUENCE; | 512 return mode == CODE_AGE_SEQUENCE; |
510 } | 513 } |
511 static inline bool IsGeneratorContinuation(Mode mode) { | 514 static inline bool IsGeneratorContinuation(Mode mode) { |
512 return mode == GENERATOR_CONTINUATION; | 515 return mode == GENERATOR_CONTINUATION; |
513 } | 516 } |
517 static inline bool IsWasmCodeEntry(Mode mode) { | |
Yang
2016/03/03 06:21:56
This name is misleading. I would have thought that
gdeepti1
2016/03/03 18:00:10
Name was left over from a previous RelocInfo mode
titzer
2016/03/03 18:11:59
As above, IsWasmMemoryReference, for consistency.
| |
518 return mode == WASM_HEAP_OBJECT; | |
519 } | |
514 static inline int ModeMask(Mode mode) { return 1 << mode; } | 520 static inline int ModeMask(Mode mode) { return 1 << mode; } |
515 | 521 |
516 // Accessors | 522 // Accessors |
517 Isolate* isolate() const { return isolate_; } | 523 Isolate* isolate() const { return isolate_; } |
518 byte* pc() const { return pc_; } | 524 byte* pc() const { return pc_; } |
519 void set_pc(byte* pc) { pc_ = pc; } | 525 void set_pc(byte* pc) { pc_ = pc; } |
520 Mode rmode() const { return rmode_; } | 526 Mode rmode() const { return rmode_; } |
521 intptr_t data() const { return data_; } | 527 intptr_t data() const { return data_; } |
522 Code* host() const { return host_; } | 528 Code* host() const { return host_; } |
523 void set_host(Code* host) { host_ = host; } | 529 void set_host(Code* host) { host_ = host; } |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1281 std::vector<ConstantPoolEntry> shared_entries; | 1287 std::vector<ConstantPoolEntry> shared_entries; |
1282 }; | 1288 }; |
1283 | 1289 |
1284 Label emitted_label_; // Records pc_offset of emitted pool | 1290 Label emitted_label_; // Records pc_offset of emitted pool |
1285 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1291 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
1286 }; | 1292 }; |
1287 | 1293 |
1288 } // namespace internal | 1294 } // namespace internal |
1289 } // namespace v8 | 1295 } // namespace v8 |
1290 #endif // V8_ASSEMBLER_H_ | 1296 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |