[compiler] Use vector to hold translation array

ZoneChunkList has more overhead than a simple ZoneVector for storing
uint8_t bytes.

Bug: v8:9684
Change-Id: I5e22286f2628ae2010086e9d82cadbebb176dbee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2661459
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72525}
This commit is contained in:
Sathya Gunasekaran 2021-02-01 05:52:49 +00:00 committed by Commit Bot
parent 527754fbae
commit a9eff909e9
2 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,9 @@ Handle<TranslationArray> TranslationArrayBuilder::ToTranslationArray(
Factory* factory) {
Handle<TranslationArray> result =
factory->NewByteArray(Size(), AllocationType::kOld);
contents_.CopyTo(result->GetDataStartAddress());
memcpy(result->GetDataStartAddress(), contents_.data(),
contents_.size() * sizeof(uint8_t));
return result;
}

View File

@ -9,7 +9,7 @@
#include "src/deoptimizer/translation-opcode.h"
#include "src/objects/fixed-array.h"
#include "src/wasm/value-type.h"
#include "src/zone/zone-chunk-list.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
@ -103,7 +103,7 @@ class TranslationArrayBuilder {
Zone* zone() const { return zone_; }
ZoneChunkList<uint8_t> contents_;
ZoneVector<uint8_t> contents_;
Zone* const zone_;
};