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

Side by Side Diff: src/regexp-macro-assembler-ia32.cc

Issue 53047: Implement string.match in C++. (Closed)
Patch Set: Created 11 years, 9 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
OLDNEW
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 955
956 956
957 RegExpMacroAssemblerIA32::Result RegExpMacroAssemblerIA32::Match( 957 RegExpMacroAssemblerIA32::Result RegExpMacroAssemblerIA32::Match(
958 Handle<Code> regexp_code, 958 Handle<Code> regexp_code,
959 Handle<String> subject, 959 Handle<String> subject,
960 int* offsets_vector, 960 int* offsets_vector,
961 int offsets_vector_length, 961 int offsets_vector_length,
962 int previous_index) { 962 int previous_index) {
963 963
964 ASSERT(subject->IsFlat()); 964 ASSERT(subject->IsFlat());
965 ASSERT(previous_index >= 0);
966 ASSERT(previous_index <= subject->length());
965 967
966 // No allocations before calling the regexp, but we can't use 968 // No allocations before calling the regexp, but we can't use
967 // AssertNoAllocation, since regexps might be preempted, and another thread 969 // AssertNoAllocation, since regexps might be preempted, and another thread
968 // might do allocation anyway. 970 // might do allocation anyway.
969 971
970 String* subject_ptr = *subject; 972 String* subject_ptr = *subject;
971 // Character offsets into string. 973 // Character offsets into string.
972 int start_offset = previous_index; 974 int start_offset = previous_index;
973 int end_offset = subject_ptr->length(); 975 int end_offset = subject_ptr->length();
974 976
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 1381
1380 1382
1381 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, 1383 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg,
1382 ArraySlice* buffer) { 1384 ArraySlice* buffer) {
1383 __ mov(reg, buffer->array()); 1385 __ mov(reg, buffer->array());
1384 __ add(Operand(reg), Immediate(buffer->base_offset())); 1386 __ add(Operand(reg), Immediate(buffer->base_offset()));
1385 } 1387 }
1386 1388
1387 #undef __ 1389 #undef __
1388 }} // namespace v8::internal 1390 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-win32.cc ('k') | src/runtime.h » ('j') | src/string.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698