summaryrefslogtreecommitdiff
path: root/chromium/v8/src/snapshot
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 17:15:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:47:18 +0000
commit7324afb043a0b1e623d8e8eb906cdc53bdeb4685 (patch)
treea3fe2d74ea9c9e142c390dac4ca0e219382ace46 /chromium/v8/src/snapshot
parent6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (diff)
downloadqtwebengine-chromium-7324afb043a0b1e623d8e8eb906cdc53bdeb4685.tar.gz
BASELINE: Update Chromium to 58.0.3029.54
Change-Id: I67f57065a7afdc8e4614adb5c0230281428df4d1 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/v8/src/snapshot')
-rw-r--r--chromium/v8/src/snapshot/code-serializer.cc42
-rw-r--r--chromium/v8/src/snapshot/code-serializer.h20
-rw-r--r--chromium/v8/src/snapshot/deserializer.cc6
-rw-r--r--chromium/v8/src/snapshot/deserializer.h2
-rw-r--r--chromium/v8/src/snapshot/partial-serializer.cc4
-rw-r--r--chromium/v8/src/snapshot/serializer-common.cc3
-rw-r--r--chromium/v8/src/snapshot/serializer.cc2
-rw-r--r--chromium/v8/src/snapshot/snapshot-common.cc1
8 files changed, 54 insertions, 26 deletions
diff --git a/chromium/v8/src/snapshot/code-serializer.cc b/chromium/v8/src/snapshot/code-serializer.cc
index 1776cf1e4f7..7f57f0aa645 100644
--- a/chromium/v8/src/snapshot/code-serializer.cc
+++ b/chromium/v8/src/snapshot/code-serializer.cc
@@ -7,8 +7,10 @@
#include <memory>
#include "src/code-stubs.h"
+#include "src/counters.h"
#include "src/log.h"
#include "src/macro-assembler.h"
+#include "src/objects-inl.h"
#include "src/snapshot/deserializer.h"
#include "src/snapshot/snapshot.h"
#include "src/version.h"
@@ -229,14 +231,20 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
return scope.CloseAndEscape(result);
}
+WasmCompiledModuleSerializer::WasmCompiledModuleSerializer(
+ Isolate* isolate, uint32_t source_hash, Handle<Context> native_context,
+ Handle<SeqOneByteString> module_bytes)
+ : CodeSerializer(isolate, source_hash) {
+ reference_map()->AddAttachedReference(*isolate->native_context());
+ reference_map()->AddAttachedReference(*module_bytes);
+}
+
std::unique_ptr<ScriptData> WasmCompiledModuleSerializer::SerializeWasmModule(
Isolate* isolate, Handle<FixedArray> input) {
Handle<WasmCompiledModule> compiled_module =
Handle<WasmCompiledModule>::cast(input);
- WasmCompiledModuleSerializer wasm_cs(isolate, 0);
- wasm_cs.reference_map()->AddAttachedReference(*isolate->native_context());
- wasm_cs.reference_map()->AddAttachedReference(
- compiled_module->module_bytes());
+ WasmCompiledModuleSerializer wasm_cs(isolate, 0, isolate->native_context(),
+ handle(compiled_module->module_bytes()));
ScriptData* data = wasm_cs.Serialize(compiled_module);
return std::unique_ptr<ScriptData>(data);
}
@@ -281,11 +289,35 @@ MaybeHandle<FixedArray> WasmCompiledModuleSerializer::DeserializeWasmModule(
Handle<WasmCompiledModule> compiled_module(
static_cast<WasmCompiledModule*>(*obj.ToHandleChecked()), isolate);
- WasmCompiledModule::RecreateModuleWrapper(isolate, compiled_module);
+ WasmCompiledModule::ReinitializeAfterDeserialization(isolate,
+ compiled_module);
DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module));
return compiled_module;
}
+void WasmCompiledModuleSerializer::SerializeCodeObject(
+ Code* code_object, HowToCode how_to_code, WhereToPoint where_to_point) {
+ Code::Kind kind = code_object->kind();
+ switch (kind) {
+ case Code::WASM_FUNCTION:
+ case Code::JS_TO_WASM_FUNCTION:
+ // Just serialize the code_object.
+ break;
+ case Code::WASM_TO_JS_FUNCTION:
+ // Serialize the illegal builtin instead. On instantiation of a
+ // deserialized module, these will be replaced again.
+ code_object = *isolate()->builtins()->Illegal();
+ break;
+ default:
+ UNREACHABLE();
+ }
+ SerializeGeneric(code_object, how_to_code, where_to_point);
+}
+
+bool WasmCompiledModuleSerializer::ElideObject(Object* obj) {
+ return obj->IsWeakCell() || obj->IsForeign() || obj->IsBreakPointInfo();
+}
+
class Checksum {
public:
explicit Checksum(Vector<const byte> payload) {
diff --git a/chromium/v8/src/snapshot/code-serializer.h b/chromium/v8/src/snapshot/code-serializer.h
index 15757379f02..4d87a731f75 100644
--- a/chromium/v8/src/snapshot/code-serializer.h
+++ b/chromium/v8/src/snapshot/code-serializer.h
@@ -64,23 +64,13 @@ class WasmCompiledModuleSerializer : public CodeSerializer {
protected:
void SerializeCodeObject(Code* code_object, HowToCode how_to_code,
- WhereToPoint where_to_point) override {
- Code::Kind kind = code_object->kind();
- if (kind == Code::WASM_FUNCTION || kind == Code::WASM_TO_JS_FUNCTION ||
- kind == Code::JS_TO_WASM_FUNCTION) {
- SerializeGeneric(code_object, how_to_code, where_to_point);
- } else {
- UNREACHABLE();
- }
- }
-
- bool ElideObject(Object* obj) override {
- return obj->IsWeakCell() || obj->IsForeign();
- };
+ WhereToPoint where_to_point) override;
+ bool ElideObject(Object* obj) override;
private:
- WasmCompiledModuleSerializer(Isolate* isolate, uint32_t source_hash)
- : CodeSerializer(isolate, source_hash) {}
+ WasmCompiledModuleSerializer(Isolate* isolate, uint32_t source_hash,
+ Handle<Context> native_context,
+ Handle<SeqOneByteString> module_bytes);
DISALLOW_COPY_AND_ASSIGN(WasmCompiledModuleSerializer);
};
diff --git a/chromium/v8/src/snapshot/deserializer.cc b/chromium/v8/src/snapshot/deserializer.cc
index 87e430baf5e..86d20e14c02 100644
--- a/chromium/v8/src/snapshot/deserializer.cc
+++ b/chromium/v8/src/snapshot/deserializer.cc
@@ -4,13 +4,17 @@
#include "src/snapshot/deserializer.h"
+#include "src/api.h"
+#include "src/assembler-inl.h"
#include "src/bootstrapper.h"
#include "src/external-reference-table.h"
-#include "src/heap/heap.h"
+#include "src/heap/heap-inl.h"
#include "src/isolate.h"
#include "src/macro-assembler.h"
+#include "src/objects-inl.h"
#include "src/snapshot/natives.h"
#include "src/v8.h"
+#include "src/v8threads.h"
namespace v8 {
namespace internal {
diff --git a/chromium/v8/src/snapshot/deserializer.h b/chromium/v8/src/snapshot/deserializer.h
index 7b1ced81592..0348956eb68 100644
--- a/chromium/v8/src/snapshot/deserializer.h
+++ b/chromium/v8/src/snapshot/deserializer.h
@@ -84,7 +84,7 @@ class Deserializer : public SerializerDeserializer {
DCHECK_EQ(kWordAligned, next_alignment_);
int alignment = data - (kAlignmentPrefix - 1);
DCHECK_LE(kWordAligned, alignment);
- DCHECK_LE(alignment, kSimd128Unaligned);
+ DCHECK_LE(alignment, kDoubleUnaligned);
next_alignment_ = static_cast<AllocationAlignment>(alignment);
}
diff --git a/chromium/v8/src/snapshot/partial-serializer.cc b/chromium/v8/src/snapshot/partial-serializer.cc
index b78a1edbd06..7f30c9cd04b 100644
--- a/chromium/v8/src/snapshot/partial-serializer.cc
+++ b/chromium/v8/src/snapshot/partial-serializer.cc
@@ -93,10 +93,6 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
// Clear literal boilerplates.
if (obj->IsJSFunction()) {
JSFunction* function = JSFunction::cast(obj);
- LiteralsArray* literals = function->literals();
- for (int i = 0; i < literals->literals_count(); i++) {
- literals->set_literal_undefined(i);
- }
function->ClearTypeFeedbackInfo();
}
diff --git a/chromium/v8/src/snapshot/serializer-common.cc b/chromium/v8/src/snapshot/serializer-common.cc
index ca4db752398..89aabdf263b 100644
--- a/chromium/v8/src/snapshot/serializer-common.cc
+++ b/chromium/v8/src/snapshot/serializer-common.cc
@@ -7,6 +7,7 @@
#include "src/external-reference-table.h"
#include "src/ic/stub-cache.h"
#include "src/list-inl.h"
+#include "src/objects-inl.h"
namespace v8 {
namespace internal {
@@ -21,6 +22,8 @@ ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) {
ExternalReferenceTable* table = ExternalReferenceTable::instance(isolate);
for (uint32_t i = 0; i < table->size(); ++i) {
Address addr = table->address(i);
+ // Ignore duplicate API references.
+ if (table->is_api_reference(i) && !map_->Get(addr).IsNothing()) continue;
DCHECK(map_->Get(addr).IsNothing());
map_->Set(addr, i);
DCHECK(map_->Get(addr).IsJust());
diff --git a/chromium/v8/src/snapshot/serializer.cc b/chromium/v8/src/snapshot/serializer.cc
index 2e971e34071..d99ca2ab306 100644
--- a/chromium/v8/src/snapshot/serializer.cc
+++ b/chromium/v8/src/snapshot/serializer.cc
@@ -4,6 +4,8 @@
#include "src/snapshot/serializer.h"
+#include "src/assembler-inl.h"
+#include "src/heap/heap-inl.h"
#include "src/macro-assembler.h"
#include "src/snapshot/natives.h"
diff --git a/chromium/v8/src/snapshot/snapshot-common.cc b/chromium/v8/src/snapshot/snapshot-common.cc
index 83ad2e7d394..1658b3bdcf3 100644
--- a/chromium/v8/src/snapshot/snapshot-common.cc
+++ b/chromium/v8/src/snapshot/snapshot-common.cc
@@ -9,6 +9,7 @@
#include "src/api.h"
#include "src/base/platform/platform.h"
#include "src/full-codegen/full-codegen.h"
+#include "src/objects-inl.h"
#include "src/snapshot/deserializer.h"
#include "src/snapshot/snapshot-source-sink.h"
#include "src/version.h"