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

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

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 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/ia32/macro-assembler-ia32.cc ('k') | src/ia32/stub-cache-ia32.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 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 * bool at_start, 92 * bool at_start,
93 * byte* stack_area_base, 93 * byte* stack_area_base,
94 * bool direct_call) 94 * bool direct_call)
95 */ 95 */
96 96
97 #define __ ACCESS_MASM(masm_) 97 #define __ ACCESS_MASM(masm_)
98 98
99 RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32( 99 RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32(
100 Mode mode, 100 Mode mode,
101 int registers_to_save) 101 int registers_to_save)
102 : masm_(new MacroAssembler(Isolate::Current(), NULL, kRegExpCodeSize)), 102 : masm_(new MacroAssembler(NULL, kRegExpCodeSize)),
103 mode_(mode), 103 mode_(mode),
104 num_registers_(registers_to_save), 104 num_registers_(registers_to_save),
105 num_saved_registers_(registers_to_save), 105 num_saved_registers_(registers_to_save),
106 entry_label_(), 106 entry_label_(),
107 start_label_(), 107 start_label_(),
108 success_label_(), 108 success_label_(),
109 backtrack_label_(), 109 backtrack_label_(),
110 exit_label_() { 110 exit_label_() {
111 ASSERT_EQ(0, registers_to_save % 2); 111 ASSERT_EQ(0, registers_to_save % 2);
112 __ jmp(&entry_label_); // We'll write the entry code later. 112 __ jmp(&entry_label_); // We'll write the entry code later.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // Compute new value of character position after the matched part. 365 // Compute new value of character position after the matched part.
366 __ sub(edi, Operand(esi)); 366 __ sub(edi, Operand(esi));
367 } else { 367 } else {
368 ASSERT(mode_ == UC16); 368 ASSERT(mode_ == UC16);
369 // Save registers before calling C function. 369 // Save registers before calling C function.
370 __ push(esi); 370 __ push(esi);
371 __ push(edi); 371 __ push(edi);
372 __ push(backtrack_stackpointer()); 372 __ push(backtrack_stackpointer());
373 __ push(ebx); 373 __ push(ebx);
374 374
375 static const int argument_count = 4; 375 static const int argument_count = 3;
376 __ PrepareCallCFunction(argument_count, ecx); 376 __ PrepareCallCFunction(argument_count, ecx);
377 // Put arguments into allocated stack area, last argument highest on stack. 377 // Put arguments into allocated stack area, last argument highest on stack.
378 // Parameters are 378 // Parameters are
379 // Address byte_offset1 - Address captured substring's start. 379 // Address byte_offset1 - Address captured substring's start.
380 // Address byte_offset2 - Address of current character position. 380 // Address byte_offset2 - Address of current character position.
381 // size_t byte_length - length of capture in bytes(!) 381 // size_t byte_length - length of capture in bytes(!)
382 // Isolate* isolate
383 382
384 // Set isolate.
385 __ mov(Operand(esp, 3 * kPointerSize),
386 Immediate(ExternalReference::isolate_address()));
387 // Set byte_length. 383 // Set byte_length.
388 __ mov(Operand(esp, 2 * kPointerSize), ebx); 384 __ mov(Operand(esp, 2 * kPointerSize), ebx);
389 // Set byte_offset2. 385 // Set byte_offset2.
390 // Found by adding negative string-end offset of current position (edi) 386 // Found by adding negative string-end offset of current position (edi)
391 // to end of string. 387 // to end of string.
392 __ add(edi, Operand(esi)); 388 __ add(edi, Operand(esi));
393 __ mov(Operand(esp, 1 * kPointerSize), edi); 389 __ mov(Operand(esp, 1 * kPointerSize), edi);
394 // Set byte_offset1. 390 // Set byte_offset1.
395 // Start of capture, where edx already holds string-end negative offset. 391 // Start of capture, where edx already holds string-end negative offset.
396 __ add(edx, Operand(esi)); 392 __ add(edx, Operand(esi));
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 if (stack_overflow_label_.is_linked()) { 831 if (stack_overflow_label_.is_linked()) {
836 SafeCallTarget(&stack_overflow_label_); 832 SafeCallTarget(&stack_overflow_label_);
837 // Reached if the backtrack-stack limit has been hit. 833 // Reached if the backtrack-stack limit has been hit.
838 834
839 Label grow_failed; 835 Label grow_failed;
840 // Save registers before calling C function 836 // Save registers before calling C function
841 __ push(esi); 837 __ push(esi);
842 __ push(edi); 838 __ push(edi);
843 839
844 // Call GrowStack(backtrack_stackpointer()) 840 // Call GrowStack(backtrack_stackpointer())
845 static const int num_arguments = 3; 841 static const int num_arguments = 2;
846 __ PrepareCallCFunction(num_arguments, ebx); 842 __ PrepareCallCFunction(num_arguments, ebx);
847 __ mov(Operand(esp, 2 * kPointerSize),
848 Immediate(ExternalReference::isolate_address()));
849 __ lea(eax, Operand(ebp, kStackHighEnd)); 843 __ lea(eax, Operand(ebp, kStackHighEnd));
850 __ mov(Operand(esp, 1 * kPointerSize), eax); 844 __ mov(Operand(esp, 1 * kPointerSize), eax);
851 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer()); 845 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer());
852 ExternalReference grow_stack = 846 ExternalReference grow_stack =
853 ExternalReference::re_grow_stack(masm_->isolate()); 847 ExternalReference::re_grow_stack(masm_->isolate());
854 __ CallCFunction(grow_stack, num_arguments); 848 __ CallCFunction(grow_stack, num_arguments);
855 // If return NULL, we have failed to grow the stack, and 849 // If return NULL, we have failed to grow the stack, and
856 // must exit with a stack-overflow exception. 850 // must exit with a stack-overflow exception.
857 __ or_(eax, Operand(eax)); 851 __ or_(eax, Operand(eax));
858 __ j(equal, &exit_with_exception); 852 __ j(equal, &exit_with_exception);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 } 1249 }
1256 1250
1257 1251
1258 #undef __ 1252 #undef __
1259 1253
1260 #endif // V8_INTERPRETED_REGEXP 1254 #endif // V8_INTERPRETED_REGEXP
1261 1255
1262 }} // namespace v8::internal 1256 }} // namespace v8::internal
1263 1257
1264 #endif // V8_TARGET_ARCH_IA32 1258 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698