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

Side by Side Diff: src/jsregexp.cc

Issue 16337005: Deprecate FACTORY helper macro. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « src/isolate.cc ('k') | src/liveedit.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 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 bit ^= 1; 1866 bit ^= 1;
1867 for (int i = start_index; i < end_index; i++) { 1867 for (int i = start_index; i < end_index; i++) {
1868 for (j = (ranges->at(i) & kMask); j < (ranges->at(i + 1) & kMask); j++) { 1868 for (j = (ranges->at(i) & kMask); j < (ranges->at(i + 1) & kMask); j++) {
1869 templ[j] = bit; 1869 templ[j] = bit;
1870 } 1870 }
1871 bit ^= 1; 1871 bit ^= 1;
1872 } 1872 }
1873 for (int i = j; i < kSize; i++) { 1873 for (int i = j; i < kSize; i++) {
1874 templ[i] = bit; 1874 templ[i] = bit;
1875 } 1875 }
1876 Factory* factory = Isolate::Current()->factory();
1876 // TODO(erikcorry): Cache these. 1877 // TODO(erikcorry): Cache these.
1877 Handle<ByteArray> ba = FACTORY->NewByteArray(kSize, TENURED); 1878 Handle<ByteArray> ba = factory->NewByteArray(kSize, TENURED);
1878 for (int i = 0; i < kSize; i++) { 1879 for (int i = 0; i < kSize; i++) {
1879 ba->set(i, templ[i]); 1880 ba->set(i, templ[i]);
1880 } 1881 }
1881 masm->CheckBitInTable(ba, on_bit_set); 1882 masm->CheckBitInTable(ba, on_bit_set);
1882 if (on_bit_clear != fall_through) masm->GoTo(on_bit_clear); 1883 if (on_bit_clear != fall_through) masm->GoTo(on_bit_clear);
1883 } 1884 }
1884 1885
1885 1886
1886 static void CutOutRange(RegExpMacroAssembler* masm, 1887 static void CutOutRange(RegExpMacroAssembler* masm,
1887 ZoneList<int>* ranges, 1888 ZoneList<int>* ranges,
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
3820 &cont); 3821 &cont);
3821 } else { 3822 } else {
3822 masm->CheckCharacter(single_character, &cont); 3823 masm->CheckCharacter(single_character, &cont);
3823 } 3824 }
3824 masm->AdvanceCurrentPosition(lookahead_width); 3825 masm->AdvanceCurrentPosition(lookahead_width);
3825 masm->GoTo(&again); 3826 masm->GoTo(&again);
3826 masm->Bind(&cont); 3827 masm->Bind(&cont);
3827 return true; 3828 return true;
3828 } 3829 }
3829 3830
3830 Handle<ByteArray> boolean_skip_table = 3831 Factory* factory = Isolate::Current()->factory();
3831 FACTORY->NewByteArray(kSize, TENURED); 3832 Handle<ByteArray> boolean_skip_table = factory->NewByteArray(kSize, TENURED);
3832 int skip_distance = GetSkipTable( 3833 int skip_distance = GetSkipTable(
3833 min_lookahead, max_lookahead, boolean_skip_table); 3834 min_lookahead, max_lookahead, boolean_skip_table);
3834 ASSERT(skip_distance != 0); 3835 ASSERT(skip_distance != 0);
3835 3836
3836 Label cont, again; 3837 Label cont, again;
3837 masm->Bind(&again); 3838 masm->Bind(&again);
3838 masm->LoadCurrentCharacter(max_lookahead, &cont, true); 3839 masm->LoadCurrentCharacter(max_lookahead, &cont, true);
3839 masm->CheckBitInTable(boolean_skip_table, &cont); 3840 masm->CheckBitInTable(boolean_skip_table, &cont);
3840 masm->AdvanceCurrentPosition(skip_distance); 3841 masm->AdvanceCurrentPosition(skip_distance);
3841 masm->GoTo(&again); 3842 masm->GoTo(&again);
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after
6122 } 6123 }
6123 6124
6124 return compiler.Assemble(&macro_assembler, 6125 return compiler.Assemble(&macro_assembler,
6125 node, 6126 node,
6126 data->capture_count, 6127 data->capture_count,
6127 pattern); 6128 pattern);
6128 } 6129 }
6129 6130
6130 6131
6131 }} // namespace v8::internal 6132 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698