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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 2832193002: Revert of [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/ia32/interface-descriptors-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 // Store it into the (fixed) result register. 455 // Store it into the (fixed) result register.
456 __ sub(esp, Immediate(kDoubleSize)); 456 __ sub(esp, Immediate(kDoubleSize));
457 __ fstp_d(Operand(esp, 0)); 457 __ fstp_d(Operand(esp, 0));
458 __ movsd(double_result, Operand(esp, 0)); 458 __ movsd(double_result, Operand(esp, 0));
459 __ add(esp, Immediate(kDoubleSize)); 459 __ add(esp, Immediate(kDoubleSize));
460 460
461 __ bind(&done); 461 __ bind(&done);
462 __ ret(0); 462 __ ret(0);
463 } 463 }
464 464
465 void RegExpExecStub::Generate(MacroAssembler* masm) {
466 #ifdef V8_INTERPRETED_REGEXP
467 // This case is handled prior to the RegExpExecStub call.
468 __ Abort(kUnexpectedRegExpExecCall);
469 #else // V8_INTERPRETED_REGEXP
470 // Isolates: note we add an additional parameter here (isolate pointer).
471 static const int kRegExpExecuteArguments = 9;
472 __ EnterApiExitFrame(kRegExpExecuteArguments);
473
474 // Argument 9: Pass current isolate address.
475 __ mov(Operand(esp, 8 * kPointerSize),
476 Immediate(ExternalReference::isolate_address(isolate())));
477
478 // Argument 8: Indicate that this is a direct call from JavaScript.
479 __ mov(Operand(esp, 7 * kPointerSize), Immediate(1));
480
481 // Argument 7: Start (high end) of backtracking stack memory area.
482 ExternalReference address_of_regexp_stack_memory_address =
483 ExternalReference::address_of_regexp_stack_memory_address(isolate());
484 ExternalReference address_of_regexp_stack_memory_size =
485 ExternalReference::address_of_regexp_stack_memory_size(isolate());
486 __ mov(esi, Operand::StaticVariable(address_of_regexp_stack_memory_address));
487 __ add(esi, Operand::StaticVariable(address_of_regexp_stack_memory_size));
488 __ mov(Operand(esp, 6 * kPointerSize), esi);
489
490 // Argument 6: Set the number of capture registers to zero to force global
491 // regexps to behave as non-global. This does not affect non-global regexps.
492 __ mov(Operand(esp, 5 * kPointerSize), Immediate(0));
493
494 // Argument 5: static offsets vector buffer.
495 __ mov(Operand(esp, 4 * kPointerSize),
496 Immediate(ExternalReference::address_of_static_offsets_vector(
497 isolate())));
498
499 // Argument 4: End of string data
500 // Argument 3: Start of string data
501 __ mov(Operand(esp, 3 * kPointerSize),
502 RegExpExecDescriptor::StringEndRegister());
503 __ mov(Operand(esp, 2 * kPointerSize),
504 RegExpExecDescriptor::StringStartRegister());
505
506 // Argument 2: Previous index.
507 __ mov(Operand(esp, 1 * kPointerSize),
508 RegExpExecDescriptor::LastIndexRegister());
509
510 // Argument 1: Original subject string.
511 __ mov(Operand(esp, 0 * kPointerSize),
512 RegExpExecDescriptor::StringRegister());
513
514 // Locate the code entry and call it.
515 __ add(RegExpExecDescriptor::CodeRegister(),
516 Immediate(Code::kHeaderSize - kHeapObjectTag));
517 __ call(RegExpExecDescriptor::CodeRegister());
518
519 // Drop arguments and come back to JS mode.
520 __ LeaveApiExitFrame(true);
521
522 // TODO(jgruber): Don't tag return value once this is supported by stubs.
523 __ SmiTag(eax);
524 __ ret(0 * kPointerSize);
525 #endif // V8_INTERPRETED_REGEXP
526 }
527
465 528
466 static int NegativeComparisonResult(Condition cc) { 529 static int NegativeComparisonResult(Condition cc) {
467 DCHECK(cc != equal); 530 DCHECK(cc != equal);
468 DCHECK((cc == less) || (cc == less_equal) 531 DCHECK((cc == less) || (cc == less_equal)
469 || (cc == greater) || (cc == greater_equal)); 532 || (cc == greater) || (cc == greater_equal));
470 return (cc == greater || cc == greater_equal) ? LESS : GREATER; 533 return (cc == greater || cc == greater_equal) ? LESS : GREATER;
471 } 534 }
472 535
473 536
474 static void CheckInputType(MacroAssembler* masm, Register input, 537 static void CheckInputType(MacroAssembler* masm, Register input,
(...skipping 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 kStackUnwindSpace, nullptr, return_value_operand, 2989 kStackUnwindSpace, nullptr, return_value_operand,
2927 NULL); 2990 NULL);
2928 } 2991 }
2929 2992
2930 #undef __ 2993 #undef __
2931 2994
2932 } // namespace internal 2995 } // namespace internal
2933 } // namespace v8 2996 } // namespace v8
2934 2997
2935 #endif // V8_TARGET_ARCH_IA32 2998 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698