summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-regexp.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-05-27 16:37:42 +0200
committerMichaël Zasso <targos@protonmail.com>2016-06-29 09:04:28 +0200
commit2cc29517966de7257a2f1b34c58c77225a21e05d (patch)
tree210bd177df2f06eec16e1e22edafdbcbffe66f8a /deps/v8/test/cctest/test-regexp.cc
parentbbf3838c70aaec1dd296fa75ae334fd1c7866df3 (diff)
downloadnode-new-2cc29517966de7257a2f1b34c58c77225a21e05d.tar.gz
deps: update V8 to 5.1.281.69
Pick up the latest branch-head for V8 5.1. This branch brings in improved language support and performance improvements. For full details: http://v8project.blogspot.com/2016/04/v8-release-51.html * Picks up the latest branch head for 5.1 [1] * Edit v8 gitignore to allow trace_event copy * Update V8 DEP trace_event as per deps/v8/DEPS [2] [1] https://chromium.googlesource.com/v8/v8.git/+/dc81244 [2] https://chromium.googlesource.com/chromium/src/base/trace_event/common/+/c8c8665 PR-URL: https://github.com/nodejs/node/pull/7016 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/test/cctest/test-regexp.cc')
-rw-r--r--deps/v8/test/cctest/test-regexp.cc68
1 files changed, 37 insertions, 31 deletions
diff --git a/deps/v8/test/cctest/test-regexp.cc b/deps/v8/test/cctest/test-regexp.cc
index 22321c3664..0a153b78e0 100644
--- a/deps/v8/test/cctest/test-regexp.cc
+++ b/deps/v8/test/cctest/test-regexp.cc
@@ -54,6 +54,11 @@
#include "src/arm64/macro-assembler-arm64.h"
#include "src/regexp/arm64/regexp-macro-assembler-arm64.h"
#endif
+#if V8_TARGET_ARCH_S390
+#include "src/regexp/s390/regexp-macro-assembler-s390.h"
+#include "src/s390/assembler-s390.h"
+#include "src/s390/macro-assembler-s390.h"
+#endif
#if V8_TARGET_ARCH_PPC
#include "src/ppc/assembler-ppc.h"
#include "src/ppc/macro-assembler-ppc.h"
@@ -92,7 +97,7 @@ using namespace v8::internal;
static bool CheckParse(const char* input) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
return v8::internal::RegExpParser::ParseRegExp(
@@ -103,7 +108,7 @@ static bool CheckParse(const char* input) {
static void CheckParseEq(const char* input, const char* expected,
bool unicode = false) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
JSRegExp::Flags flags = JSRegExp::kNone;
@@ -123,7 +128,7 @@ static void CheckParseEq(const char* input, const char* expected,
static bool CheckSimple(const char* input) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
CHECK(v8::internal::RegExpParser::ParseRegExp(
@@ -141,7 +146,7 @@ struct MinMaxPair {
static MinMaxPair CheckMinMaxMatch(const char* input) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
CHECK(v8::internal::RegExpParser::ParseRegExp(
@@ -456,7 +461,7 @@ TEST(ParserRegression) {
static void ExpectError(const char* input,
const char* expected) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
RegExpCompileData result;
CHECK(!v8::internal::RegExpParser::ParseRegExp(
@@ -525,7 +530,7 @@ static bool NotWord(uc16 c) {
static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange>* ranges =
new(&zone) ZoneList<CharacterRange>(2, &zone);
CharacterRange::AddClassEscape(c, ranges, &zone);
@@ -576,7 +581,7 @@ static RegExpNode* Compile(const char* input, bool multiline, bool unicode,
static void Execute(const char* input, bool multiline, bool unicode,
bool is_one_byte, bool dot_output = false) {
v8::HandleScope scope(CcTest::isolate());
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
RegExpNode* node = Compile(input, multiline, unicode, is_one_byte, &zone);
USE(node);
#ifdef DEBUG
@@ -614,7 +619,7 @@ static unsigned PseudoRandom(int i, int j) {
TEST(SplayTreeSimple) {
static const unsigned kLimit = 1000;
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneSplayTree<TestConfig> tree(&zone);
bool seen[kLimit];
for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
@@ -681,7 +686,7 @@ TEST(DispatchTableConstruction) {
}
}
// Enter test data into dispatch table.
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
DispatchTable table(&zone);
for (int i = 0; i < kRangeCount; i++) {
uc16* range = ranges[i];
@@ -744,6 +749,8 @@ typedef RegExpMacroAssemblerX64 ArchRegExpMacroAssembler;
typedef RegExpMacroAssemblerARM ArchRegExpMacroAssembler;
#elif V8_TARGET_ARCH_ARM64
typedef RegExpMacroAssemblerARM64 ArchRegExpMacroAssembler;
+#elif V8_TARGET_ARCH_S390
+typedef RegExpMacroAssemblerS390 ArchRegExpMacroAssembler;
#elif V8_TARGET_ARCH_PPC
typedef RegExpMacroAssemblerPPC ArchRegExpMacroAssembler;
#elif V8_TARGET_ARCH_MIPS
@@ -793,7 +800,7 @@ TEST(MacroAssemblerNativeSuccess) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
4);
@@ -831,7 +838,7 @@ TEST(MacroAssemblerNativeSimple) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
4);
@@ -898,7 +905,7 @@ TEST(MacroAssemblerNativeSimpleUC16) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
4);
@@ -971,7 +978,7 @@ TEST(MacroAssemblerNativeBacktrack) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
0);
@@ -1012,7 +1019,7 @@ TEST(MacroAssemblerNativeBackReferenceLATIN1) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
4);
@@ -1062,7 +1069,7 @@ TEST(MacroAssemblerNativeBackReferenceUC16) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
4);
@@ -1115,7 +1122,7 @@ TEST(MacroAssemblernativeAtStart) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
0);
@@ -1175,7 +1182,7 @@ TEST(MacroAssemblerNativeBackRefNoCase) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
4);
@@ -1234,7 +1241,7 @@ TEST(MacroAssemblerNativeRegisters) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
6);
@@ -1336,7 +1343,7 @@ TEST(MacroAssemblerStackOverflow) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
0);
@@ -1375,7 +1382,7 @@ TEST(MacroAssemblerNativeLotsOfRegisters) {
ContextInitializer initializer;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
2);
@@ -1423,7 +1430,7 @@ TEST(MacroAssemblerNativeLotsOfRegisters) {
TEST(MacroAssembler) {
byte codes[1024];
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
RegExpMacroAssemblerIrregexp m(CcTest::i_isolate(), Vector<byte>(codes, 1024),
&zone);
// ^f(o)o.
@@ -1491,7 +1498,7 @@ TEST(AddInverseToTable) {
static const int kLimit = 1000;
static const int kRangeCount = 16;
for (int t = 0; t < 10; t++) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange>* ranges =
new(&zone) ZoneList<CharacterRange>(kRangeCount, &zone);
for (int i = 0; i < kRangeCount; i++) {
@@ -1512,7 +1519,7 @@ TEST(AddInverseToTable) {
CHECK_EQ(is_on, set->Get(0) == false);
}
}
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange>* ranges =
new(&zone) ZoneList<CharacterRange>(1, &zone);
ranges->Add(CharacterRange::Range(0xFFF0, 0xFFFE), &zone);
@@ -1625,7 +1632,7 @@ TEST(UncanonicalizeEquivalence) {
static void TestRangeCaseIndependence(Isolate* isolate, CharacterRange input,
Vector<CharacterRange> expected) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
int count = expected.length();
ZoneList<CharacterRange>* list =
new(&zone) ZoneList<CharacterRange>(count, &zone);
@@ -1694,7 +1701,7 @@ static bool InClass(uc32 c, ZoneList<CharacterRange>* ranges) {
TEST(UnicodeRangeSplitter) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange>* base =
new(&zone) ZoneList<CharacterRange>(1, &zone);
base->Add(CharacterRange::Everything(), &zone);
@@ -1738,7 +1745,7 @@ TEST(UnicodeRangeSplitter) {
TEST(CanonicalizeCharacterSets) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange>* list =
new(&zone) ZoneList<CharacterRange>(4, &zone);
CharacterSet set(list);
@@ -1799,7 +1806,7 @@ TEST(CanonicalizeCharacterSets) {
TEST(CharacterRangeMerge) {
- Zone zone;
+ Zone zone(CcTest::i_isolate()->allocator());
ZoneList<CharacterRange> l1(4, &zone);
ZoneList<CharacterRange> l2(4, &zone);
// Create all combinations of intersections of ranges, both singletons and
@@ -1904,7 +1911,6 @@ void MockUseCounterCallback(v8::Isolate* isolate,
// Test that ES2015 RegExp compatibility fixes are in place, that they
// are not overly broad, and the appropriate UseCounters are incremented
TEST(UseCountRegExp) {
- i::FLAG_harmony_regexps = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
LocalContext env;
@@ -1943,7 +1949,7 @@ TEST(UseCountRegExp) {
// a UseCounter is incremented to track it.
v8::Local<v8::Value> resultToString =
CompileRun("RegExp.prototype.toString().length");
- CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
+ CHECK_EQ(2, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
CHECK(resultToString->IsInt32());
CHECK_EQ(6,
@@ -1951,7 +1957,7 @@ TEST(UseCountRegExp) {
// .toString() works on normal RegExps
v8::Local<v8::Value> resultReToString = CompileRun("/a/.toString().length");
- CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
+ CHECK_EQ(2, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
CHECK(resultReToString->IsInt32());
CHECK_EQ(
@@ -1963,7 +1969,7 @@ TEST(UseCountRegExp) {
"try { RegExp.prototype.toString.call(null) }"
"catch (e) { exception = e; }"
"exception");
- CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
+ CHECK_EQ(2, use_counts[v8::Isolate::kRegExpPrototypeStickyGetter]);
CHECK_EQ(1, use_counts[v8::Isolate::kRegExpPrototypeToString]);
CHECK(resultToStringError->IsObject());
}