diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-10 02:02:27 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-11 02:40:36 +0100 |
commit | f230a1cf749e984439b5bb9729d9db9f48472827 (patch) | |
tree | 153596de2251b717ad79823f23fabf4c140d6d35 /deps/v8/test/cctest/test-regexp.cc | |
parent | a12870c823b9b67110b27a470fcac342cf1dfbd6 (diff) | |
download | node-new-f230a1cf749e984439b5bb9729d9db9f48472827.tar.gz |
v8: upgrade to 3.22.24
This commit removes the simple/test-event-emitter-memory-leak test for
being unreliable with the new garbage collector: the memory pressure
exerted by the test case is too low for the garbage collector to kick
in. It can be made to work again by limiting the heap size with the
--max_old_space_size=x flag but that won't be very reliable across
platforms and architectures.
Diffstat (limited to 'deps/v8/test/cctest/test-regexp.cc')
-rw-r--r-- | deps/v8/test/cctest/test-regexp.cc | 87 |
1 files changed, 43 insertions, 44 deletions
diff --git a/deps/v8/test/cctest/test-regexp.cc b/deps/v8/test/cctest/test-regexp.cc index 14989ee980..cc946464b2 100644 --- a/deps/v8/test/cctest/test-regexp.cc +++ b/deps/v8/test/cctest/test-regexp.cc @@ -71,9 +71,9 @@ using namespace v8::internal; static bool CheckParse(const char* input) { V8::Initialize(NULL); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); - FlatStringReader reader(Isolate::Current(), CStrVector(input)); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); + FlatStringReader reader(CcTest::i_isolate(), CStrVector(input)); RegExpCompileData result; return v8::internal::RegExpParser::ParseRegExp( &reader, false, &result, &zone); @@ -82,9 +82,9 @@ static bool CheckParse(const char* input) { static SmartArrayPointer<const char> Parse(const char* input) { V8::Initialize(NULL); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); - FlatStringReader reader(Isolate::Current(), CStrVector(input)); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); + FlatStringReader reader(CcTest::i_isolate(), CStrVector(input)); RegExpCompileData result; CHECK(v8::internal::RegExpParser::ParseRegExp( &reader, false, &result, &zone)); @@ -97,9 +97,9 @@ static SmartArrayPointer<const char> Parse(const char* input) { static bool CheckSimple(const char* input) { V8::Initialize(NULL); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); - FlatStringReader reader(Isolate::Current(), CStrVector(input)); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); + FlatStringReader reader(CcTest::i_isolate(), CStrVector(input)); RegExpCompileData result; CHECK(v8::internal::RegExpParser::ParseRegExp( &reader, false, &result, &zone)); @@ -116,9 +116,9 @@ struct MinMaxPair { static MinMaxPair CheckMinMaxMatch(const char* input) { V8::Initialize(NULL); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); - FlatStringReader reader(Isolate::Current(), CStrVector(input)); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); + FlatStringReader reader(CcTest::i_isolate(), CStrVector(input)); RegExpCompileData result; CHECK(v8::internal::RegExpParser::ParseRegExp( &reader, false, &result, &zone)); @@ -390,9 +390,9 @@ TEST(ParserRegression) { static void ExpectError(const char* input, const char* expected) { V8::Initialize(NULL); - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); - FlatStringReader reader(Isolate::Current(), CStrVector(input)); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); + FlatStringReader reader(CcTest::i_isolate(), CStrVector(input)); RegExpCompileData result; CHECK(!v8::internal::RegExpParser::ParseRegExp( &reader, false, &result, &zone)); @@ -404,7 +404,6 @@ static void ExpectError(const char* input, TEST(Errors) { - V8::Initialize(NULL); const char* kEndBackslash = "\\ at end of pattern"; ExpectError("\\", kEndBackslash); const char* kUnterminatedGroup = "Unterminated group"; @@ -475,7 +474,7 @@ static bool NotWord(uc16 c) { static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) { - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange>* ranges = new(&zone) ZoneList<CharacterRange>(2, &zone); CharacterRange::AddClassEscape(c, ranges, &zone); @@ -507,7 +506,7 @@ static RegExpNode* Compile(const char* input, bool is_ascii, Zone* zone) { V8::Initialize(NULL); - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); FlatStringReader reader(isolate, CStrVector(input)); RegExpCompileData compile_data; if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, @@ -533,8 +532,8 @@ static void Execute(const char* input, bool multiline, bool is_ascii, bool dot_output = false) { - v8::HandleScope scope(v8::Isolate::GetCurrent()); - Zone zone(Isolate::Current()); + v8::HandleScope scope(CcTest::isolate()); + Zone zone(CcTest::i_isolate()); RegExpNode* node = Compile(input, multiline, is_ascii, &zone); USE(node); #ifdef DEBUG @@ -574,7 +573,7 @@ static unsigned PseudoRandom(int i, int j) { TEST(SplayTreeSimple) { v8::internal::V8::Initialize(NULL); static const unsigned kLimit = 1000; - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneSplayTree<TestConfig> tree(&zone); bool seen[kLimit]; for (unsigned i = 0; i < kLimit; i++) seen[i] = false; @@ -642,7 +641,7 @@ TEST(DispatchTableConstruction) { } } // Enter test data into dispatch table. - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); DispatchTable table(&zone); for (int i = 0; i < kRangeCount; i++) { uc16* range = ranges[i]; @@ -710,8 +709,8 @@ typedef RegExpMacroAssemblerMIPS ArchRegExpMacroAssembler; class ContextInitializer { public: ContextInitializer() - : scope_(v8::Isolate::GetCurrent()), - env_(v8::Context::New(v8::Isolate::GetCurrent())) { + : scope_(CcTest::isolate()), + env_(v8::Context::New(CcTest::isolate())) { env_->Enter(); } ~ContextInitializer() { @@ -737,14 +736,14 @@ static ArchRegExpMacroAssembler::Result Execute(Code* code, input_end, captures, 0, - Isolate::Current()); + CcTest::i_isolate()); } TEST(MacroAssemblerNativeSuccess) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -781,7 +780,7 @@ TEST(MacroAssemblerNativeSuccess) { TEST(MacroAssemblerNativeSimple) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -847,7 +846,7 @@ TEST(MacroAssemblerNativeSimple) { TEST(MacroAssemblerNativeSimpleUC16) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -918,7 +917,7 @@ TEST(MacroAssemblerNativeSimpleUC16) { TEST(MacroAssemblerNativeBacktrack) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -958,7 +957,7 @@ TEST(MacroAssemblerNativeBacktrack) { TEST(MacroAssemblerNativeBackReferenceASCII) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1007,7 +1006,7 @@ TEST(MacroAssemblerNativeBackReferenceASCII) { TEST(MacroAssemblerNativeBackReferenceUC16) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1059,7 +1058,7 @@ TEST(MacroAssemblerNativeBackReferenceUC16) { TEST(MacroAssemblernativeAtStart) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1118,7 +1117,7 @@ TEST(MacroAssemblernativeAtStart) { TEST(MacroAssemblerNativeBackRefNoCase) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1177,7 +1176,7 @@ TEST(MacroAssemblerNativeBackRefNoCase) { TEST(MacroAssemblerNativeRegisters) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1280,7 +1279,7 @@ TEST(MacroAssemblerNativeRegisters) { TEST(MacroAssemblerStackOverflow) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1319,7 +1318,7 @@ TEST(MacroAssemblerStackOverflow) { TEST(MacroAssemblerNativeLotsOfRegisters) { v8::V8::Initialize(); ContextInitializer initializer; - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); Zone zone(isolate); @@ -1370,7 +1369,7 @@ TEST(MacroAssemblerNativeLotsOfRegisters) { TEST(MacroAssembler) { V8::Initialize(NULL); byte codes[1024]; - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); RegExpMacroAssemblerIrregexp m(Vector<byte>(codes, 1024), &zone); // ^f(o)o. Label start, fail, backtrack; @@ -1403,7 +1402,7 @@ TEST(MacroAssembler) { m.PopRegister(0); m.Fail(); - Isolate* isolate = Isolate::Current(); + Isolate* isolate = CcTest::i_isolate(); Factory* factory = isolate->factory(); HandleScope scope(isolate); @@ -1438,7 +1437,7 @@ TEST(AddInverseToTable) { static const int kLimit = 1000; static const int kRangeCount = 16; for (int t = 0; t < 10; t++) { - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange>* ranges = new(&zone) ZoneList<CharacterRange>(kRangeCount, &zone); for (int i = 0; i < kRangeCount; i++) { @@ -1459,7 +1458,7 @@ TEST(AddInverseToTable) { CHECK_EQ(is_on, set->Get(0) == false); } } - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange>* ranges = new(&zone) ZoneList<CharacterRange>(1, &zone); ranges->Add(CharacterRange(0xFFF0, 0xFFFE), &zone); @@ -1572,7 +1571,7 @@ TEST(UncanonicalizeEquivalence) { static void TestRangeCaseIndependence(CharacterRange input, Vector<CharacterRange> expected) { - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); int count = expected.length(); ZoneList<CharacterRange>* list = new(&zone) ZoneList<CharacterRange>(count, &zone); @@ -1637,7 +1636,7 @@ static bool InClass(uc16 c, ZoneList<CharacterRange>* ranges) { TEST(CharClassDifference) { v8::internal::V8::Initialize(NULL); - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange>* base = new(&zone) ZoneList<CharacterRange>(1, &zone); base->Add(CharacterRange::Everything(), &zone); @@ -1665,7 +1664,7 @@ TEST(CharClassDifference) { TEST(CanonicalizeCharacterSets) { v8::internal::V8::Initialize(NULL); - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange>* list = new(&zone) ZoneList<CharacterRange>(4, &zone); CharacterSet set(list); @@ -1727,7 +1726,7 @@ TEST(CanonicalizeCharacterSets) { TEST(CharacterRangeMerge) { v8::internal::V8::Initialize(NULL); - Zone zone(Isolate::Current()); + Zone zone(CcTest::i_isolate()); ZoneList<CharacterRange> l1(4, &zone); ZoneList<CharacterRange> l2(4, &zone); // Create all combinations of intersections of ranges, both singletons and |