61f0f5bc43
This change replaces kernel AST declarations of fields and functions with bytecode declarations. Size of dilp files is reduced by 11-12%. Startup latency: Time to the first full frame: 1.945s -> 1.687s FinalizeClass: 554ms -> 277ms FinishClassLoading: 296ms -> 156ms There are following regressions in bytecode mode, which will be fixed in future: * dart:mirrors are not supported yet (implementation of mirrors relies on reading kernel AST in certain cases). As the result, lib_2/mirrors/* tests fail. * native extensions are not supported yet (annotations on libraries and classes in AST are cleaned up as they could reference members which are now removed from AST). As the result, standalone_2/entrypoints_verification_test test fails. * language_2/spread_collections/const_error_test/* tests fail due to https://github.com/dart-lang/sdk/issues/36286. Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
|
|
#define RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
|
|
|
|
#if !defined(DART_PRECOMPILED_RUNTIME)
|
|
|
|
#include "vm/object.h"
|
|
#include "vm/parser.h" // For ParsedFunction.
|
|
#include "vm/scopes.h"
|
|
|
|
namespace dart {
|
|
namespace kernel {
|
|
|
|
// Builds scopes, populates parameters and local variables for
|
|
// certain functions declared in bytecode.
|
|
class BytecodeScopeBuilder : public ValueObject {
|
|
public:
|
|
explicit BytecodeScopeBuilder(ParsedFunction* parsed_function);
|
|
|
|
void BuildScopes();
|
|
|
|
private:
|
|
void AddParameters(const Function& function,
|
|
LocalVariable::TypeCheckMode mode);
|
|
LocalVariable* MakeVariable(const String& name, const AbstractType& type);
|
|
LocalVariable* MakeReceiverVariable(bool is_parameter);
|
|
|
|
ParsedFunction* parsed_function_;
|
|
Zone* zone_;
|
|
LocalScope* scope_;
|
|
};
|
|
|
|
} // namespace kernel
|
|
} // namespace dart
|
|
|
|
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
|
#endif // RUNTIME_VM_COMPILER_FRONTEND_BYTECODE_SCOPE_BUILDER_H_
|