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

Side by Side Diff: src/external-reference-table.cc

Issue 2790573002: Encode any deoptimizer entry in serialized data. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/external-reference-table.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/external-reference-table.h" 5 #include "src/external-reference-table.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/builtins/builtins.h" 9 #include "src/builtins/builtins.h"
10 #include "src/counters.h" 10 #include "src/counters.h"
(...skipping 27 matching lines...) Expand all
38 38
39 ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) { 39 ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) {
40 // nullptr is preserved through serialization/deserialization. 40 // nullptr is preserved through serialization/deserialization.
41 Add(nullptr, "nullptr"); 41 Add(nullptr, "nullptr");
42 AddReferences(isolate); 42 AddReferences(isolate);
43 AddBuiltins(isolate); 43 AddBuiltins(isolate);
44 AddRuntimeFunctions(isolate); 44 AddRuntimeFunctions(isolate);
45 AddIsolateAddresses(isolate); 45 AddIsolateAddresses(isolate);
46 AddAccessors(isolate); 46 AddAccessors(isolate);
47 AddStubCache(isolate); 47 AddStubCache(isolate);
48 AddDeoptEntries(isolate);
49 // API references must be added last. 48 // API references must be added last.
50 AddApiReferences(isolate); 49 AddApiReferences(isolate);
51 } 50 }
52 51
53 #ifdef DEBUG 52 #ifdef DEBUG
54 void ExternalReferenceTable::ResetCount() { 53 void ExternalReferenceTable::ResetCount() {
55 for (ExternalReferenceEntry& entry : refs_) entry.count = 0; 54 for (ExternalReferenceEntry& entry : refs_) entry.count = 0;
56 } 55 }
57 56
58 void ExternalReferenceTable::PrintCount() { 57 void ExternalReferenceTable::PrintCount() {
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 Add(store_stub_cache->map_reference(StubCache::kPrimary).address(), 423 Add(store_stub_cache->map_reference(StubCache::kPrimary).address(),
425 "Store StubCache::primary_->map"); 424 "Store StubCache::primary_->map");
426 Add(store_stub_cache->key_reference(StubCache::kSecondary).address(), 425 Add(store_stub_cache->key_reference(StubCache::kSecondary).address(),
427 "Store StubCache::secondary_->key"); 426 "Store StubCache::secondary_->key");
428 Add(store_stub_cache->value_reference(StubCache::kSecondary).address(), 427 Add(store_stub_cache->value_reference(StubCache::kSecondary).address(),
429 "Store StubCache::secondary_->value"); 428 "Store StubCache::secondary_->value");
430 Add(store_stub_cache->map_reference(StubCache::kSecondary).address(), 429 Add(store_stub_cache->map_reference(StubCache::kSecondary).address(),
431 "Store StubCache::secondary_->map"); 430 "Store StubCache::secondary_->map");
432 } 431 }
433 432
434 void ExternalReferenceTable::AddDeoptEntries(Isolate* isolate) {
435 // Add a small set of deopt entry addresses to encoder without generating
436 // the
437 // deopt table code, which isn't possible at deserialization time.
438 HandleScope scope(isolate);
439 for (int entry = 0; entry < kDeoptTableSerializeEntryCount; ++entry) {
440 Address address = Deoptimizer::GetDeoptimizationEntry(
441 isolate, entry, Deoptimizer::LAZY,
442 Deoptimizer::CALCULATE_ENTRY_ADDRESS);
443 Add(address, "lazy_deopt");
444 }
445 }
446
447 void ExternalReferenceTable::AddApiReferences(Isolate* isolate) { 433 void ExternalReferenceTable::AddApiReferences(Isolate* isolate) {
448 // Add external references provided by the embedder (a null-terminated 434 // Add external references provided by the embedder (a null-terminated
449 // array). 435 // array).
450 api_refs_start_ = size(); 436 api_refs_start_ = size();
451 intptr_t* api_external_references = isolate->api_external_references(); 437 intptr_t* api_external_references = isolate->api_external_references();
452 if (api_external_references != nullptr) { 438 if (api_external_references != nullptr) {
453 while (*api_external_references != 0) { 439 while (*api_external_references != 0) {
454 Address address = reinterpret_cast<Address>(*api_external_references); 440 Address address = reinterpret_cast<Address>(*api_external_references);
455 Add(address, ResolveSymbol(address)); 441 Add(address, ResolveSymbol(address));
456 api_external_references++; 442 api_external_references++;
457 } 443 }
458 } 444 }
459 } 445 }
460 446
461 } // namespace internal 447 } // namespace internal
462 } // namespace v8 448 } // namespace v8
OLDNEW
« no previous file with comments | « src/external-reference-table.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698