[vm] Remove dead code.

TEST=ci
Change-Id: Ic162deea4a39869a158726616e5c8dc0ff058817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475781
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-01-27 09:14:39 -08:00
committed by Commit Queue
parent d3ecc0f8a7
commit 1dc4277e5b
51 changed files with 3 additions and 660 deletions
-16
View File
@@ -210,22 +210,6 @@ bool DartUtils::IsDartSchemeURL(const char* url_name) {
return (strncmp(url_name, kDartScheme, kDartSchemeLen) == 0);
}
bool DartUtils::IsDartIOLibURL(const char* url_name) {
return (strcmp(url_name, kIOLibURL) == 0);
}
bool DartUtils::IsDartCLILibURL(const char* url_name) {
return (strcmp(url_name, kCLILibURL) == 0);
}
bool DartUtils::IsDartHttpLibURL(const char* url_name) {
return (strcmp(url_name, kHttpLibURL) == 0);
}
bool DartUtils::IsDartBuiltinLibURL(const char* url_name) {
return (strcmp(url_name, kBuiltinLibURL) == 0);
}
char* DartUtils::DirName(const char* url) {
const char* slash = strrchr(url, File::PathSeparator()[0]);
if (slash == nullptr) {
-4
View File
@@ -178,10 +178,6 @@ class DartUtils {
const char* name,
const char* val);
static bool IsDartSchemeURL(const char* url_name);
static bool IsDartIOLibURL(const char* url_name);
static bool IsDartCLILibURL(const char* url_name);
static bool IsDartHttpLibURL(const char* url_name);
static bool IsDartBuiltinLibURL(const char* url_name);
// Returns directory name including the last path separator.
//
+1 -2
View File
@@ -2481,8 +2481,7 @@ class LibraryDeserializationCluster : public DeserializationCluster {
lib->untag()->index_ = d.Read<int32_t>();
lib->untag()->num_imports_ = d.Read<uint16_t>();
lib->untag()->load_state_ = d.Read<int8_t>();
lib->untag()->flags_ =
UntaggedLibrary::InFullSnapshotBit::update(true, d.Read<uint8_t>());
lib->untag()->flags_ = d.Read<uint8_t>();
#if !defined(DART_PRECOMPILED_RUNTIME)
ASSERT(d_->kind() != Snapshot::kFullAOT);
lib->untag()->kernel_library_index_ = d.Read<uint32_t>();
-19
View File
@@ -894,25 +894,6 @@ void ClassFinalizer::PrintClassInformation(const Class& cls) {
}
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
void ClassFinalizer::ReportError(const Error& error) {
Report::LongJump(error);
UNREACHABLE();
}
void ClassFinalizer::ReportError(const char* format, ...) {
va_list args;
va_start(args, format);
const Script& null_script = Script::Handle();
Report::MessageV(Report::kError, null_script, TokenPosition::kNoSource,
Report::AtLocation, format, args);
va_end(args);
UNREACHABLE();
}
#if !defined(DART_PRECOMPILED_RUNTIME)
void ClassFinalizer::VerifyImplicitFieldOffsets() {
#ifdef DEBUG
Thread* thread = Thread::Current();
-3
View File
@@ -97,9 +97,6 @@ class ClassFinalizer : public AllStatic {
static void PrintClassInformation(const Class& cls);
#endif // !defined(DART_PRECOMPILED_RUNTIME)
static void ReportError(const Error& error);
static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
#if !defined(DART_PRECOMPILED_RUNTIME)
// Verify implicit offsets recorded in the VM for direct access to fields of
// Dart instances (e.g: _TypedListView, _ByteDataView).
@@ -4418,24 +4418,6 @@ Fragment StreamingFlowGraphBuilder::BuildNullLiteral(TokenPosition* position) {
return Constant(Instance::ZoneHandle(Z, Instance::null()));
}
Fragment StreamingFlowGraphBuilder::BuildFutureNullValue(
TokenPosition* position) {
if (position != nullptr) *position = TokenPosition::kNoSource;
const Class& future = Class::Handle(Z, IG->object_store()->future_class());
ASSERT(!future.IsNull());
const auto& error = future.EnsureIsFinalized(thread());
ASSERT(error == Error::null());
Function& constructor = Function::ZoneHandle(
Z, Resolver::ResolveFunction(Z, future, Symbols::FutureValue()));
ASSERT(!constructor.IsNull());
Fragment instructions;
instructions += BuildNullLiteral(position);
instructions += StaticCall(TokenPosition::kNoSource, constructor,
/* argument_count = */ 1, ICData::kStatic);
return instructions;
}
Fragment StreamingFlowGraphBuilder::BuildConstantExpression(
TokenPosition* position,
Tag tag) {
@@ -340,7 +340,6 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper {
Fragment BuildDoubleLiteral(TokenPosition* position);
Fragment BuildBoolLiteral(bool value, TokenPosition* position);
Fragment BuildNullLiteral(TokenPosition* position);
Fragment BuildFutureNullValue(TokenPosition* position);
Fragment BuildConstantExpression(TokenPosition* position, Tag tag);
Fragment BuildPartialTearoffInstantiation(TokenPosition* position);
Fragment BuildLibraryPrefixAction(TokenPosition* position,
@@ -39,7 +39,6 @@ class KernelFingerprintHelper : public KernelReaderHelper {
void CalculateListOfDartTypesFingerprint();
void CalculateListOfVariableDeclarationsFingerprint();
void CalculateStringReferenceFingerprint();
void CalculateListOfStringsFingerprint();
void CalculateTypeParameterFingerprint();
void CalculateTypeParametersListFingerprint();
void CalculateCanonicalNameFingerprint();
@@ -138,13 +137,6 @@ void KernelFingerprintHelper::CalculateStringReferenceFingerprint() {
H.DartString(ReadStringReference()).Hash()); // read ith string index.
}
void KernelFingerprintHelper::CalculateListOfStringsFingerprint() {
intptr_t list_length = ReadListLength(); // read list length.
for (intptr_t i = 0; i < list_length; ++i) {
CalculateStringReferenceFingerprint(); // read ith string index.
}
}
void KernelFingerprintHelper::CalculateListOfVariableDeclarationsFingerprint() {
intptr_t list_length = ReadListLength(); // read list length.
for (intptr_t i = 0; i < list_length; ++i) {
+2 -2
View File
@@ -43,7 +43,7 @@ struct RelocatorTestHelper {
explicit RelocatorTestHelper(Thread* thread)
: thread(thread),
locker(thread, thread->isolate_group()->program_lock()),
safepoint_and_growth_scope(thread, SafepointLevel::kGC) {
safepoint_scope(thread) {
// So the relocator uses the correct instruction size layout.
FLAG_precompiled_mode = true;
@@ -272,7 +272,7 @@ struct RelocatorTestHelper {
Thread* thread;
SafepointWriteRwLocker locker;
ForceGrowthSafepointOperationScope safepoint_and_growth_scope;
GcSafepointOperationScope safepoint_scope;
GrowableArray<const Code*> codes;
};
-1
View File
@@ -64,7 +64,6 @@ DEFINE_FLAG(bool, trace_shutdown, false, "Trace VM shutdown on stderr");
Isolate* Dart::vm_isolate_ = nullptr;
int64_t Dart::start_time_micros_ = 0;
ThreadPool* Dart::thread_pool_ = nullptr;
DebugInfo* Dart::pprof_symbol_generator_ = nullptr;
ReadOnlyHandles* Dart::predefined_handles_ = nullptr;
Snapshot::Kind Dart::vm_snapshot_kind_ = Snapshot::kInvalid;
Dart_ThreadStartCallback Dart::thread_start_callback_ = nullptr;
-7
View File
@@ -16,7 +16,6 @@
namespace dart {
// Forward declarations.
class DebugInfo;
class Isolate;
class LocalHandle;
class ReadOnlyHandles;
@@ -78,11 +77,6 @@ class Dart : public AllStatic {
return UptimeMicros() / kMicrosecondsPerMillisecond;
}
static void set_pprof_symbol_generator(DebugInfo* value) {
pprof_symbol_generator_ = value;
}
static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; }
static LocalHandle* AllocateReadOnlyApiHandle();
static bool IsReadOnlyApiHandle(Dart_Handle handle);
@@ -158,7 +152,6 @@ class Dart : public AllStatic {
static Isolate* vm_isolate_;
static int64_t start_time_micros_;
static ThreadPool* thread_pool_;
static DebugInfo* pprof_symbol_generator_;
static ReadOnlyHandles* predefined_handles_;
static Snapshot::Kind vm_snapshot_kind_;
static Dart_ThreadStartCallback thread_start_callback_;
-19
View File
@@ -413,11 +413,6 @@ intptr_t ArgumentsDescriptor::PositionAt(intptr_t index) const {
return Smi::Value(Smi::RawCast(array_.At(offset)));
}
bool ArgumentsDescriptor::MatchesNameAt(intptr_t index,
const String& other) const {
return NameAt(index) == other.ptr();
}
ArrayPtr ArgumentsDescriptor::GetArgumentNames() const {
const intptr_t num_named_args = NamedCount();
if (num_named_args == 0) {
@@ -824,20 +819,6 @@ ObjectPtr DartLibraryCalls::DrainMicrotaskQueue() {
return result.ptr();
}
ObjectPtr DartLibraryCalls::EnsureScheduleImmediate() {
Zone* zone = Thread::Current()->zone();
const Library& async_lib = Library::Handle(zone, Library::AsyncLibrary());
ASSERT(!async_lib.IsNull());
const Function& function =
Function::Handle(zone, async_lib.LookupFunctionAllowPrivate(
Symbols::_ensureScheduleImmediate()));
ASSERT(!function.IsNull());
const Object& result = Object::Handle(
zone, DartEntry::InvokeFunction(function, Object::empty_array()));
ASSERT(result.IsNull() || result.IsError());
return result.ptr();
}
static ObjectPtr RehashObjects(Zone* zone,
const Library& library,
const Object& array_or_growable_array) {
-6
View File
@@ -45,7 +45,6 @@ class ArgumentsDescriptor : public ValueObject {
intptr_t NamedCount() const { return Count() - PositionalCount(); }
StringPtr NameAt(intptr_t i) const;
intptr_t PositionAt(intptr_t i) const;
bool MatchesNameAt(intptr_t i, const String& other) const;
// Returns array of argument names in the arguments order.
ArrayPtr GetArgumentNames() const;
void PrintTo(BaseTextBuffer* buffer, bool show_named_positions = false) const;
@@ -320,11 +319,6 @@ class DartLibraryCalls : public AllStatic {
// Returns null on success, an ErrorPtr on failure.
static ObjectPtr DrainMicrotaskQueue();
// Ensures that the isolate's _pendingImmediateCallback is set to
// _startMicrotaskLoop from dart:async.
// Returns null on success, an ErrorPtr on failure.
static ObjectPtr EnsureScheduleImmediate();
// Runs the `_rehashObjects()` function in `dart:compact_hash`.
static ObjectPtr RehashObjectsInDartCompactHash(
Thread* thread,
-15
View File
@@ -1131,21 +1131,6 @@ ObjectPtr ActivationFrame::GetRelativeContextVar(intptr_t var_ctx_level,
}
}
ArrayPtr ActivationFrame::GetLocalVariables() {
GetDescIndices();
intptr_t num_variables = desc_indices_.length();
String& var_name = String::Handle();
Object& value = Instance::Handle();
const Array& list = Array::Handle(Array::New(2 * num_variables));
for (intptr_t i = 0; i < num_variables; i++) {
TokenPosition ignore = TokenPosition::kNoSource;
VariableAt(i, &var_name, &ignore, &ignore, &ignore, &value);
list.SetAt(2 * i, var_name);
list.SetAt((2 * i) + 1, value);
}
return list.ptr();
}
ObjectPtr ActivationFrame::GetReceiver() {
GetDescIndices();
intptr_t num_variables = desc_indices_.length();
-1
View File
@@ -391,7 +391,6 @@ class ActivationFrame : public ZoneAllocated {
TokenPosition* visible_end_token_pos,
Object* value);
ArrayPtr GetLocalVariables();
ObjectPtr GetParameter(intptr_t index);
ClosurePtr GetClosure();
ObjectPtr GetReceiver();
-12
View File
@@ -1288,16 +1288,4 @@ ObjectPtr Exceptions::Create(ExceptionType type, const Array& arguments) {
*constructor_name, arguments);
}
UnhandledExceptionPtr Exceptions::CreateUnhandledException(Zone* zone,
ExceptionType type,
const char* msg) {
const String& error_str = String::Handle(zone, String::New(msg));
const Array& args = Array::Handle(zone, Array::New(1));
args.SetAt(0, error_str);
Object& result = Object::Handle(zone, Exceptions::Create(type, args));
const StackTrace& stacktrace = StackTrace::Handle(zone);
return UnhandledException::New(Instance::Cast(result), stacktrace);
}
} // namespace dart
-6
View File
@@ -103,12 +103,6 @@ class Exceptions : AllStatic {
// otherwise returns an ErrorPtr.
static ObjectPtr Create(ExceptionType type, const Array& arguments);
// Returns RawUnhandledException that wraps exception of type [type] with
// [msg] as a single argument.
static UnhandledExceptionPtr CreateUnhandledException(Zone* zone,
ExceptionType type,
const char* msg);
DART_NORETURN static void JumpToFrame(Thread* thread,
uword program_counter,
uword stack_pointer,
-30
View File
@@ -30,36 +30,6 @@ SafepointOperationScope::~SafepointOperationScope() {
handler->ResumeThreads(T, level_);
}
ForceGrowthSafepointOperationScope::ForceGrowthSafepointOperationScope(
Thread* T,
SafepointLevel level)
: ThreadStackResource(T), level_(level) {
ASSERT(T != nullptr);
IsolateGroup* IG = T->isolate_group();
ASSERT(IG != nullptr);
T->IncrementForceGrowthScopeDepth();
auto handler = IG->safepoint_handler();
handler->SafepointThreads(T, level_);
}
ForceGrowthSafepointOperationScope::~ForceGrowthSafepointOperationScope() {
Thread* T = thread();
ASSERT(T != nullptr);
IsolateGroup* IG = T->isolate_group();
ASSERT(IG != nullptr);
auto handler = IG->safepoint_handler();
handler->ResumeThreads(T, level_);
T->DecrementForceGrowthScopeDepth();
if (!T->force_growth()) {
// Check if we passed the growth limit during the scope.
T->heap()->CheckCatchUp(T);
}
}
SafepointHandler::SafepointHandler(IsolateGroup* isolate_group)
: isolate_group_(isolate_group), tasks_() {
handlers_[SafepointLevel::kGC] =
-16
View File
@@ -63,21 +63,6 @@ class ReloadSafepointOperationScope : public SafepointOperationScope {
DISALLOW_COPY_AND_ASSIGN(ReloadSafepointOperationScope);
};
// A stack based scope that can be used to perform an operation after getting
// all threads to a safepoint. At the end of the operation all the threads are
// resumed. Allocations in the scope will force heap growth.
class ForceGrowthSafepointOperationScope : public ThreadStackResource {
public:
ForceGrowthSafepointOperationScope(Thread* T, SafepointLevel level);
~ForceGrowthSafepointOperationScope();
private:
SafepointLevel level_;
bool current_growth_controller_state_;
DISALLOW_COPY_AND_ASSIGN(ForceGrowthSafepointOperationScope);
};
// Subclasses of SafepointTask are able to run on thread blocked at a safepoint.
class SafepointTask : public ThreadPool::Task,
public IntrusiveDListEntry<SafepointTask> {
@@ -236,7 +221,6 @@ class SafepointHandler {
friend class Isolate;
friend class IsolateGroup;
friend class SafepointOperationScope;
friend class ForceGrowthSafepointOperationScope;
friend class HeapIterationScope;
};
-27
View File
@@ -177,12 +177,6 @@ void IdleTimeHandler::InitializeWithHeap(Heap* heap) {
heap_ = heap;
}
bool IdleTimeHandler::ShouldCheckForIdle() {
MutexLocker ml(&mutex_);
return idle_start_time_ > 0 && FLAG_idle_timeout_micros != 0 &&
disabled_counter_ == 0;
}
void IdleTimeHandler::UpdateStartIdleTime() {
MutexLocker ml(&mutex_);
if (disabled_counter_ == 0) {
@@ -2908,15 +2902,6 @@ void IsolateGroup::ForEachIsolate(
}
}
Isolate* IsolateGroup::FirstIsolate() const {
SafepointReadRwLocker ml(Thread::Current(), isolates_lock_.get());
return FirstIsolateLocked();
}
Isolate* IsolateGroup::FirstIsolateLocked() const {
return isolates_.IsEmpty() ? nullptr : isolates_.First();
}
void IsolateGroup::ForEachMutatorAtASafepoint(
std::function<void(Thread* thread)> function) {
auto thread = Thread::Current();
@@ -3649,18 +3634,6 @@ intptr_t Isolate::IsolateListLength() {
return count;
}
Isolate* Isolate::LookupIsolateByPort(Dart_Port port) {
Isolate* match = nullptr;
IsolateGroup::ForEach([&](IsolateGroup* group) {
group->ForEachIsolate([&](Isolate* isolate) {
if (isolate->main_port() == port) {
match = isolate;
}
});
});
return match;
}
std::unique_ptr<char[]> Isolate::LookupIsolateNameByPort(Dart_Port port) {
MonitorLocker ml(isolate_creation_monitor_);
std::unique_ptr<char[]> result;
-9
View File
@@ -213,9 +213,6 @@ class IdleTimeHandler : public ValueObject {
// idle notifications will be sent.
void InitializeWithHeap(Heap* heap);
// Returns whether the caller should check for idle timeouts.
bool ShouldCheckForIdle();
// Declares that the idle time should be reset to now.
void UpdateStartIdleTime();
@@ -647,8 +644,6 @@ class IsolateGroup : public IntrusiveDListEntry<IsolateGroup> {
// adding/removing isolates, so no locks will be held.
void ForEachIsolate(std::function<void(Isolate* isolate)> function,
bool at_safepoint = false);
Isolate* FirstIsolate() const;
Isolate* FirstIsolateLocked() const;
void ForEachMutatorAtASafepoint(std::function<void(Thread* thread)> function);
@@ -1493,10 +1488,6 @@ class Isolate : public IntrusiveDListEntry<Isolate> {
static void KillAllSystemIsolates(LibMsgId msg_id);
static void KillIfExists(Isolate* isolate, LibMsgId msg_id);
// Lookup an isolate by its main port. Returns nullptr if no matching isolate
// is found.
static Isolate* LookupIsolateByPort(Dart_Port port);
// Lookup an isolate by its main port and return a copy of its name. Returns
// nullptr if not matching isolate is found.
static std::unique_ptr<char[]> LookupIsolateNameByPort(Dart_Port port);
-15
View File
@@ -486,21 +486,6 @@ KernelLoader::KernelLoader(const KernelProgramInfo& kernel_program_info,
H.InitFromKernelProgramInfo(kernel_program_info_);
}
bool KernelLoader::IsClassName(NameIndex name,
const String& library,
const String& klass) {
ASSERT(H.IsClass(name));
StringIndex class_name_index = H.CanonicalNameString(name);
if (!H.StringEquals(class_name_index, klass.ToCString())) {
return false;
}
ASSERT(H.IsLibrary(H.CanonicalNameParent(name)));
StringIndex library_name_index =
H.CanonicalNameString(H.CanonicalNameParent(name));
return H.StringEquals(library_name_index, library.ToCString());
}
ObjectPtr KernelLoader::LoadProgram(bool process_pending_classes) {
SafepointWriteRwLocker ml(thread_, thread_->isolate_group()->program_lock());
ASSERT(kernel_program_info_.constants() == Array::null());
-2
View File
@@ -247,8 +247,6 @@ class KernelLoader : public ValueObject {
const Library& library,
const LibraryIndex& library_index);
bool IsClassName(NameIndex name, const String& library, const String& klass);
void ReadVMAnnotations(const Library& library,
intptr_t annotation_count,
uint32_t* pragma_bits,
-7
View File
@@ -148,13 +148,6 @@ void Log::Flush(const intptr_t cursor) {
buffer_.TruncateTo(cursor);
}
void Log::Clear() {
if (this == NoOpLog()) {
return;
}
buffer_.TruncateTo(0);
}
intptr_t Log::cursor() const {
return buffer_.length();
}
-3
View File
@@ -40,9 +40,6 @@ class Log {
// and truncated to cursor afterwards.
void Flush(const intptr_t cursor = 0);
// Clears the log.
void Clear();
// Current cursor.
intptr_t cursor() const;
-38
View File
@@ -289,40 +289,6 @@ MessageHandler::MessageStatus MessageHandler::HandleNextMessage() {
return HandleMessages(&ml, true, false);
}
MessageHandler::MessageStatus MessageHandler::PauseAndHandleAllMessages(
int64_t timeout_millis) {
MonitorLocker ml(&monitor_, /*no_safepoint_scope=*/false);
ASSERT(task_running_);
#if defined(DEBUG)
CheckAccess();
#endif
paused_for_messages_ = true;
while (queue_->IsEmpty() && oob_queue_->IsEmpty()) {
Monitor::WaitResult wr;
{
// Ensure this thread is at a safepoint while we wait for new messages to
// arrive.
TransitionVMToNative transition(Thread::Current());
wr = ml.Wait(timeout_millis);
}
ASSERT(task_running_);
if (wr == Monitor::kTimedOut) {
break;
}
if (queue_->IsEmpty()) {
// There are only OOB messages. Handle them and then continue waiting for
// normal messages unless there is an error.
MessageStatus status = HandleMessages(&ml, false, false);
if (status != kOK) {
paused_for_messages_ = false;
return status;
}
}
}
paused_for_messages_ = false;
return HandleMessages(&ml, true, true);
}
MessageHandler::MessageStatus MessageHandler::HandleOOBMessages() {
if (!oob_message_handling_allowed_) {
return kOK;
@@ -532,10 +498,6 @@ void MessageHandler::OnAllPortsClosed() {
}
#if !defined(PRODUCT)
void MessageHandler::DebugDump() {
PortMap::DebugDumpForMessageHandler(this);
}
void MessageHandler::PausedOnStart(bool paused) {
MonitorLocker ml(&monitor_);
PausedOnStartLocked(&ml, paused);
-6
View File
@@ -66,10 +66,6 @@ class MessageHandler : public PortHandler {
// Returns true on success.
MessageStatus HandleOOBMessages();
// Blocks the thread on a condition variable until a message arrives, and then
// handles all messages.
MessageStatus PauseAndHandleAllMessages(int64_t timeout_millis);
// Returns true if there are pending OOB messages for this message
// handler.
bool HasOOBMessages();
@@ -94,8 +90,6 @@ class MessageHandler : public PortHandler {
}
#if !defined(PRODUCT)
void DebugDump();
bool should_pause_on_start() const { return should_pause_on_start_; }
void set_should_pause_on_start(bool should_pause_on_start) {
-116
View File
@@ -3273,12 +3273,6 @@ ClassPtr Class::Mixin() const {
return ptr();
}
bool Class::IsInFullSnapshot() const {
NoSafepointScope no_safepoint;
return UntaggedLibrary::InFullSnapshotBit::decode(
untag()->library()->untag()->flags_);
}
TypePtr Class::RareType() const {
if (!IsGeneric()) {
return DeclarationType();
@@ -7435,26 +7429,6 @@ TypeArgumentsPtr TypeArguments::Prepend(Zone* zone,
return result.Canonicalize(Thread::Current());
}
TypeArgumentsPtr TypeArguments::ConcatenateTypeParameters(
Zone* zone,
const TypeArguments& other) const {
ASSERT(!IsNull() && !other.IsNull());
const intptr_t this_len = Length();
const intptr_t other_len = other.Length();
const auto& result = TypeArguments::Handle(
zone, TypeArguments::New(this_len + other_len, Heap::kNew));
auto& type = AbstractType::Handle(zone);
for (intptr_t i = 0; i < this_len; ++i) {
type = TypeAt(i);
result.SetTypeAt(i, type);
}
for (intptr_t i = 0; i < other_len; ++i) {
type = other.TypeAt(i);
result.SetTypeAt(this_len + i, type);
}
return result.ptr();
}
InstantiationMode TypeArguments::GetInstantiationMode(Zone* zone,
const Function* function,
const Class* cls) const {
@@ -8769,20 +8743,6 @@ void Function::set_implicit_static_closure(const Closure& closure) const {
UNREACHABLE();
}
ScriptPtr Function::eval_script() const {
const Object& obj = Object::Handle(untag()->data());
if (obj.IsScript()) {
return Script::Cast(obj).ptr();
}
return Script::null();
}
void Function::set_eval_script(const Script& script) const {
ASSERT(token_pos() == TokenPosition::kMinSource);
ASSERT(untag()->data() == Object::null());
set_data(script);
}
FunctionPtr Function::extracted_method_closure() const {
ASSERT(kind() == UntaggedFunction::kMethodExtractor);
const Object& obj = Object::Handle(untag()->data());
@@ -11577,14 +11537,6 @@ ScriptPtr Function::script() const {
return Script::RawCast(
fdata.At(static_cast<intptr_t>(EvalFunctionData::kScript)));
}
if (token_pos() == TokenPosition::kMinSource) {
// Testing for position 0 is an optimization that relies on temporary
// eval functions having token position 0.
const Script& script = Script::Handle(eval_script());
if (!script.IsNull()) {
return script.ptr();
}
}
const Object& obj = Object::Handle(untag()->owner());
if (obj.IsPatchClass()) {
return PatchClass::Cast(obj).script();
@@ -12854,11 +12806,6 @@ int32_t Field::SourceFingerprint() const {
#endif // !defined(DART_PRECOMPILED_RUNTIME)
}
StringPtr Field::InitializingExpression() const {
UNREACHABLE();
return String::null();
}
const char* Field::UserVisibleNameCString() const {
NoSafepointScope no_safepoint;
if (FLAG_show_internal_names) {
@@ -12952,45 +12899,6 @@ const char* Field::ToCString() const {
cls_name, field_name, kF0, kF1, kF2, kF3, kF4);
}
// Build a closure object that gets (or sets) the contents of a static
// field f and cache the closure in a newly created static field
// named #f (or #f= in case of a setter).
InstancePtr Field::AccessorClosure(bool make_setter) const {
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
ASSERT(is_static());
const Class& field_owner = Class::Handle(zone, Owner());
String& closure_name = String::Handle(zone, this->name());
closure_name = Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
if (make_setter) {
closure_name =
Symbols::FromConcat(thread, Symbols::HashMark(), closure_name);
}
Field& closure_field = Field::Handle(zone);
closure_field = field_owner.LookupStaticField(closure_name);
if (!closure_field.IsNull()) {
ASSERT(closure_field.is_static());
const Instance& closure =
Instance::Handle(zone, Instance::RawCast(closure_field.StaticValue()));
ASSERT(!closure.IsNull());
ASSERT(closure.IsClosure());
return closure.ptr();
}
UNREACHABLE();
return Instance::null();
}
InstancePtr Field::GetterClosure() const {
return AccessorClosure(false);
}
InstancePtr Field::SetterClosure() const {
return AccessorClosure(true);
}
WeakArrayPtr Field::dependent_code() const {
DEBUG_ASSERT(
IsolateGroup::Current()->program_lock()->IsCurrentThreadReader());
@@ -15204,7 +15112,6 @@ LibraryPtr Library::NewLibraryHelper(const String& url, bool import_core_lib) {
result.set_native_entry_symbol_resolver(nullptr);
result.set_ffi_native_resolver(nullptr);
result.set_flags(0);
result.set_is_in_fullsnapshot(false);
// This logic is also in the DAP debug adapter in DDS to avoid needing
// to call setLibraryDebuggable for every library for every isolate.
// If these defaults change, the same should be done there in
@@ -17453,29 +17360,6 @@ void ICData::AddDeoptReason(DeoptReasonId reason) const {
}
}
const char* ICData::RebindRuleToCString(RebindRule r) {
switch (r) {
#define RULE_CASE(Name) \
case RebindRule::k##Name: \
return #Name;
FOR_EACH_REBIND_RULE(RULE_CASE)
#undef RULE_CASE
default:
return nullptr;
}
}
bool ICData::ParseRebindRule(const char* str, RebindRule* out) {
#define RULE_CASE(Name) \
if (strcmp(str, #Name) == 0) { \
*out = RebindRule::k##Name; \
return true; \
}
FOR_EACH_REBIND_RULE(RULE_CASE)
#undef RULE_CASE
return false;
}
ICData::RebindRule ICData::rebind_rule() const {
return RebindRule(untag()->state_bits_.Read<RebindRuleBits>());
}
-36
View File
@@ -1352,8 +1352,6 @@ class Class : public Object {
// to this class.
ClassPtr Mixin() const;
bool IsInFullSnapshot() const;
virtual StringPtr DictionaryName() const { return Name(); }
ScriptPtr script() const { return untag()->script(); }
@@ -1669,12 +1667,6 @@ class Class : public Object {
// Check if this class represents the 'Record' class.
bool IsRecordClass() const { return id() == kRecordCid; }
static bool IsInFullSnapshot(ClassPtr cls) {
NoSafepointScope no_safepoint;
return UntaggedLibrary::InFullSnapshotBit::decode(
cls->untag()->library()->untag()->flags_);
}
static intptr_t GetClassId(ClassPtr cls) {
NoSafepointScope no_safepoint;
return cls->untag()->id_;
@@ -2340,10 +2332,6 @@ class PatchClass : public Object {
static intptr_t InstanceSize() {
return RoundedAllocationSize(sizeof(UntaggedPatchClass));
}
static bool IsInFullSnapshot(PatchClassPtr cls) {
NoSafepointScope no_safepoint;
return Class::IsInFullSnapshot(cls->untag()->wrapped_class());
}
static PatchClassPtr New(const Class& wrapped_class,
const KernelProgramInfo& info,
@@ -2597,8 +2585,6 @@ class ICData : public CallSiteData {
#undef REBIND_ENUM_DEF
kNumRebindRules,
};
static const char* RebindRuleToCString(RebindRule r);
static bool ParseRebindRule(const char* str, RebindRule* out);
RebindRule rebind_rule() const;
void set_is_megamorphic(bool value) const {
@@ -4372,8 +4358,6 @@ class Function : public Object {
void set_implicit_closure_function(const Function& value) const;
ClosurePtr implicit_static_closure() const;
void set_implicit_static_closure(const Closure& closure) const;
ScriptPtr eval_script() const;
void set_eval_script(const Script& value) const;
void set_num_optional_parameters(intptr_t value) const; // Encoded value.
void set_kind_tag(uint32_t value) const;
bool is_eval_function() const;
@@ -4701,8 +4685,6 @@ class Field : public Object {
int32_t SourceFingerprint() const;
StringPtr InitializingExpression() const;
bool has_nontrivial_initializer() const {
return untag()->kind_bits_.Read<HasNontrivialInitializerBit>();
}
@@ -4923,12 +4905,6 @@ class Field : public Object {
void SetInitializerFunction(const Function& initializer) const;
#endif // !defined(DART_PRECOMPILED_RUNTIME) || defined(DART_DYNAMIC_MODULES)
// For static fields only. Constructs a closure that gets/sets the
// field value.
InstancePtr GetterClosure() const;
InstancePtr SetterClosure() const;
InstancePtr AccessorClosure(bool make_setter) const;
// Constructs getter and setter names for fields and vice versa.
static StringPtr GetterName(const String& field_name);
static StringPtr GetterSymbol(const String& field_name);
@@ -5386,14 +5362,6 @@ class Library : public Object {
value);
}
bool is_in_fullsnapshot() const {
return UntaggedLibrary::InFullSnapshotBit::decode(untag()->flags_);
}
void set_is_in_fullsnapshot(bool value) const {
set_flags(
UntaggedLibrary::InFullSnapshotBit::update(value, untag()->flags_));
}
StringPtr PrivateName(const String& name) const;
intptr_t index() const { return untag()->index_; }
@@ -8994,10 +8962,6 @@ class TypeArguments : public Instance {
intptr_t other_length,
intptr_t total_length) const;
// Concatenate [this] and [other] vectors of type parameters.
TypeArgumentsPtr ConcatenateTypeParameters(Zone* zone,
const TypeArguments& other) const;
// Returns an InstantiationMode for this type argument vector, which
// specifies whether the type argument vector requires instantiation and
// shortcuts to instantiate the vector when possible.
-3
View File
@@ -65,9 +65,6 @@ class OS {
// the platform doesn't care. Guaranteed to be a power of two.
static intptr_t ActivationFrameAlignment();
// Returns number of available processor cores.
static int NumberOfAvailableProcessors();
// Returns the current resident set size in bytes, or 0 if it could not be
// determined.
static uintptr_t CurrentRSS();
-4
View File
@@ -203,10 +203,6 @@ intptr_t OS::ActivationFrameAlignment() {
return alignment;
}
int OS::NumberOfAvailableProcessors() {
return sysconf(_SC_NPROCESSORS_ONLN);
}
uintptr_t OS::CurrentRSS() {
// The second value in /proc/self/statm is the current RSS in pages.
// It is not possible to use getrusage() because the interested fields are not
-4
View File
@@ -480,10 +480,6 @@ intptr_t OS::ActivationFrameAlignment() {
return alignment;
}
int OS::NumberOfAvailableProcessors() {
return sysconf(_SC_NPROCESSORS_CONF);
}
uintptr_t OS::CurrentRSS() {
zx_info_task_stats_t task_stats;
zx_handle_t process = zx_process_self();
-4
View File
@@ -542,10 +542,6 @@ intptr_t OS::ActivationFrameAlignment() {
return alignment;
}
int OS::NumberOfAvailableProcessors() {
return sysconf(_SC_NPROCESSORS_ONLN);
}
uintptr_t OS::CurrentRSS() {
// The second value in /proc/self/statm is the current RSS in pages.
// It is not possible to use getrusage() because the interested fields are not
-4
View File
@@ -119,10 +119,6 @@ intptr_t OS::ActivationFrameAlignment() {
#endif // DART_HOST_OS_IOS
}
int OS::NumberOfAvailableProcessors() {
return sysconf(_SC_NPROCESSORS_ONLN);
}
uintptr_t OS::CurrentRSS() {
struct mach_task_basic_info info;
mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
-2
View File
@@ -28,8 +28,6 @@ VM_UNIT_TEST_CASE(SNPrint) {
VM_UNIT_TEST_CASE(OsFuncs) {
EXPECT(Utils::IsPowerOfTwo(OS::ActivationFrameAlignment()));
int procs = OS::NumberOfAvailableProcessors();
EXPECT_LE(1, procs);
}
} // namespace dart
-6
View File
@@ -232,12 +232,6 @@ intptr_t OS::ActivationFrameAlignment() {
#endif
}
int OS::NumberOfAvailableProcessors() {
SYSTEM_INFO info;
GetSystemInfo(&info);
return info.dwNumberOfProcessors;
}
uintptr_t OS::CurrentRSS() {
// Although the documentation at
// https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo
-29
View File
@@ -55,7 +55,6 @@ ParsedFunction::ParsedFunction(Thread* thread, const Function& function)
arg_desc_var_(nullptr),
expression_temp_var_(nullptr),
entry_points_temp_var_(nullptr),
finally_return_temp_var_(nullptr),
dynamic_closure_call_vars_(nullptr),
guarded_fields_(),
default_parameter_values_(nullptr),
@@ -154,21 +153,6 @@ LocalVariable* ParsedFunction::EnsureEntryPointsTemp() {
return entry_points_temp_var();
}
void ParsedFunction::EnsureFinallyReturnTemp(bool is_async) {
if (!has_finally_return_temp_var()) {
LocalVariable* temp =
new (Z) LocalVariable(function_.token_pos(), function_.token_pos(),
Symbols::FinallyRetVal(), Object::dynamic_type());
ASSERT(temp != nullptr);
temp->set_is_final();
if (is_async) {
temp->set_is_captured();
}
set_finally_return_temp_var(temp);
}
ASSERT(has_finally_return_temp_var());
}
void ParsedFunction::SetRegExpCompileData(
RegExpCompileData* regexp_compile_data) {
ASSERT(regexp_compile_data_ == nullptr);
@@ -285,13 +269,6 @@ void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) {
num_stack_locals_ = num_stack_locals;
}
void ParsedFunction::SetCovariantParameters(
const BitVector* covariant_parameters) {
ASSERT(covariant_parameters_ == nullptr);
ASSERT(covariant_parameters->length() == function_.NumParameters());
covariant_parameters_ = covariant_parameters;
}
void ParsedFunction::SetGenericCovariantImplParameters(
const BitVector* generic_covariant_impl_parameters) {
ASSERT(generic_covariant_impl_parameters_ == nullptr);
@@ -300,12 +277,6 @@ void ParsedFunction::SetGenericCovariantImplParameters(
generic_covariant_impl_parameters_ = generic_covariant_impl_parameters;
}
bool ParsedFunction::IsCovariantParameter(intptr_t i) const {
ASSERT(covariant_parameters_ != nullptr);
ASSERT((i >= 0) && (i < function_.NumParameters()));
return covariant_parameters_->Contains(i);
}
bool ParsedFunction::IsGenericCovariantImplParameter(intptr_t i) const {
ASSERT(generic_covariant_impl_parameters_ != nullptr);
ASSERT((i >= 0) && (i < function_.NumParameters()));
-19
View File
@@ -171,19 +171,6 @@ class ParsedFunction : public ZoneAllocated {
return entry_points_temp_var_ != nullptr;
}
LocalVariable* finally_return_temp_var() const {
ASSERT(has_finally_return_temp_var());
return finally_return_temp_var_;
}
void set_finally_return_temp_var(LocalVariable* value) {
ASSERT(!has_finally_return_temp_var());
finally_return_temp_var_ = value;
}
bool has_finally_return_temp_var() const {
return finally_return_temp_var_ != nullptr;
}
void EnsureFinallyReturnTemp(bool is_async);
LocalVariable* EnsureExpressionTemp();
LocalVariable* EnsureEntryPointsTemp();
@@ -250,10 +237,6 @@ class ParsedFunction : public ZoneAllocated {
void SetGenericCovariantImplParameters(
const BitVector* generic_covariant_impl_parameters);
bool HasCovariantParametersInfo() const {
return covariant_parameters_ != nullptr;
}
// Returns true if i-th parameter is covariant.
// SetCovariantParameters should be called before using this method.
bool IsCovariantParameter(intptr_t i) const;
@@ -303,7 +286,6 @@ class ParsedFunction : public ZoneAllocated {
LocalVariable* receiver_var_ = nullptr;
LocalVariable* expression_temp_var_;
LocalVariable* entry_points_temp_var_;
LocalVariable* finally_return_temp_var_;
DynamicClosureCallVars* dynamic_closure_call_vars_;
mutable FieldSet guarded_fields_;
ZoneGrowableArray<const Instance*>* default_parameter_values_;
@@ -319,7 +301,6 @@ class ParsedFunction : public ZoneAllocated {
const Function* forwarding_stub_super_target_ = nullptr;
kernel::ScopeBuildingResult* kernel_scopes_;
const BitVector* covariant_parameters_ = nullptr;
const BitVector* generic_covariant_impl_parameters_ = nullptr;
friend class Parser;
-15
View File
@@ -312,21 +312,6 @@ void PortMap::PrintPortsForMessageHandler(MessageHandler* handler,
#endif
}
void PortMap::DebugDumpForMessageHandler(MessageHandler* handler) {
SafepointMutexLocker ml(mutex_);
if (ports_ == nullptr) {
return;
}
Object& msg_handler = Object::Handle();
for (auto& entry : *ports_) {
if (entry.handler == handler) {
OS::PrintErr("Port = %" Pd64 "\n", entry.port);
msg_handler = DartLibraryCalls::LookupHandler(entry.port);
OS::PrintErr("Handler = %s\n", msg_handler.ToCString());
}
}
}
PortHandler::~PortHandler() {}
#if defined(DEBUG)
-2
View File
@@ -67,8 +67,6 @@ class PortMap : public AllStatic {
static void PrintPortsForMessageHandler(MessageHandler* handler,
JSONStream* stream);
static void DebugDumpForMessageHandler(MessageHandler* handler);
class Locker : public MutexLocker {
public:
Locker() : MutexLocker(PortMap::mutex_) {}
-3
View File
@@ -1887,9 +1887,6 @@ class UntaggedLibrary : public UntaggedObject {
// True if debugger can stop in library.
using DebuggableBit =
BitField<decltype(flags_), bool, DartSchemeBit::kNextBit>;
// True if library is in a full snapshot.
using InFullSnapshotBit =
BitField<decltype(flags_), bool, DebuggableBit::kNextBit>;
#if !defined(DART_PRECOMPILED_RUNTIME)
uint32_t kernel_library_index_;
-35
View File
@@ -42,17 +42,6 @@ LocalScope::LocalScope(LocalScope* parent, int function_level, int loop_level)
}
}
bool LocalScope::IsNestedWithin(LocalScope* scope) const {
const LocalScope* current_scope = this;
while (current_scope != nullptr) {
if (current_scope == scope) {
return true;
}
current_scope = current_scope->parent();
}
return false;
}
bool LocalScope::AddVariable(LocalVariable* variable) {
ASSERT(variable != nullptr);
if (LocalLookupVariable(variable->name(), variable->kernel_offset()) !=
@@ -377,20 +366,6 @@ LocalVariable* LocalScope::LookupVariable(const String& name,
return nullptr;
}
LocalVariable* LocalScope::LookupVariableByName(const String& name) {
ASSERT(name.IsSymbol());
for (LocalScope* scope = this; scope != nullptr; scope = scope->parent()) {
for (intptr_t i = 0, n = scope->variables_.length(); i < n; ++i) {
LocalVariable* var = scope->variables_[i];
ASSERT(var->name().IsSymbol());
if (var->name().ptr() == name.ptr()) {
return var;
}
}
}
return nullptr;
}
void LocalScope::CaptureVariable(LocalVariable* variable) {
ASSERT(variable != nullptr);
@@ -736,16 +711,6 @@ bool LocalVariable::Equals(const LocalVariable& other) const {
return false;
}
void LocalVarDescriptorsBuilder::AddAll(Zone* zone,
const LocalVarDescriptors& var_descs) {
for (intptr_t i = 0, n = var_descs.Length(); i < n; ++i) {
VarDesc desc;
desc.name = &String::Handle(zone, var_descs.GetName(i));
var_descs.GetInfo(i, &desc.info);
Add(desc);
}
}
void LocalVarDescriptorsBuilder::AddDeoptIdToContextLevelMappings(
ZoneGrowableArray<intptr_t>* context_level_array) {
// Record deopt-id -> context-level mappings, using ranges of deopt-ids with
-9
View File
@@ -297,9 +297,6 @@ class LocalVarDescriptorsBuilder : public ValueObject {
// Add variable descriptor.
void Add(const VarDesc& var_desc) { vars_.Add(var_desc); }
// Add all variable descriptors from given [LocalVarDescriptors] object.
void AddAll(Zone* zone, const LocalVarDescriptors& var_descs);
// Record deopt-id -> context-level mappings, using ranges of deopt-ids with
// the same context-level. [context_level_array] contains (deopt_id,
// context_level) tuples.
@@ -323,9 +320,6 @@ class LocalScope : public ZoneAllocated {
int function_level() const { return function_level_; }
int loop_level() const { return loop_level_; }
// Check if this scope is nested within the passed in scope.
bool IsNestedWithin(LocalScope* scope) const;
// The context level is only set in a scope that is either the owner scope of
// a captured variable or that is the owner scope of a context.
bool HasContextLevel() const {
@@ -388,9 +382,6 @@ class LocalScope : public ZoneAllocated {
intptr_t kernel_offset,
bool test_only);
// Lookup a variable in this scope and its parents by name.
LocalVariable* LookupVariableByName(const String& name);
// Mark this variable as captured by this scope.
void CaptureVariable(LocalVariable* variable);
-8
View File
@@ -220,10 +220,6 @@ StringPtr Symbols::FromSet(Thread* thread, const String& str) {
return FromConcat(thread, SetterPrefix(), str);
}
StringPtr Symbols::FromDot(Thread* thread, const String& str) {
return FromConcat(thread, str, Dot());
}
// TODO(srdjan): If this becomes performance critical code, consider looking
// up symbol from hash of pieces instead of concatenating them first into
// a string.
@@ -403,10 +399,6 @@ StringPtr Symbols::LookupFromSet(Thread* thread, const String& str) {
return LookupFromConcat(thread, SetterPrefix(), str);
}
StringPtr Symbols::LookupFromDot(Thread* thread, const String& str) {
return LookupFromConcat(thread, str, Dot());
}
StringPtr Symbols::New(Thread* thread, const String& str) {
if (str.IsSymbol()) {
return str.ptr();
-3
View File
@@ -446,7 +446,6 @@ class ObjectPointerVisitor;
V(_backtrackingStack, "_backtrackingStack") \
V(_checkSetRangeArguments, "_checkSetRangeArguments") \
V(_current, "_current") \
V(_ensureScheduleImmediate, "_ensureScheduleImmediate") \
V(_ffi_resolver_function, "_ffi_resolver_function") \
V(future, "future") \
V(_future, "_future") \
@@ -787,7 +786,6 @@ class Symbols : public AllStatic {
static StringPtr FromGet(Thread* thread, const String& str);
static StringPtr FromSet(Thread* thread, const String& str);
static StringPtr FromDot(Thread* thread, const String& str);
static StringPtr FromCharCode(Thread* thread, uint16_t char_code);
@@ -809,7 +807,6 @@ class Symbols : public AllStatic {
static StringPtr LookupFromGet(Thread* thread, const String& str);
static StringPtr LookupFromSet(Thread* thread, const String& str);
static StringPtr LookupFromDot(Thread* thread, const String& str);
static void GetStats(IsolateGroup* isolate_group,
intptr_t* size,
-10
View File
@@ -1689,16 +1689,6 @@ void Thread::set_forward_table_old(WeakTable* table) {
forward_table_old_ = std::move(value);
}
void Thread::VisitMutators(MutatorThreadVisitor* visitor) {
if (visitor == nullptr) {
return;
}
IsolateGroup::ForEach([&](IsolateGroup* group) {
group->thread_registry()->ForEachThread(
[&](Thread* thread) { visitor->VisitMutatorThread(thread); });
});
}
#if defined(DART_INCLUDE_PROFILER)
DisableThreadInterruptsScope::DisableThreadInterruptsScope(Thread* thread)
: StackResource(thread) {
-13
View File
@@ -351,17 +351,6 @@ struct TsanUtils {
}
};
class MutatorThreadVisitor {
public:
MutatorThreadVisitor() {}
virtual ~MutatorThreadVisitor() {}
virtual void VisitMutatorThread(Thread* mutator) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(MutatorThreadVisitor);
};
// A VM thread; may be executing Dart code or performing helper tasks like
// garbage collection or compilation. The Thread structure associated with
// a thread is allocated by ThreadRegistry::GetFromFreelistLocked either
@@ -1380,8 +1369,6 @@ class Thread : public ThreadState, public IntrusiveDListEntry<Thread> {
void set_user_tag(uword tag) { user_tag_ = tag; }
static void VisitMutators(MutatorThreadVisitor* visitor);
ArrayPtr thread_locals() const { return thread_locals_; }
void set_thread_locals(const Array& thread_locals);
-12
View File
@@ -13,18 +13,6 @@ ThreadState::ThreadState(bool is_os_thread) : BaseThread(is_os_thread) {}
ThreadState::~ThreadState() {}
bool ThreadState::ZoneIsOwnedByThread(Zone* zone) const {
ASSERT(zone != nullptr);
Zone* current = zone_;
while (current != nullptr) {
if (current == zone) {
return true;
}
current = current->previous();
}
return false;
}
bool ThreadState::IsValidZoneHandle(Dart_Handle object) const {
Zone* zone = this->zone();
while (zone != nullptr) {
-2
View File
@@ -37,8 +37,6 @@ class ThreadState : public BaseThread {
// The topmost zone used for allocation in this thread.
Zone* zone() const { return zone_; }
bool ZoneIsOwnedByThread(Zone* zone) const;
StackResource* top_resource() const { return top_resource_; }
void set_top_resource(StackResource* value) { top_resource_ = value; }
static intptr_t top_resource_offset() {
-5
View File
@@ -18,11 +18,6 @@ const char* const Token::tok_str_[] = {DART_TOKEN_LIST(TOKEN_STRING)
DART_KEYWORD_LIST(TOKEN_STRING)};
#undef TOKEN_STRING
#define TOKEN_PRECEDENCE(t, s, p, a) p,
const uint8_t Token::precedence_[] = {DART_TOKEN_LIST(TOKEN_PRECEDENCE)
DART_KEYWORD_LIST(TOKEN_PRECEDENCE)};
#undef TOKEN_PRECEDENCE
#define TOKEN_ATTRIBUTE(t, s, p, a) a,
const Token::Attribute Token::attributes_[] = {
DART_TOKEN_LIST(TOKEN_ATTRIBUTE) DART_KEYWORD_LIST(TOKEN_ATTRIBUTE)};
-23
View File
@@ -10,23 +10,6 @@
namespace dart {
// Operator precedence table
//
// 14 multiplicative * / ~/ %
// 13 additive + -
// 12 shift << >> >>>
// 11 bitwise and &
// 10 bitwise xor ^
// 9 bitwise or |
// 8 relational >= > <= < is as
// 7 equality == != === !==
// 6 logical and &&
// 5 logical or ||
// 4 null check ??
// 3 conditional ?
// 2 assignment = *= /= ~/= %= += -= <<= >>= >>>= &= ^= |= ??=
// 1 comma ,
// Token definitions.
// Some operator tokens appear in blocks, e.g. assignment operators.
// There is code that depends on the values within a block to be
@@ -301,11 +284,6 @@ class Token {
return false;
}
static int Precedence(Kind tok) {
ASSERT(tok < kNumTokens);
return precedence_[tok];
}
static Attribute Attributes(Kind tok) {
ASSERT(tok < kNumTokens);
return attributes_[tok];
@@ -393,7 +371,6 @@ class Token {
private:
static const char* const name_[];
static const char* const tok_str_[];
static const uint8_t precedence_[];
static const Attribute attributes_[];
};