Commit ca52a45a authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[snapshot] Refactored snapshot functions to no longer copy.

Bug: v8:8015
Change-Id: Id459da19e009b2203b12ba04d185dc857e4913c1
Reviewed-on: https://chromium-review.googlesource.com/1209786Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55700}
parent 292c3ed7
......@@ -50,7 +50,7 @@ BuiltinSnapshotUtils::BytecodeFromIndex(int index) {
// static
void BuiltinSnapshotUtils::ForEachBytecode(
std::function<void(Bytecode, OperandScale)> f) {
const std::function<void(Bytecode, OperandScale)>& f) {
static const OperandScale kOperandScales[] = {
#define VALUE(Name, _) OperandScale::k##Name,
OPERAND_SCALE_LIST(VALUE)
......
......@@ -52,7 +52,8 @@ class BuiltinSnapshotUtils : public AllStatic {
// Iteration over all {bytecode,operand_scale} pairs. Implemented here since
// (de)serialization depends on the iteration order.
static void ForEachBytecode(std::function<void(Bytecode, OperandScale)> f);
static void ForEachBytecode(
const std::function<void(Bytecode, OperandScale)>& f);
#endif // V8_EMBEDDED_BYTECODE_HANDLERS
};
......
......@@ -121,7 +121,7 @@ HeapObject* DefaultDeserializerAllocator::GetObject(AllocationSpace space,
}
void DefaultDeserializerAllocator::DecodeReservation(
std::vector<SerializedData::Reservation> res) {
const std::vector<SerializedData::Reservation>& res) {
DCHECK_EQ(0, reservations_[FIRST_SPACE].size());
int current_space = FIRST_SPACE;
for (auto& r : res) {
......
......@@ -58,7 +58,7 @@ class DefaultDeserializerAllocator final {
// ------- Reservation Methods -------
// Methods related to memory reservations (prior to deserialization).
void DecodeReservation(std::vector<SerializedData::Reservation> res);
void DecodeReservation(const std::vector<SerializedData::Reservation>& res);
bool ReserveSpace();
// Atomically reserves space for the two given deserializers. Guarantees
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment