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

Side by Side Diff: src/assembler.h

Issue 1759873002: Assembler changes for enabling GrowHeap in Wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile Created 4 years, 9 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 | « src/arm64/assembler-arm64-inl.h ('k') | src/assembler.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) 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
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 // To relocate pointers into the wasm memory embedded in wasm code
389 WASM_MEMORY_REFERENCE,
388 390
389 // Everything after runtime_entry (inclusive) is not GC'ed. 391 // Everything after runtime_entry (inclusive) is not GC'ed.
390 RUNTIME_ENTRY, 392 RUNTIME_ENTRY,
391 COMMENT, 393 COMMENT,
392 POSITION, // See comment for kNoPosition above. 394 POSITION, // See comment for kNoPosition above.
393 STATEMENT_POSITION, // See comment for kNoPosition above. 395 STATEMENT_POSITION, // See comment for kNoPosition above.
394 396
395 // Additional code inserted for debug break slot. 397 // Additional code inserted for debug break slot.
396 DEBUG_BREAK_SLOT_AT_POSITION, 398 DEBUG_BREAK_SLOT_AT_POSITION,
397 DEBUG_BREAK_SLOT_AT_RETURN, 399 DEBUG_BREAK_SLOT_AT_RETURN,
(...skipping 22 matching lines...) Expand all
420 // Pseudo-types 422 // Pseudo-types
421 NUMBER_OF_MODES, 423 NUMBER_OF_MODES,
422 NONE32, // never recorded 32-bit value 424 NONE32, // never recorded 32-bit value
423 NONE64, // never recorded 64-bit value 425 NONE64, // never recorded 64-bit value
424 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by 426 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by
425 // code aging. 427 // code aging.
426 428
427 FIRST_REAL_RELOC_MODE = CODE_TARGET, 429 FIRST_REAL_RELOC_MODE = CODE_TARGET,
428 LAST_REAL_RELOC_MODE = VENEER_POOL, 430 LAST_REAL_RELOC_MODE = VENEER_POOL,
429 LAST_CODE_ENUM = DEBUGGER_STATEMENT, 431 LAST_CODE_ENUM = DEBUGGER_STATEMENT,
430 LAST_GCED_ENUM = CELL, 432 LAST_GCED_ENUM = WASM_MEMORY_REFERENCE,
433 FIRST_SHAREABLE_RELOC_MODE = CELL,
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
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 IsWasmMemoryReference(Mode mode) {
518 return mode == WASM_MEMORY_REFERENCE;
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 WriteBarrierMode write_barrier_mode = 570 WriteBarrierMode write_barrier_mode =
565 UPDATE_WRITE_BARRIER, 571 UPDATE_WRITE_BARRIER,
566 ICacheFlushMode icache_flush_mode = 572 ICacheFlushMode icache_flush_mode =
567 FLUSH_ICACHE_IF_NEEDED)); 573 FLUSH_ICACHE_IF_NEEDED));
568 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); 574 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin));
569 INLINE(Code* code_age_stub()); 575 INLINE(Code* code_age_stub());
570 INLINE(void set_code_age_stub(Code* stub, 576 INLINE(void set_code_age_stub(Code* stub,
571 ICacheFlushMode icache_flush_mode = 577 ICacheFlushMode icache_flush_mode =
572 FLUSH_ICACHE_IF_NEEDED)); 578 FLUSH_ICACHE_IF_NEEDED));
573 579
580 INLINE(Address wasm_memory_reference());
581 INLINE(void update_wasm_memory_reference(
582 Address old_base, Address new_base, size_t old_size, size_t new_size,
583 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH));
574 // Returns the address of the constant pool entry where the target address 584 // Returns the address of the constant pool entry where the target address
575 // is held. This should only be called if IsInConstantPool returns true. 585 // is held. This should only be called if IsInConstantPool returns true.
576 INLINE(Address constant_pool_entry_address()); 586 INLINE(Address constant_pool_entry_address());
577 587
578 // Read the address of the word containing the target_address in an 588 // Read the address of the word containing the target_address in an
579 // instruction stream. What this means exactly is architecture-independent. 589 // instruction stream. What this means exactly is architecture-independent.
580 // The only architecture-independent user of this function is the serializer. 590 // The only architecture-independent user of this function is the serializer.
581 // The serializer uses it to find out how many raw bytes of instruction to 591 // The serializer uses it to find out how many raw bytes of instruction to
582 // output before the next target. Architecture-independent code shouldn't 592 // output before the next target. Architecture-independent code shouldn't
583 // dereference the pointer it gets back from this. 593 // dereference the pointer it gets back from this.
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 std::vector<ConstantPoolEntry> shared_entries; 1311 std::vector<ConstantPoolEntry> shared_entries;
1302 }; 1312 };
1303 1313
1304 Label emitted_label_; // Records pc_offset of emitted pool 1314 Label emitted_label_; // Records pc_offset of emitted pool
1305 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; 1315 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES];
1306 }; 1316 };
1307 1317
1308 } // namespace internal 1318 } // namespace internal
1309 } // namespace v8 1319 } // namespace v8
1310 #endif // V8_ASSEMBLER_H_ 1320 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64-inl.h ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698