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

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

Issue 14429003: Refactor ExternalReference::isolate_address() to not rely on Isolate::Current(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // size_t byte_length - length of capture in bytes(!) 430 // size_t byte_length - length of capture in bytes(!)
431 // Isolate* isolate 431 // Isolate* isolate
432 #ifdef _WIN64 432 #ifdef _WIN64
433 // Compute and set byte_offset1 (start of capture). 433 // Compute and set byte_offset1 (start of capture).
434 __ lea(rcx, Operand(rsi, rdx, times_1, 0)); 434 __ lea(rcx, Operand(rsi, rdx, times_1, 0));
435 // Set byte_offset2. 435 // Set byte_offset2.
436 __ lea(rdx, Operand(rsi, rdi, times_1, 0)); 436 __ lea(rdx, Operand(rsi, rdi, times_1, 0));
437 // Set byte_length. 437 // Set byte_length.
438 __ movq(r8, rbx); 438 __ movq(r8, rbx);
439 // Isolate. 439 // Isolate.
440 __ LoadAddress(r9, ExternalReference::isolate_address()); 440 __ LoadAddress(r9, ExternalReference::isolate_address(masm_.isolate()));
441 #else // AMD64 calling convention 441 #else // AMD64 calling convention
442 // Compute byte_offset2 (current position = rsi+rdi). 442 // Compute byte_offset2 (current position = rsi+rdi).
443 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 443 __ lea(rax, Operand(rsi, rdi, times_1, 0));
444 // Compute and set byte_offset1 (start of capture). 444 // Compute and set byte_offset1 (start of capture).
445 __ lea(rdi, Operand(rsi, rdx, times_1, 0)); 445 __ lea(rdi, Operand(rsi, rdx, times_1, 0));
446 // Set byte_offset2. 446 // Set byte_offset2.
447 __ movq(rsi, rax); 447 __ movq(rsi, rax);
448 // Set byte_length. 448 // Set byte_length.
449 __ movq(rdx, rbx); 449 __ movq(rdx, rbx);
450 // Isolate. 450 // Isolate.
451 __ LoadAddress(rcx, ExternalReference::isolate_address()); 451 __ LoadAddress(rcx, ExternalReference::isolate_address(masm_.isolate()));
452 #endif 452 #endif
453 453
454 { // NOLINT: Can't find a way to open this scope without confusing the 454 { // NOLINT: Can't find a way to open this scope without confusing the
455 // linter. 455 // linter.
456 AllowExternalCallThatCantCauseGC scope(&masm_); 456 AllowExternalCallThatCantCauseGC scope(&masm_);
457 ExternalReference compare = 457 ExternalReference compare =
458 ExternalReference::re_case_insensitive_compare_uc16(masm_.isolate()); 458 ExternalReference::re_case_insensitive_compare_uc16(masm_.isolate());
459 __ CallCFunction(compare, num_arguments); 459 __ CallCFunction(compare, num_arguments);
460 } 460 }
461 461
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 __ push(rdi); 1048 __ push(rdi);
1049 #endif 1049 #endif
1050 1050
1051 // Call GrowStack(backtrack_stackpointer()) 1051 // Call GrowStack(backtrack_stackpointer())
1052 static const int num_arguments = 3; 1052 static const int num_arguments = 3;
1053 __ PrepareCallCFunction(num_arguments); 1053 __ PrepareCallCFunction(num_arguments);
1054 #ifdef _WIN64 1054 #ifdef _WIN64
1055 // Microsoft passes parameters in rcx, rdx, r8. 1055 // Microsoft passes parameters in rcx, rdx, r8.
1056 // First argument, backtrack stackpointer, is already in rcx. 1056 // First argument, backtrack stackpointer, is already in rcx.
1057 __ lea(rdx, Operand(rbp, kStackHighEnd)); // Second argument 1057 __ lea(rdx, Operand(rbp, kStackHighEnd)); // Second argument
1058 __ LoadAddress(r8, ExternalReference::isolate_address()); 1058 __ LoadAddress(r8, ExternalReference::isolate_address(masm_.isolate()));
1059 #else 1059 #else
1060 // AMD64 ABI passes parameters in rdi, rsi, rdx. 1060 // AMD64 ABI passes parameters in rdi, rsi, rdx.
1061 __ movq(rdi, backtrack_stackpointer()); // First argument. 1061 __ movq(rdi, backtrack_stackpointer()); // First argument.
1062 __ lea(rsi, Operand(rbp, kStackHighEnd)); // Second argument. 1062 __ lea(rsi, Operand(rbp, kStackHighEnd)); // Second argument.
1063 __ LoadAddress(rdx, ExternalReference::isolate_address()); 1063 __ LoadAddress(rdx, ExternalReference::isolate_address(masm_.isolate()));
1064 #endif 1064 #endif
1065 ExternalReference grow_stack = 1065 ExternalReference grow_stack =
1066 ExternalReference::re_grow_stack(masm_.isolate()); 1066 ExternalReference::re_grow_stack(masm_.isolate());
1067 __ CallCFunction(grow_stack, num_arguments); 1067 __ CallCFunction(grow_stack, num_arguments);
1068 // If return NULL, we have failed to grow the stack, and 1068 // If return NULL, we have failed to grow the stack, and
1069 // must exit with a stack-overflow exception. 1069 // must exit with a stack-overflow exception.
1070 __ testq(rax, rax); 1070 __ testq(rax, rax);
1071 __ j(equal, &exit_with_exception); 1071 __ j(equal, &exit_with_exception);
1072 // Otherwise use return value as new stack pointer. 1072 // Otherwise use return value as new stack pointer.
1073 __ movq(backtrack_stackpointer(), rax); 1073 __ movq(backtrack_stackpointer(), rax);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 } 1534 }
1535 } 1535 }
1536 1536
1537 #undef __ 1537 #undef __
1538 1538
1539 #endif // V8_INTERPRETED_REGEXP 1539 #endif // V8_INTERPRETED_REGEXP
1540 1540
1541 }} // namespace v8::internal 1541 }} // namespace v8::internal
1542 1542
1543 #endif // V8_TARGET_ARCH_X64 1543 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698