Skip to content

Commit 262b759

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[vm] Place regexp sources in their own directory.
This makes it easier to see their cost in binary size tools. TEST=ci Change-Id: I6079ad9fb9b7c9450bb8d255e9a794a38ec9ae62 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388641 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent bdff123 commit 262b759

33 files changed

+116
-105
lines changed

runtime/bin/BUILD.gn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import("../runtime_args.gni")
1010
import("../vm/compiler/compiler_sources.gni")
1111
import("../vm/ffi/ffi_sources.gni")
1212
import("../vm/heap/heap_sources.gni")
13+
import("../vm/regexp/regexp_sources.gni")
1314
import("../vm/vm_sources.gni")
1415
import("builtin_impl_sources.gni")
1516
import("builtin_sources.gni")
@@ -1055,6 +1056,7 @@ source_set("run_vm_tests_set") {
10551056
vm_tests = rebase_path(vm_sources_tests, ".", "../vm")
10561057
compiler_tests = rebase_path(compiler_sources_tests, ".", "../vm/compiler")
10571058
heap_tests = rebase_path(heap_sources_tests, ".", "../vm/heap")
1059+
regexp_tests = rebase_path(regexp_sources_tests, ".", "../vm/regexp")
10581060

10591061
sources = [
10601062
"builtin.cc",
@@ -1072,7 +1074,7 @@ source_set("run_vm_tests_set") {
10721074
"vmservice_impl.cc",
10731075
"vmservice_impl.h",
10741076
] + builtin_impl_tests + vm_tests + compiler_tests + heap_tests +
1075-
io_impl_tests
1077+
regexp_tests + io_impl_tests
10761078
}
10771079

10781080
executable("run_vm_tests") {

runtime/lib/regexp.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#include "vm/native_entry.h"
1010
#include "vm/object.h"
1111
#include "vm/object_store.h"
12-
#include "vm/regexp_assembler_bytecode.h"
13-
#include "vm/regexp_parser.h"
12+
#include "vm/regexp/regexp_assembler_bytecode.h"
13+
#include "vm/regexp/regexp_parser.h"
1414
#include "vm/reusable_handles.h"
1515
#include "vm/symbols.h"
1616
#include "vm/thread.h"
1717

1818
#if !defined(DART_PRECOMPILED_RUNTIME)
19-
#include "vm/regexp_assembler_ir.h"
19+
#include "vm/regexp/regexp_assembler_ir.h"
2020
#endif // !defined(DART_PRECOMPILED_RUNTIME)
2121

2222
namespace dart {

runtime/tools/run_clang_tidy.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ final Set<String> excludedFiles = Set<String>.from([
132132
'runtime/vm/os_thread_linux.h',
133133
'runtime/vm/os_thread_macos.h',
134134
'runtime/vm/os_thread_win.h',
135-
'runtime/vm/regexp_assembler_bytecode_inl.h',
135+
'runtime/vm/regexp/regexp_assembler_bytecode_inl.h',
136136
'runtime/vm/simulator_arm.h',
137137
'runtime/vm/simulator_arm64.h',
138138
'runtime/vm/simulator_riscv.h',

runtime/vm/BUILD.gn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import("../runtime_args.gni")
3939
import("compiler/compiler_sources.gni")
4040
import("ffi/ffi_sources.gni")
4141
import("heap/heap_sources.gni")
42+
import("regexp/regexp_sources.gni")
4243
import("vm_sources.gni")
4344

4445
config("libdart_vm_config") {
@@ -193,7 +194,8 @@ library_for_all_configs("libdart_vm") {
193194
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
194195
rebase_path(disassembler_sources, ".", "./compiler/") +
195196
rebase_path(ffi_sources, ".", "./ffi/") +
196-
rebase_path(heap_sources, ".", "./heap/")
197+
rebase_path(heap_sources, ".", "./heap/") +
198+
rebase_path(regexp_sources, ".", "./regexp/")
197199
if (is_android) {
198200
# Android specific workaround for a kernel bug. This source file can't
199201
# go into vm_sources list because it will break Windows build which

runtime/vm/canonical_tables.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "vm/canonical_tables.h"
66

7-
#include "vm/regexp.h"
7+
#include "vm/regexp/regexp.h"
88

99
namespace dart {
1010

runtime/vm/compiler/aot/precompiler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
#include "vm/os.h"
4848
#include "vm/parser.h"
4949
#include "vm/program_visitor.h"
50-
#include "vm/regexp_assembler.h"
51-
#include "vm/regexp_parser.h"
50+
#include "vm/regexp/regexp_assembler.h"
51+
#include "vm/regexp/regexp_parser.h"
5252
#include "vm/resolver.h"
5353
#include "vm/runtime_entry.h"
5454
#include "vm/stack_trace.h"

runtime/vm/compiler/backend/il.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "vm/object.h"
3838
#include "vm/object_store.h"
3939
#include "vm/os.h"
40-
#include "vm/regexp_assembler_ir.h"
40+
#include "vm/regexp/regexp_assembler_ir.h"
4141
#include "vm/resolver.h"
4242
#include "vm/runtime_entry.h"
4343
#include "vm/scopes.h"

runtime/vm/compiler/backend/type_propagator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "vm/bit_vector.h"
1010
#include "vm/compiler/compiler_state.h"
1111
#include "vm/object_store.h"
12-
#include "vm/regexp_assembler.h"
12+
#include "vm/regexp/regexp_assembler.h"
1313
#include "vm/resolver.h"
1414
#include "vm/timeline.h"
1515

runtime/vm/compiler/jit/compiler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#include "vm/object_store.h"
3838
#include "vm/os.h"
3939
#include "vm/parser.h"
40-
#include "vm/regexp_assembler.h"
41-
#include "vm/regexp_parser.h"
40+
#include "vm/regexp/regexp_assembler.h"
41+
#include "vm/regexp/regexp_parser.h"
4242
#include "vm/runtime_entry.h"
4343
#include "vm/symbols.h"
4444
#include "vm/tags.h"

runtime/vm/object.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include "vm/os.h"
5959
#include "vm/parser.h"
6060
#include "vm/profiler.h"
61-
#include "vm/regexp.h"
61+
#include "vm/regexp/regexp.h"
6262
#include "vm/resolver.h"
6363
#include "vm/reusable_handles.h"
6464
#include "vm/reverse_pc_lookup_cache.h"

runtime/vm/parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "vm/object.h"
2929
#include "vm/object_store.h"
3030
#include "vm/os.h"
31-
#include "vm/regexp_assembler.h"
31+
#include "vm/regexp/regexp_assembler.h"
3232
#include "vm/resolver.h"
3333
#include "vm/scopes.h"
3434
#include "vm/stack_frame.h"

runtime/vm/regexp.cc renamed to runtime/vm/regexp/regexp.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#include "vm/regexp.h"
5+
#include "vm/regexp/regexp.h"
66

77
#include <memory>
88

@@ -12,15 +12,15 @@
1212
#include "unicode/uniset.h"
1313

1414
#include "vm/dart_entry.h"
15-
#include "vm/regexp_assembler.h"
16-
#include "vm/regexp_assembler_bytecode.h"
17-
#include "vm/regexp_ast.h"
15+
#include "vm/regexp/regexp_assembler.h"
16+
#include "vm/regexp/regexp_assembler_bytecode.h"
17+
#include "vm/regexp/regexp_ast.h"
18+
#include "vm/regexp/unibrow-inl.h"
1819
#include "vm/symbols.h"
1920
#include "vm/thread.h"
20-
#include "vm/unibrow-inl.h"
2121

2222
#if !defined(DART_PRECOMPILED_RUNTIME)
23-
#include "vm/regexp_assembler_ir.h"
23+
#include "vm/regexp/regexp_assembler_ir.h"
2424
#endif // !defined(DART_PRECOMPILED_RUNTIME)
2525

2626
#define Z (zone())

runtime/vm/regexp.h renamed to runtime/vm/regexp/regexp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_H_
6-
#define RUNTIME_VM_REGEXP_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_H_
77

88
#include "platform/unicode.h"
99

1010
#include "vm/object.h"
11-
#include "vm/regexp_assembler.h"
11+
#include "vm/regexp/regexp_assembler.h"
1212
#include "vm/splay-tree.h"
1313

1414
namespace dart {
@@ -1527,4 +1527,4 @@ void CreateSpecializedFunction(Thread* thread,
15271527

15281528
} // namespace dart
15291529

1530-
#endif // RUNTIME_VM_REGEXP_H_
1530+
#endif // RUNTIME_VM_REGEXP_REGEXP_H_

runtime/vm/regexp_assembler.cc renamed to runtime/vm/regexp/regexp_assembler.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#include "vm/regexp_assembler.h"
5+
#include "vm/regexp/regexp_assembler.h"
66

77
#include "unicode/uchar.h"
88

99
#include "platform/unicode.h"
1010

1111
#include "vm/flags.h"
12-
#include "vm/regexp.h"
12+
#include "vm/regexp/regexp.h"
13+
#include "vm/regexp/unibrow-inl.h"
1314
#include "vm/runtime_entry.h"
14-
#include "vm/unibrow-inl.h"
1515

1616
namespace dart {
1717

runtime/vm/regexp_assembler.h renamed to runtime/vm/regexp/regexp_assembler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_H_
6-
#define RUNTIME_VM_REGEXP_ASSEMBLER_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_H_
77

88
#include "vm/object.h"
99

@@ -266,4 +266,4 @@ class RegExpMacroAssembler : public ZoneAllocated {
266266

267267
} // namespace dart
268268

269-
#endif // RUNTIME_VM_REGEXP_ASSEMBLER_H_
269+
#endif // RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_H_

runtime/vm/regexp_assembler_bytecode.cc renamed to runtime/vm/regexp/regexp_assembler_bytecode.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#include "vm/regexp_assembler_bytecode.h"
5+
#include "vm/regexp/regexp_assembler_bytecode.h"
66

77
#include "vm/exceptions.h"
88
#include "vm/object_store.h"
9-
#include "vm/regexp.h"
10-
#include "vm/regexp_assembler.h"
11-
#include "vm/regexp_assembler_bytecode_inl.h"
12-
#include "vm/regexp_bytecodes.h"
13-
#include "vm/regexp_interpreter.h"
14-
#include "vm/regexp_parser.h"
9+
#include "vm/regexp/regexp.h"
10+
#include "vm/regexp/regexp_assembler.h"
11+
#include "vm/regexp/regexp_assembler_bytecode_inl.h"
12+
#include "vm/regexp/regexp_bytecodes.h"
13+
#include "vm/regexp/regexp_interpreter.h"
14+
#include "vm/regexp/regexp_parser.h"
1515
#include "vm/timeline.h"
1616

1717
namespace dart {

runtime/vm/regexp_assembler_bytecode.h renamed to runtime/vm/regexp/regexp_assembler_bytecode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
6-
#define RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_H_
77

88
#include "vm/object.h"
9-
#include "vm/regexp_assembler.h"
9+
#include "vm/regexp/regexp_assembler.h"
1010

1111
namespace dart {
1212

@@ -143,4 +143,4 @@ class BytecodeRegExpMacroAssembler : public RegExpMacroAssembler {
143143

144144
} // namespace dart
145145

146-
#endif // RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_H_
146+
#endif // RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_H_

runtime/vm/regexp_assembler_bytecode_inl.h renamed to runtime/vm/regexp/regexp_assembler_bytecode_inl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
// A light-weight assembler for the Irregexp byte code.
66

7-
#include "vm/regexp_bytecodes.h"
7+
#include "vm/regexp/regexp_bytecodes.h"
88

9-
#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
10-
#define RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
9+
#ifndef RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_INL_H_
10+
#define RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_INL_H_
1111

1212
namespace dart {
1313

@@ -51,4 +51,4 @@ void BytecodeRegExpMacroAssembler::Emit32(uint32_t word) {
5151

5252
} // namespace dart
5353

54-
#endif // RUNTIME_VM_REGEXP_ASSEMBLER_BYTECODE_INL_H_
54+
#endif // RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_BYTECODE_INL_H_

runtime/vm/regexp_assembler_ir.cc renamed to runtime/vm/regexp/regexp_assembler_ir.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#if !defined(DART_PRECOMPILED_RUNTIME)
66

7-
#include "vm/regexp_assembler_ir.h"
7+
#include "vm/regexp/regexp_assembler_ir.h"
88

99
#include <utility>
1010

@@ -17,7 +17,7 @@
1717
#include "vm/dart_entry.h"
1818
#include "vm/longjump.h"
1919
#include "vm/object_store.h"
20-
#include "vm/regexp.h"
20+
#include "vm/regexp/regexp.h"
2121
#include "vm/resolver.h"
2222
#include "vm/runtime_entry.h"
2323
#include "vm/stack_frame.h"

runtime/vm/regexp_assembler_ir.h renamed to runtime/vm/regexp/regexp_assembler_ir.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
6-
#define RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_IR_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_IR_H_
77

88
#include "vm/compiler/assembler/assembler.h"
99
#include "vm/compiler/backend/il.h"
1010
#include "vm/object.h"
11-
#include "vm/regexp_assembler.h"
11+
#include "vm/regexp/regexp_assembler.h"
1212

1313
namespace dart {
1414

@@ -445,4 +445,4 @@ class IRRegExpMacroAssembler : public RegExpMacroAssembler {
445445

446446
} // namespace dart
447447

448-
#endif // RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_
448+
#endif // RUNTIME_VM_REGEXP_REGEXP_ASSEMBLER_IR_H_

runtime/vm/regexp_ast.cc renamed to runtime/vm/regexp/regexp_ast.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#include "vm/regexp_ast.h"
5+
#include "vm/regexp/regexp_ast.h"
66

77
#include "platform/utils.h"
88
#include "vm/os.h"

runtime/vm/regexp_ast.h renamed to runtime/vm/regexp/regexp_ast.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_AST_H_
6-
#define RUNTIME_VM_REGEXP_AST_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_AST_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_AST_H_
77

88
#include "platform/globals.h"
99
#include "platform/utils.h"
1010
#include "vm/allocation.h"
11-
#include "vm/regexp.h"
11+
#include "vm/regexp/regexp.h"
1212

1313
namespace dart {
1414

@@ -445,4 +445,4 @@ class RegExpEmpty : public RegExpTree {
445445

446446
} // namespace dart
447447

448-
#endif // RUNTIME_VM_REGEXP_AST_H_
448+
#endif // RUNTIME_VM_REGEXP_REGEXP_AST_H_

runtime/vm/regexp_bytecodes.h renamed to runtime/vm/regexp/regexp_bytecodes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
#ifndef RUNTIME_VM_REGEXP_BYTECODES_H_
6-
#define RUNTIME_VM_REGEXP_BYTECODES_H_
5+
#ifndef RUNTIME_VM_REGEXP_REGEXP_BYTECODES_H_
6+
#define RUNTIME_VM_REGEXP_REGEXP_BYTECODES_H_
77

88
namespace dart {
99

@@ -83,4 +83,4 @@ BYTECODE_ITERATOR(DECLARE_BYTECODE_LENGTH)
8383

8484
} // namespace dart
8585

86-
#endif // RUNTIME_VM_REGEXP_BYTECODES_H_
86+
#endif // RUNTIME_VM_REGEXP_REGEXP_BYTECODES_H_

0 commit comments

Comments
 (0)