From b51f8f6656c07f91774622f61ef7995e9a817367 Mon Sep 17 00:00:00 2001 From: jgruber Date: Wed, 21 Mar 2018 12:12:49 +0100 Subject: [PATCH] Reland "Remove isolate.h include from external-reference.h" This is a reland of 25207bf8cb4cf881bc5e01de08c9d3f671a41026 Original change's description: > Remove isolate.h include from external-reference.h > > This triggers a bunch of other necessary include tweaks for files that > used to work until now because they indirectly included isolate.h > through external-reference.h. > > Bug: v8:6666 > Change-Id: I8d48db44dcc321fa32a6279f3ddacb41ab58f975 > Reviewed-on: https://chromium-review.googlesource.com/972042 > Commit-Queue: Jakob Gruber > Reviewed-by: Peter Marshall > Cr-Commit-Position: refs/heads/master@{#52103} TBR=petermarshall@chromium.org Bug: v8:6666 Change-Id: Ibbcf2c116dc3b202d325fd7644e8755ffe583ef1 Reviewed-on: https://chromium-review.googlesource.com/973062 Reviewed-by: Jakob Gruber Commit-Queue: Jakob Gruber Cr-Commit-Position: refs/heads/master@{#52108} --- src/arm/codegen-arm.cc | 1 + src/arm64/codegen-arm64.cc | 1 + src/assembler.h | 4 ++++ src/compiler/instruction-scheduler.cc | 1 + src/deoptimizer.h | 1 + src/external-reference-table.h | 1 + src/external-reference.cc | 13 +++++++++++++ src/external-reference.h | 12 ++---------- src/ia32/codegen-ia32.cc | 1 + src/ic/ic.h | 2 ++ src/interface-descriptors.h | 1 + src/macro-assembler.h | 1 + src/mips/codegen-mips.cc | 1 + src/mips64/codegen-mips64.cc | 1 + src/ppc/codegen-ppc.cc | 1 + src/regexp/jsregexp.h | 1 + src/s390/codegen-s390.cc | 1 + src/x64/codegen-x64.cc | 1 + 18 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index b3e880e048..ff439f8259 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -9,6 +9,7 @@ #include "src/arm/assembler-arm-inl.h" #include "src/arm/simulator-arm.h" #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" namespace v8 { diff --git a/src/arm64/codegen-arm64.cc b/src/arm64/codegen-arm64.cc index 1016e3707a..ad77033280 100644 --- a/src/arm64/codegen-arm64.cc +++ b/src/arm64/codegen-arm64.cc @@ -8,6 +8,7 @@ #include "src/arm64/macro-assembler-arm64-inl.h" #include "src/arm64/simulator-arm64.h" #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" namespace v8 { diff --git a/src/assembler.h b/src/assembler.h index ed286467ae..29f20e3d93 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -37,13 +37,17 @@ #include #include +#include #include "src/allocation.h" +#include "src/contexts.h" #include "src/deoptimize-reason.h" #include "src/double.h" #include "src/external-reference.h" +#include "src/flags.h" #include "src/globals.h" #include "src/label.h" +#include "src/objects.h" #include "src/register-configuration.h" #include "src/reglist.h" diff --git a/src/compiler/instruction-scheduler.cc b/src/compiler/instruction-scheduler.cc index 7df8541127..5d39b900b9 100644 --- a/src/compiler/instruction-scheduler.cc +++ b/src/compiler/instruction-scheduler.cc @@ -6,6 +6,7 @@ #include "src/base/adapters.h" #include "src/base/utils/random-number-generator.h" +#include "src/isolate.h" namespace v8 { namespace internal { diff --git a/src/deoptimizer.h b/src/deoptimizer.h index e5c08e1235..eddcdbcf70 100644 --- a/src/deoptimizer.h +++ b/src/deoptimizer.h @@ -14,6 +14,7 @@ #include "src/deoptimize-reason.h" #include "src/feedback-vector.h" #include "src/frame-constants.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/source-position.h" #include "src/zone/zone-chunk-list.h" diff --git a/src/external-reference-table.h b/src/external-reference-table.h index 7513736efb..3a1e7ca7e8 100644 --- a/src/external-reference-table.h +++ b/src/external-reference-table.h @@ -7,6 +7,7 @@ #include +#include "src/accessors.h" #include "src/address-map.h" #include "src/builtins/builtins.h" #include "src/external-reference.h" diff --git a/src/external-reference.cc b/src/external-reference.cc index 69975a947b..e67afe4102 100644 --- a/src/external-reference.cc +++ b/src/external-reference.cc @@ -15,6 +15,7 @@ #include "src/heap/heap.h" #include "src/ic/stub-cache.h" #include "src/interpreter/interpreter.h" +#include "src/isolate.h" #include "src/objects-inl.h" #include "src/regexp/regexp-stack.h" #include "src/string-search.h" @@ -213,6 +214,18 @@ void ExternalReference::set_redirector( reinterpret_cast(redirector)); } +// static +void* ExternalReference::Redirect(Isolate* isolate, Address address_arg, + Type type) { + ExternalReferenceRedirector* redirector = + reinterpret_cast( + isolate->external_reference_redirector()); + void* address = reinterpret_cast(address_arg); + void* answer = + (redirector == nullptr) ? address : (*redirector)(address, type); + return answer; +} + ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { return ExternalReference(isolate->stress_deopt_count_address()); } diff --git a/src/external-reference.h b/src/external-reference.h index c9f40728cd..21f4bc32ba 100644 --- a/src/external-reference.h +++ b/src/external-reference.h @@ -6,7 +6,6 @@ #define V8_EXTERNAL_REFERENCE_H_ #include "src/globals.h" -#include "src/isolate.h" #include "src/runtime/runtime.h" namespace v8 { @@ -16,6 +15,7 @@ class ApiFunction; namespace internal { class Isolate; +class Page; class SCTableReference; class StatsCounter; @@ -286,15 +286,7 @@ class ExternalReference BASE_EMBEDDED { explicit ExternalReference(void* address) : address_(address) {} static void* Redirect(Isolate* isolate, Address address_arg, - Type type = ExternalReference::BUILTIN_CALL) { - ExternalReferenceRedirector* redirector = - reinterpret_cast( - isolate->external_reference_redirector()); - void* address = reinterpret_cast(address_arg); - void* answer = - (redirector == nullptr) ? address : (*redirector)(address, type); - return answer; - } + Type type = ExternalReference::BUILTIN_CALL); void* address_; }; diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index ffe3c9150b..2acd35cf96 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -7,6 +7,7 @@ #include "src/codegen.h" #include "src/factory-inl.h" #include "src/heap/heap.h" +#include "src/isolate.h" #include "src/macro-assembler.h" namespace v8 { diff --git a/src/ic/ic.h b/src/ic/ic.h index b5ec6cda2c..99035af589 100644 --- a/src/ic/ic.h +++ b/src/ic/ic.h @@ -9,6 +9,8 @@ #include "src/factory.h" #include "src/feedback-vector.h" +#include "src/ic/stub-cache.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/messages.h" #include "src/objects/map.h" diff --git a/src/interface-descriptors.h b/src/interface-descriptors.h index c47eed475e..61da0c3f4e 100644 --- a/src/interface-descriptors.h +++ b/src/interface-descriptors.h @@ -9,6 +9,7 @@ #include "src/assembler.h" #include "src/globals.h" +#include "src/isolate.h" #include "src/macro-assembler.h" namespace v8 { diff --git a/src/macro-assembler.h b/src/macro-assembler.h index fcdddbb1fa..a78476a82a 100644 --- a/src/macro-assembler.h +++ b/src/macro-assembler.h @@ -7,6 +7,7 @@ #include "src/assembler.h" #include "src/frames.h" +#include "src/heap/heap.h" // Helper types to make boolean flag easier to read at call-site. enum InvokeFlag { diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc index b2e52745ed..4641090cbc 100644 --- a/src/mips/codegen-mips.cc +++ b/src/mips/codegen-mips.cc @@ -7,6 +7,7 @@ #include #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/mips/simulator-mips.h" diff --git a/src/mips64/codegen-mips64.cc b/src/mips64/codegen-mips64.cc index 7b2fbd78a5..d51ead5a6c 100644 --- a/src/mips64/codegen-mips64.cc +++ b/src/mips64/codegen-mips64.cc @@ -7,6 +7,7 @@ #include #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/mips64/simulator-mips64.h" diff --git a/src/ppc/codegen-ppc.cc b/src/ppc/codegen-ppc.cc index b54a44c6ed..a2a9013b1c 100644 --- a/src/ppc/codegen-ppc.cc +++ b/src/ppc/codegen-ppc.cc @@ -7,6 +7,7 @@ #include #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/ppc/simulator-ppc.h" diff --git a/src/regexp/jsregexp.h b/src/regexp/jsregexp.h index 021c59d3e4..5a386f8fe0 100644 --- a/src/regexp/jsregexp.h +++ b/src/regexp/jsregexp.h @@ -7,6 +7,7 @@ #include "src/allocation.h" #include "src/assembler.h" +#include "src/isolate.h" #include "src/objects/js-regexp.h" #include "src/regexp/regexp-ast.h" #include "src/regexp/regexp-macro-assembler.h" diff --git a/src/s390/codegen-s390.cc b/src/s390/codegen-s390.cc index ecec9cb408..badecb461e 100644 --- a/src/s390/codegen-s390.cc +++ b/src/s390/codegen-s390.cc @@ -7,6 +7,7 @@ #include #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/s390/simulator-s390.h" diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index ee2cfd5e8b..056d3d01f6 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -5,6 +5,7 @@ #if V8_TARGET_ARCH_X64 #include "src/codegen.h" +#include "src/isolate.h" #include "src/macro-assembler.h" #include "src/x64/assembler-x64-inl.h"