Upgrade V8 to 8.8.278.14
Bug: 162604069
Bug: 167389063
Test: gts-tradefed run gts-dev --module GtsGmscoreHostTestCases
--test com.google.android.gts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \
/data/nativetest/proxy_resolver_v8_unittest/proxy_resolver_v8_unittest
Merged-In: Ifb09923b9d7f6d8990fb062d7dc0294edf2c098e
Change-Id: Ifb09923b9d7f6d8990fb062d7dc0294edf2c098e
(cherry picked from commit 9580a23bc5b8874a0979001d3595d027cbb68128)
diff --git a/src/ast/variables.cc b/src/ast/variables.cc
index cd1d8f7..da2d838 100644
--- a/src/ast/variables.cc
+++ b/src/ast/variables.cc
@@ -5,8 +5,8 @@
#include "src/ast/variables.h"
#include "src/ast/scopes.h"
-#include "src/globals.h"
-#include "src/objects-inl.h"
+#include "src/common/globals.h"
+#include "src/objects/objects-inl.h"
namespace v8 {
namespace internal {
@@ -14,32 +14,35 @@
// ----------------------------------------------------------------------------
// Implementation Variable.
-Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode,
- VariableKind kind, InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag)
- : scope_(scope),
- name_(name),
+Variable::Variable(Variable* other)
+ : scope_(other->scope_),
+ name_(other->name_),
local_if_not_shadowed_(nullptr),
next_(nullptr),
- index_(-1),
- initializer_position_(kNoSourcePosition),
- bit_field_(MaybeAssignedFlagField::encode(maybe_assigned_flag) |
- InitializationFlagField::encode(initialization_flag) |
- VariableModeField::encode(mode) | IsUsedField::encode(false) |
- ForceContextAllocationField::encode(false) |
- LocationField::encode(VariableLocation::UNALLOCATED) |
- VariableKindField::encode(kind)) {
- // Var declared variables never need initialization.
- DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization));
-}
-
+ index_(other->index_),
+ initializer_position_(other->initializer_position_),
+ bit_field_(other->bit_field_) {}
bool Variable::IsGlobalObjectProperty() const {
// Temporaries are never global, they must always be allocated in the
// activation frame.
- return (IsDynamicVariableMode(mode()) || mode() == VAR) &&
+ return (IsDynamicVariableMode(mode()) || mode() == VariableMode::kVar) &&
scope_ != nullptr && scope_->is_script_scope();
}
+bool Variable::IsReplGlobalLet() const {
+ return scope()->is_repl_mode_scope() && mode() == VariableMode::kLet;
+}
+
+void Variable::RewriteLocationForRepl() {
+ DCHECK(scope_->is_repl_mode_scope());
+
+ if (mode() == VariableMode::kLet) {
+ DCHECK_EQ(location(), VariableLocation::CONTEXT);
+ bit_field_ =
+ LocationField::update(bit_field_, VariableLocation::REPL_GLOBAL);
+ }
+}
+
} // namespace internal
} // namespace v8