Commit Graph

15 Commits

Author SHA1 Message Date
neis
659e8f7b5c [compiler] Delay allocation of code-embedded heap numbers.
Instead of allocating and embedding certain heap numbers into the code
during code assembly, emit dummies but record the allocation requests.
Later then, in Assembler::GetCode, allocate the heap numbers and patch
the code by replacing the dummies with the actual objects. The
RelocInfos for the embedded objects are already recorded correctly when
emitting the dummies.

R=jarin@chromium.org
BUG=v8:6048

Review-Url: https://codereview.chromium.org/2900683002
Cr-Commit-Position: refs/heads/master@{#45635}
2017-05-31 14:00:11 +00:00
neis
94b088ca3c Disentangle assembler from isolate.
This is a first step towards moving Turbofan code generation off the main thread.

Summary of the changes:
- AssemblerBase no longer has a pointer to the isolate. Instead, its
  constructor receives the few things that it needs from the isolate (on most
  architectures this is just the serializer_enabled flag).
- RelocInfo no longer has a pointer to the isolate. Instead, the functions
  that need it take it as an argument.  (There are currently still a few that
  implicitly access the isolate through a HeapObject.)
- The MacroAssembler now explicitly holds a pointer to the isolate (before, it
  used to get it from the Assembler).
- The jit_cookie also moved from AssemblerBase to the MacroAssemblers, since
  it's not used at all in the Assemblers.
- A few architectures implemented parts of the Assembler with the help
  of a Codepatcher that is based on MacroAssembler.  Since the Assembler no
  longer has the isolate, but the MacroAssembler still needs it, this doesn't
  work anymore.  Instead, these Assemblers now use a new PatchingAssembler.

BUG=v8:6048

Review-Url: https://codereview.chromium.org/2732273003
Cr-Commit-Position: refs/heads/master@{#43890}
2017-03-17 11:18:06 +00:00
Clemens Hammacher
7d8a3028dd [wasm] Fix code specialization for empty memory buffer
From asm.js code we might get an empty ArrayBuffer as heap memory. In
this case, both the old memory start and the new memory start will be
nullptr. The size however has to be patched from default_size to 0.

This CL changes code specialization to be able to either patch memory
references, or patch memory sizes or both.

R=titzer@chromium.org, ahaas@chromium.org
BUG=chromium:698587

Change-Id: I4d9d811d75cb83842f23df317e8e7fc02aeb5146
Reviewed-on: https://chromium-review.googlesource.com/450257
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43613}
2017-03-06 13:39:54 +00:00
Marja Hölttä
83849da70f [iwyu] Pre-work for removing unallowed include macro-assembler.h -> assembler-inl.h
BUG=v8:5294

Change-Id: If45f25aae8de526027b7851cb4efe0ccf4a7c4b1
Reviewed-on: https://chromium-review.googlesource.com/444226
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43388}
2017-02-23 12:10:21 +00:00
ulan
9c25d5dc6e [wasm] Fix more -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2492793005
Cr-Commit-Position: refs/heads/master@{#40914}
2016-11-11 11:56:05 +00:00
ulan
3505406bc7 [wasm] Fix -Wsign-compare warnings.
BUG=v8:5614

Review-Url: https://codereview.chromium.org/2487673004
Cr-Commit-Position: refs/heads/master@{#40891}
2016-11-10 12:51:05 +00:00
gdeepti
117a56b7c2 Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory size references in generated code.
- Add new RelocInfo mode WASM_MEMORY_SIZE_REFERENCE in the assembler and add relocation information to immediates in compare instructions.
 - Use relocatable constants for MemSize/BoundsCheck in the wasm compiler

R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org

Review-Url: https://codereview.chromium.org/1921203002
Cr-Commit-Position: refs/heads/master@{#36044}
2016-05-04 20:20:50 +00:00
gdeepti
52148c41c9 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org

Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
Cr-Commit-Position: refs/heads/master@{#35182}

Committed: https://crrev.com/297932a302ce0b73c3618ef9e4eba9d9d241f2b3
Cr-Commit-Position: refs/heads/master@{#35400}

Review URL: https://codereview.chromium.org/1759383003

Cr-Commit-Position: refs/heads/master@{#35407}
2016-04-12 09:07:00 +00:00
machenbach
3f69393a90 Revert of [compiler] Add relocatable pointer constants for wasm memory references. (patchset #15 id:320001 of https://codereview.chromium.org/1759383003/ )
Reason for revert:
[Sheriff] Breaks msan:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/builds/7842

Original issue's description:
> [compiler] Add relocatable pointer constants for wasm memory references.
>
> Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.
>
> R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
> Cr-Commit-Position: refs/heads/master@{#35182}
>
> Committed: https://crrev.com/297932a302ce0b73c3618ef9e4eba9d9d241f2b3
> Cr-Commit-Position: refs/heads/master@{#35400}

TBR=bradnelson@chromium.org,titzer@chromium.org,bmeurer@chromium.org,bradnelson@google.com,gdeepti@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1881913002

Cr-Commit-Position: refs/heads/master@{#35401}
2016-04-12 07:49:19 +00:00
gdeepti
297932a302 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org

Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
Cr-Commit-Position: refs/heads/master@{#35182}

Review URL: https://codereview.chromium.org/1759383003

Cr-Commit-Position: refs/heads/master@{#35400}
2016-04-11 22:35:04 +00:00
yangguo
2069ab2202 Revert of [compiler] Add relocatable pointer constants for wasm memory references. (patchset #14 id:300001 of https://codereview.chromium.org/1759383003/ )
Reason for revert:
Test failures: https://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/8046

Original issue's description:
> [compiler] Add relocatable pointer constants for wasm memory references.
>
> Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.
>
> R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org
>
> Committed: https://crrev.com/eb5fe0df64ec0add423b2a1f6fb62d5a33dce2a5
> Cr-Commit-Position: refs/heads/master@{#35182}

TBR=bradnelson@chromium.org,titzer@chromium.org,gdeepti@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1846083005

Cr-Commit-Position: refs/heads/master@{#35185}
2016-04-01 05:53:17 +00:00
gdeepti
eb5fe0df64 [compiler] Add relocatable pointer constants for wasm memory references.
Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

R=titzer@chromium.org, yangguo@chromium.org, bradnelson@chromium.org

Review URL: https://codereview.chromium.org/1759383003

Cr-Commit-Position: refs/heads/master@{#35182}
2016-04-01 00:41:35 +00:00
gdeepti
e1a7c1e76c Assembler changes for enabling GrowHeap in Wasm
- New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
 - RelocInfo mode recorded for immediates that use the memory buffer as base
 - Tests to verify address patching works

BUG=

Committed: https://crrev.com/cc815b69c17da368107ed77306a5bb161170c834
Cr-Commit-Position: refs/heads/master@{#34831}

Review URL: https://codereview.chromium.org/1759873002

Cr-Commit-Position: refs/heads/master@{#34836}
2016-03-16 18:15:49 +00:00
machenbach
894bc100c3 Revert of Assembler changes for enabling GrowHeap in Wasm (patchset #13 id:260001 of https://codereview.chromium.org/1759873002/ )
Reason for revert:
Breaks compile:
https://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/7740

Probably had outdated tryjobs

Original issue's description:
> Assembler changes for enabling GrowHeap in Wasm
>  - New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
>  - RelocInfo mode recorded for immediates that use the memory buffer as base
>  - Tests to verify address patching works
>
> BUG=
>
> Committed: https://crrev.com/cc815b69c17da368107ed77306a5bb161170c834
> Cr-Commit-Position: refs/heads/master@{#34831}

TBR=titzer@chromium.org,yangguo@chromium.org,bradnelson@chromium.org,bradnelson@google.com,marija.antic@imgtec.com,gdeepti@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1808823002

Cr-Commit-Position: refs/heads/master@{#34832}
2016-03-16 17:28:44 +00:00
gdeepti
cc815b69c1 Assembler changes for enabling GrowHeap in Wasm
- New RelocInfo mode WASM_MEMORY_REFERENCE as a marker for wasm code objects that need to be relocated on a heap change
 - RelocInfo mode recorded for immediates that use the memory buffer as base
 - Tests to verify address patching works

BUG=

Review URL: https://codereview.chromium.org/1759873002

Cr-Commit-Position: refs/heads/master@{#34831}
2016-03-16 17:11:42 +00:00