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

Unified Diff: src/snapshot/serializer-common.cc

Issue 2790573002: Encode any deoptimizer entry in serialized data. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« src/isolate.cc ('K') | « src/snapshot/serializer-common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serializer-common.cc
diff --git a/src/snapshot/serializer-common.cc b/src/snapshot/serializer-common.cc
index 89aabdf263b3e70534a3c248ab9002134edbb88d..e3037b6d4d1034257a9748eca984f000741a2f4e 100644
--- a/src/snapshot/serializer-common.cc
+++ b/src/snapshot/serializer-common.cc
@@ -4,6 +4,7 @@
#include "src/snapshot/serializer-common.h"
+#include "src/deoptimizer.h"
#include "src/external-reference-table.h"
#include "src/ic/stub-cache.h"
#include "src/list-inl.h"
@@ -12,7 +13,8 @@
namespace v8 {
namespace internal {
-ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) {
+ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate)
+ : isolate_(isolate) {
map_ = isolate->external_reference_map();
#ifdef DEBUG
table_ = ExternalReferenceTable::instance(isolate);
@@ -34,6 +36,18 @@ ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) {
uint32_t ExternalReferenceEncoder::Encode(Address address) const {
Maybe<uint32_t> maybe_index = map_->Get(address);
if (maybe_index.IsNothing()) {
+ int id =
+ Deoptimizer::GetDeoptimizationId(isolate_, address, Deoptimizer::EAGER);
+ if (id != Deoptimizer::kNotDeoptimizationEntry)
+ return id | ExternalReferenceTable::kEagerDeoptFlag;
+ id = Deoptimizer::GetDeoptimizationId(isolate_, address, Deoptimizer::LAZY);
+ if (id != Deoptimizer::kNotDeoptimizationEntry)
+ return id | ExternalReferenceTable::kLazyDeoptFlag;
+ id = Deoptimizer::GetDeoptimizationId(isolate_, address, Deoptimizer::SOFT);
+ if (id != Deoptimizer::kNotDeoptimizationEntry)
+ return id | ExternalReferenceTable::kSoftDeoptFlag;
+ }
+ if (maybe_index.IsNothing()) {
void* addr = address;
v8::base::OS::PrintError("Unknown external reference %p.\n", addr);
v8::base::OS::PrintError("%s", ExternalReferenceTable::ResolveSymbol(addr));
« src/isolate.cc ('K') | « src/snapshot/serializer-common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698