Revert of Replace LANGUAGE_END with LAST_LANGUAGE_MODE (patchset #1 id:1 of https://codereview.chromium.org/2257703003/ )
Reason for revert: Needed to land revert https://codereview.chromium.org/2257133002/ Original issue's description: > Replace LANGUAGE_END with LAST_LANGUAGE_MODE > > BUG= > > Committed: https://crrev.com/9324efca85710ebb14f21ef8476447e21cbe3f35 > Cr-Commit-Position: refs/heads/master@{#38707} TBR=neis@chromium.org,marja@chromium.org,verwaest@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review-Url: https://codereview.chromium.org/2259853002 Cr-Commit-Position: refs/heads/master@{#38713}
This commit is contained in:
parent
4a1f2807d6
commit
8fdf6031a5
@ -496,7 +496,7 @@ class Scope: public ZoneObject {
|
||||
// Scope-specific information computed during parsing.
|
||||
//
|
||||
// The language mode of this scope.
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
LanguageMode language_mode_ : 1;
|
||||
// This scope is inside a 'with' of some outer scope.
|
||||
bool scope_inside_with_ : 1;
|
||||
|
@ -1846,7 +1846,7 @@ class StoreGlobalViaContextStub final : public PlatformCodeStub {
|
||||
class DepthBits : public BitField<int, 0, 4> {};
|
||||
STATIC_ASSERT(DepthBits::kMax == kMaximumDepth);
|
||||
class LanguageModeBits : public BitField<LanguageMode, 4, 1> {};
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
|
||||
DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreGlobalViaContext);
|
||||
DEFINE_PLATFORM_CODE_STUB(StoreGlobalViaContext, PlatformCodeStub);
|
||||
|
@ -272,7 +272,7 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List;
|
||||
|
||||
// The Strict Mode (ECMA-262 5th edition, 4.2.2).
|
||||
|
||||
enum LanguageMode : uint32_t { SLOPPY, STRICT, LAST_LANGUAGE_MODE = STRICT };
|
||||
enum LanguageMode : uint32_t { SLOPPY, STRICT, LANGUAGE_END };
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const LanguageMode& mode) {
|
||||
switch (mode) {
|
||||
|
@ -258,7 +258,7 @@ class StoreICState final BASE_EMBEDDED {
|
||||
}
|
||||
|
||||
class LanguageModeState : public BitField<LanguageMode, 1, 1> {};
|
||||
STATIC_ASSERT(i::LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(i::LANGUAGE_END == 2);
|
||||
|
||||
// For convenience, a statically declared encoding of strict mode extra
|
||||
// IC state.
|
||||
|
@ -6015,14 +6015,14 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) {
|
||||
|
||||
|
||||
LanguageMode SharedFunctionInfo::language_mode() {
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
return construct_language_mode(
|
||||
BooleanBit::get(compiler_hints(), kStrictModeFunction));
|
||||
}
|
||||
|
||||
|
||||
void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) {
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
// We only allow language mode transitions that set the same language mode
|
||||
// again or go up in the chain:
|
||||
DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode));
|
||||
|
@ -9168,7 +9168,7 @@ Handle<Map> Map::AsLanguageMode(Handle<Map> initial_map,
|
||||
Handle<Map> function_map(
|
||||
Map::cast(isolate->native_context()->get(map_index)));
|
||||
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
DCHECK_EQ(STRICT, language_mode);
|
||||
Handle<Symbol> transition_symbol =
|
||||
isolate->factory()->strict_function_transition_symbol();
|
||||
@ -16013,7 +16013,7 @@ class StringSharedKey : public HashTableKey {
|
||||
// collection.
|
||||
Script* script(Script::cast(shared->script()));
|
||||
hash ^= String::cast(script->source())->Hash();
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
if (is_strict(language_mode)) hash ^= 0x8000;
|
||||
hash += scope_position;
|
||||
}
|
||||
|
@ -4404,7 +4404,7 @@ class ScopeInfo : public FixedArray {
|
||||
// Properties of scopes.
|
||||
class ScopeTypeField : public BitField<ScopeType, 0, 4> {};
|
||||
class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {};
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
class LanguageModeField
|
||||
: public BitField<LanguageMode, CallsEvalField::kNext, 1> {};
|
||||
class DeclarationScopeField
|
||||
|
@ -175,7 +175,7 @@ class ParseInfo {
|
||||
return construct_language_mode(is_strict_mode());
|
||||
}
|
||||
void set_language_mode(LanguageMode language_mode) {
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
set_strict_mode(is_strict(language_mode));
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ class AllocateTargetSpace : public BitField<AllocationSpace, 1, 3> {};
|
||||
|
||||
class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {};
|
||||
class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {};
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 1> {};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -65,7 +65,7 @@ const double kIntegerValues[] = {-V8_INFINITY, INT_MIN, -1000.0, -42.0,
|
||||
Type* const kJSTypes[] = {Type::Undefined(), Type::Null(), Type::Boolean(),
|
||||
Type::Number(), Type::String(), Type::Object()};
|
||||
|
||||
STATIC_ASSERT(LAST_LANGUAGE_MODE == 1);
|
||||
STATIC_ASSERT(LANGUAGE_END == 2);
|
||||
const LanguageMode kLanguageModes[] = {SLOPPY, STRICT};
|
||||
|
||||
} // namespace
|
||||
|
Loading…
Reference in New Issue
Block a user