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

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

Issue 392403002: ARM64: always restore regexp register cache after a C function call. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | test/mjsunit/regress/regress-regexp-nocase.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 __ Mov(x3, ExternalReference::isolate_address(isolate())); 390 __ Mov(x3, ExternalReference::isolate_address(isolate()));
391 391
392 { 392 {
393 AllowExternalCallThatCantCauseGC scope(masm_); 393 AllowExternalCallThatCantCauseGC scope(masm_);
394 ExternalReference function = 394 ExternalReference function =
395 ExternalReference::re_case_insensitive_compare_uc16(isolate()); 395 ExternalReference::re_case_insensitive_compare_uc16(isolate());
396 __ CallCFunction(function, argument_count); 396 __ CallCFunction(function, argument_count);
397 } 397 }
398 398
399 // Check if function returned non-zero for success or zero for failure. 399 // Check if function returned non-zero for success or zero for failure.
400 CompareAndBranchOrBacktrack(x0, 0, eq, on_no_match); 400 // x0 is one of the registers used as a cache so it must be tested before
401 // the cache is restored.
402 __ Cmp(x0, 0);
403 __ PopCPURegList(cached_registers);
404 BranchOrBacktrack(eq, on_no_match);
405
401 // On success, increment position by length of capture. 406 // On success, increment position by length of capture.
402 __ Add(current_input_offset(), current_input_offset(), capture_length); 407 __ Add(current_input_offset(), current_input_offset(), capture_length);
403 // Reset the cached registers.
404 __ PopCPURegList(cached_registers);
405 } 408 }
406 409
407 __ Bind(&fallthrough); 410 __ Bind(&fallthrough);
408 } 411 }
409 412
410 void RegExpMacroAssemblerARM64::CheckNotBackReference( 413 void RegExpMacroAssemblerARM64::CheckNotBackReference(
411 int start_reg, 414 int start_reg,
412 Label* on_no_match) { 415 Label* on_no_match) {
413 Label fallthrough; 416 Label fallthrough;
414 417
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); 1693 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW));
1691 } 1694 }
1692 } 1695 }
1693 } 1696 }
1694 1697
1695 #endif // V8_INTERPRETED_REGEXP 1698 #endif // V8_INTERPRETED_REGEXP
1696 1699
1697 }} // namespace v8::internal 1700 }} // namespace v8::internal
1698 1701
1699 #endif // V8_TARGET_ARCH_ARM64 1702 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-regexp-nocase.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698