Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: test/cctest/test-regexp.cc

Issue 15038002: Revert "deprecate Context::New which returns Persistent" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-random.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 typedef RegExpMacroAssemblerX64 ArchRegExpMacroAssembler; 704 typedef RegExpMacroAssemblerX64 ArchRegExpMacroAssembler;
705 #elif V8_TARGET_ARCH_ARM 705 #elif V8_TARGET_ARCH_ARM
706 typedef RegExpMacroAssemblerARM ArchRegExpMacroAssembler; 706 typedef RegExpMacroAssemblerARM ArchRegExpMacroAssembler;
707 #elif V8_TARGET_ARCH_MIPS 707 #elif V8_TARGET_ARCH_MIPS
708 typedef RegExpMacroAssemblerMIPS ArchRegExpMacroAssembler; 708 typedef RegExpMacroAssemblerMIPS ArchRegExpMacroAssembler;
709 #endif 709 #endif
710 710
711 class ContextInitializer { 711 class ContextInitializer {
712 public: 712 public:
713 ContextInitializer() 713 ContextInitializer()
714 : scope_(v8::Isolate::GetCurrent()), 714 : env_(),
715 env_(v8::Context::New(v8::Isolate::GetCurrent())), 715 scope_(v8::Isolate::GetCurrent()),
716 zone_(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT) { 716 zone_(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT) {
717 env_ = v8::Context::New();
717 env_->Enter(); 718 env_->Enter();
718 } 719 }
719 ~ContextInitializer() { 720 ~ContextInitializer() {
720 env_->Exit(); 721 env_->Exit();
722 env_.Dispose(env_->GetIsolate());
721 } 723 }
722 private: 724 private:
725 v8::Persistent<v8::Context> env_;
723 v8::HandleScope scope_; 726 v8::HandleScope scope_;
724 v8::Handle<v8::Context> env_;
725 v8::internal::ZoneScope zone_; 727 v8::internal::ZoneScope zone_;
726 }; 728 };
727 729
728 730
729 static ArchRegExpMacroAssembler::Result Execute(Code* code, 731 static ArchRegExpMacroAssembler::Result Execute(Code* code,
730 String* input, 732 String* input,
731 int start_offset, 733 int start_offset,
732 const byte* input_start, 734 const byte* input_start,
733 const byte* input_end, 735 const byte* input_end,
734 int* captures) { 736 int* captures) {
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 ZoneList<CharacterRange> first_only(4, Isolate::Current()->runtime_zone()); 1805 ZoneList<CharacterRange> first_only(4, Isolate::Current()->runtime_zone());
1804 ZoneList<CharacterRange> second_only(4, Isolate::Current()->runtime_zone()); 1806 ZoneList<CharacterRange> second_only(4, Isolate::Current()->runtime_zone());
1805 ZoneList<CharacterRange> both(4, Isolate::Current()->runtime_zone()); 1807 ZoneList<CharacterRange> both(4, Isolate::Current()->runtime_zone());
1806 } 1808 }
1807 1809
1808 1810
1809 TEST(Graph) { 1811 TEST(Graph) {
1810 V8::Initialize(NULL); 1812 V8::Initialize(NULL);
1811 Execute("\\b\\w+\\b", false, true, true); 1813 Execute("\\b\\w+\\b", false, true, true);
1812 } 1814 }
OLDNEW
« no previous file with comments | « test/cctest/test-random.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698