OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 19881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19892 Visitor42 visitor(&object2); | 19892 Visitor42 visitor(&object2); |
19893 isolate->VisitHandlesForPartialDependence(&visitor); | 19893 isolate->VisitHandlesForPartialDependence(&visitor); |
19894 CHECK_EQ(1, visitor.counter_); | 19894 CHECK_EQ(1, visitor.counter_); |
19895 | 19895 |
19896 object1.Reset(); | 19896 object1.Reset(); |
19897 object2.Reset(); | 19897 object2.Reset(); |
19898 } | 19898 } |
19899 | 19899 |
19900 | 19900 |
19901 TEST(RegExp) { | 19901 TEST(RegExp) { |
19902 i::FLAG_harmony_regexps = true; | |
19903 i::FLAG_harmony_unicode_regexps = true; | 19902 i::FLAG_harmony_unicode_regexps = true; |
19904 LocalContext context; | 19903 LocalContext context; |
19905 v8::HandleScope scope(context->GetIsolate()); | 19904 v8::HandleScope scope(context->GetIsolate()); |
19906 | 19905 |
19907 v8::Local<v8::RegExp> re = | 19906 v8::Local<v8::RegExp> re = |
19908 v8::RegExp::New(context.local(), v8_str("foo"), v8::RegExp::kNone) | 19907 v8::RegExp::New(context.local(), v8_str("foo"), v8::RegExp::kNone) |
19909 .ToLocalChecked(); | 19908 .ToLocalChecked(); |
19910 CHECK(re->IsRegExp()); | 19909 CHECK(re->IsRegExp()); |
19911 CHECK(re->GetSource()->Equals(context.local(), v8_str("foo")).FromJust()); | 19910 CHECK(re->GetSource()->Equals(context.local(), v8_str("foo")).FromJust()); |
19912 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); | 19911 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); |
(...skipping 5019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24932 } | 24931 } |
24933 delete garbage; | 24932 delete garbage; |
24934 // Check that moderate memory pressure notification sets GC into memory | 24933 // Check that moderate memory pressure notification sets GC into memory |
24935 // optimizing mode. | 24934 // optimizing mode. |
24936 isolate->MemoryPressureNotification(v8::MemoryPressureLevel::kModerate); | 24935 isolate->MemoryPressureNotification(v8::MemoryPressureLevel::kModerate); |
24937 CHECK(CcTest::i_isolate()->heap()->ShouldOptimizeForMemoryUsage()); | 24936 CHECK(CcTest::i_isolate()->heap()->ShouldOptimizeForMemoryUsage()); |
24938 // Check that disabling memory pressure returns GC into normal mode. | 24937 // Check that disabling memory pressure returns GC into normal mode. |
24939 isolate->MemoryPressureNotification(v8::MemoryPressureLevel::kNone); | 24938 isolate->MemoryPressureNotification(v8::MemoryPressureLevel::kNone); |
24940 CHECK(!CcTest::i_isolate()->heap()->ShouldOptimizeForMemoryUsage()); | 24939 CHECK(!CcTest::i_isolate()->heap()->ShouldOptimizeForMemoryUsage()); |
24941 } | 24940 } |
OLD | NEW |