| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 typedef RegExpMacroAssemblerX64 ArchRegExpMacroAssembler; | 656 typedef RegExpMacroAssemblerX64 ArchRegExpMacroAssembler; |
| 657 #elif V8_TARGET_ARCH_ARM | 657 #elif V8_TARGET_ARCH_ARM |
| 658 typedef RegExpMacroAssemblerARM ArchRegExpMacroAssembler; | 658 typedef RegExpMacroAssemblerARM ArchRegExpMacroAssembler; |
| 659 #elif V8_TARGET_ARCH_MIPS | 659 #elif V8_TARGET_ARCH_MIPS |
| 660 typedef RegExpMacroAssembler ArchRegExpMacroAssembler; | 660 typedef RegExpMacroAssembler ArchRegExpMacroAssembler; |
| 661 #endif | 661 #endif |
| 662 | 662 |
| 663 class ContextInitializer { | 663 class ContextInitializer { |
| 664 public: | 664 public: |
| 665 ContextInitializer() | 665 ContextInitializer() |
| 666 : env_(), scope_(), zone_(DELETE_ON_EXIT), stack_guard_() { | 666 : env_(), scope_(), zone_(DELETE_ON_EXIT) { |
| 667 env_ = v8::Context::New(); | 667 env_ = v8::Context::New(); |
| 668 env_->Enter(); | 668 env_->Enter(); |
| 669 } | 669 } |
| 670 ~ContextInitializer() { | 670 ~ContextInitializer() { |
| 671 env_->Exit(); | 671 env_->Exit(); |
| 672 env_.Dispose(); | 672 env_.Dispose(); |
| 673 } | 673 } |
| 674 private: | 674 private: |
| 675 v8::Persistent<v8::Context> env_; | 675 v8::Persistent<v8::Context> env_; |
| 676 v8::HandleScope scope_; | 676 v8::HandleScope scope_; |
| 677 v8::internal::ZoneScope zone_; | 677 v8::internal::ZoneScope zone_; |
| 678 v8::internal::StackGuard stack_guard_; | |
| 679 }; | 678 }; |
| 680 | 679 |
| 681 | 680 |
| 682 static ArchRegExpMacroAssembler::Result Execute(Code* code, | 681 static ArchRegExpMacroAssembler::Result Execute(Code* code, |
| 683 String* input, | 682 String* input, |
| 684 int start_offset, | 683 int start_offset, |
| 685 const byte* input_start, | 684 const byte* input_start, |
| 686 const byte* input_end, | 685 const byte* input_end, |
| 687 int* captures) { | 686 int* captures) { |
| 688 return NativeRegExpMacroAssembler::Execute( | 687 return NativeRegExpMacroAssembler::Execute( |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 bool in_second = CharacterInSet(&l2, i); | 1799 bool in_second = CharacterInSet(&l2, i); |
| 1801 CHECK((in_first || in_second) == CharacterInSet(&all, i)); | 1800 CHECK((in_first || in_second) == CharacterInSet(&all, i)); |
| 1802 } | 1801 } |
| 1803 } | 1802 } |
| 1804 | 1803 |
| 1805 | 1804 |
| 1806 TEST(Graph) { | 1805 TEST(Graph) { |
| 1807 V8::Initialize(NULL); | 1806 V8::Initialize(NULL); |
| 1808 Execute("\\b\\w+\\b", false, true, true); | 1807 Execute("\\b\\w+\\b", false, true, true); |
| 1809 } | 1808 } |
| OLD | NEW |