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

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: 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 heap embedded in wasm code
titzer 2016/03/07 19:39:23 s/wasm heap/wasm memory/
gdeepti1 2016/03/08 03:38:50 Done.
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,
431 }; 433 };
432 434
433 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); 435 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt);
434 436
435 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { 437 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) {
436 DCHECK_NOT_NULL(isolate); 438 DCHECK_NOT_NULL(isolate);
437 } 439 }
438 440
439 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) 441 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host)
440 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) { 442 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 506 }
505 static inline bool IsNone(Mode mode) { 507 static inline bool IsNone(Mode mode) {
506 return mode == NONE32 || mode == NONE64; 508 return mode == NONE32 || mode == NONE64;
507 } 509 }
508 static inline bool IsCodeAgeSequence(Mode mode) { 510 static inline bool IsCodeAgeSequence(Mode mode) {
509 return mode == CODE_AGE_SEQUENCE; 511 return mode == CODE_AGE_SEQUENCE;
510 } 512 }
511 static inline bool IsGeneratorContinuation(Mode mode) { 513 static inline bool IsGeneratorContinuation(Mode mode) {
512 return mode == GENERATOR_CONTINUATION; 514 return mode == GENERATOR_CONTINUATION;
513 } 515 }
516 static inline bool IsWasmMemoryReference(Mode mode) {
517 return mode == WASM_MEMORY_REFERENCE;
518 }
514 static inline int ModeMask(Mode mode) { return 1 << mode; } 519 static inline int ModeMask(Mode mode) { return 1 << mode; }
515 520
516 // Accessors 521 // Accessors
517 Isolate* isolate() const { return isolate_; } 522 Isolate* isolate() const { return isolate_; }
518 byte* pc() const { return pc_; } 523 byte* pc() const { return pc_; }
519 void set_pc(byte* pc) { pc_ = pc; } 524 void set_pc(byte* pc) { pc_ = pc; }
520 Mode rmode() const { return rmode_; } 525 Mode rmode() const { return rmode_; }
521 intptr_t data() const { return data_; } 526 intptr_t data() const { return data_; }
522 Code* host() const { return host_; } 527 Code* host() const { return host_; }
523 void set_host(Code* host) { host_ = host; } 528 void set_host(Code* host) { host_ = host; }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 WriteBarrierMode write_barrier_mode = 569 WriteBarrierMode write_barrier_mode =
565 UPDATE_WRITE_BARRIER, 570 UPDATE_WRITE_BARRIER,
566 ICacheFlushMode icache_flush_mode = 571 ICacheFlushMode icache_flush_mode =
567 FLUSH_ICACHE_IF_NEEDED)); 572 FLUSH_ICACHE_IF_NEEDED));
568 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); 573 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin));
569 INLINE(Code* code_age_stub()); 574 INLINE(Code* code_age_stub());
570 INLINE(void set_code_age_stub(Code* stub, 575 INLINE(void set_code_age_stub(Code* stub,
571 ICacheFlushMode icache_flush_mode = 576 ICacheFlushMode icache_flush_mode =
572 FLUSH_ICACHE_IF_NEEDED)); 577 FLUSH_ICACHE_IF_NEEDED));
573 578
579 INLINE(Address wasm_memory_reference());
580 INLINE(void update_wasm_memory_reference(
titzer 2016/03/07 19:39:23 As per previous comments, let's do an update inter
gdeepti1 2016/03/08 03:38:50 Misunderstood previous review comment, updated the
581 Address reference,
582 ICacheFlushMode icache_flush_mode = SKIP_ICACHE_FLUSH));
574 // Returns the address of the constant pool entry where the target address 583 // Returns the address of the constant pool entry where the target address
575 // is held. This should only be called if IsInConstantPool returns true. 584 // is held. This should only be called if IsInConstantPool returns true.
576 INLINE(Address constant_pool_entry_address()); 585 INLINE(Address constant_pool_entry_address());
577 586
578 // Read the address of the word containing the target_address in an 587 // Read the address of the word containing the target_address in an
579 // instruction stream. What this means exactly is architecture-independent. 588 // instruction stream. What this means exactly is architecture-independent.
580 // The only architecture-independent user of this function is the serializer. 589 // 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 590 // 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 591 // output before the next target. Architecture-independent code shouldn't
583 // dereference the pointer it gets back from this. 592 // dereference the pointer it gets back from this.
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 std::vector<ConstantPoolEntry> shared_entries; 1306 std::vector<ConstantPoolEntry> shared_entries;
1298 }; 1307 };
1299 1308
1300 Label emitted_label_; // Records pc_offset of emitted pool 1309 Label emitted_label_; // Records pc_offset of emitted pool
1301 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; 1310 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES];
1302 }; 1311 };
1303 1312
1304 } // namespace internal 1313 } // namespace internal
1305 } // namespace v8 1314 } // namespace v8
1306 #endif // V8_ASSEMBLER_H_ 1315 #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