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

Unified Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 173567: ARM native regexps. (Closed)
Patch Set: Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: src/x64/regexp-macro-assembler-x64.cc
diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc
index 4c6a84d6ef242bdd7429896c1a9d165a0ef2be8c..c5ed68415c8a5e33a2ed10f4ee1a794160a01a12 100644
--- a/src/x64/regexp-macro-assembler-x64.cc
+++ b/src/x64/regexp-macro-assembler-x64.cc
@@ -39,6 +39,8 @@
namespace v8 {
namespace internal {
+#ifdef V8_NATIVE_REGEXP
+
/*
* This assembler uses the following register assignment convention
* - rdx : currently loaded character(s) as ASCII or UC16. Must be loaded using
@@ -350,8 +352,9 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
// Set byte_length.
__ movq(rdx, rbx);
#endif
- Address function_address = FUNCTION_ADDR(&CaseInsensitiveCompareUC16);
- CallCFunction(function_address, num_arguments);
+ ExternalReference compare =
+ ExternalReference::re_case_insensitive_compare_uc16();
+ CallCFunction(compare, num_arguments);
// Restore original values before reacting on result value.
__ Move(code_object_pointer(), masm_->CodeObject());
@@ -808,11 +811,12 @@ Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// First argument, backtrack stackpointer, is already in rcx.
__ lea(rdx, Operand(rbp, kStackHighEnd)); // Second argument
#else
- // AMD64 ABI passes paremeters in rdi, rsi.
+ // AMD64 ABI passes parameters in rdi, rsi.
__ movq(rdi, backtrack_stackpointer()); // First argument.
__ lea(rsi, Operand(rbp, kStackHighEnd)); // Second argument.
#endif
- CallCFunction(FUNCTION_ADDR(&GrowStack), num_arguments);
+ ExternalReference grow_stack = ExternalReference::re_grow_stack();
+ CallCFunction(grow_stack, num_arguments);
// If return NULL, we have failed to grow the stack, and
// must exit with a stack-overflow exception.
__ testq(rax, rax);
@@ -997,7 +1001,9 @@ void RegExpMacroAssemblerX64::CallCheckStackGuardState() {
// return address).
__ lea(rdi, Operand(rsp, -kPointerSize));
#endif
- CallCFunction(FUNCTION_ADDR(&CheckStackGuardState), num_arguments);
+ ExternalReference stack_check =
+ ExternalReference::re_check_stack_guard_state();
+ CallCFunction(stack_check, num_arguments);
}
@@ -1080,23 +1086,6 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
}
-Address RegExpMacroAssemblerX64::GrowStack(Address stack_pointer,
- Address* stack_base) {
- size_t size = RegExpStack::stack_capacity();
- Address old_stack_base = RegExpStack::stack_base();
- ASSERT(old_stack_base == *stack_base);
- ASSERT(stack_pointer <= old_stack_base);
- ASSERT(static_cast<size_t>(old_stack_base - stack_pointer) <= size);
- Address new_stack_base = RegExpStack::EnsureCapacity(size * 2);
- if (new_stack_base == NULL) {
- return NULL;
- }
- *stack_base = new_stack_base;
- intptr_t stack_content_size = old_stack_base - stack_pointer;
- return new_stack_base - stack_content_size;
-}
-
-
Operand RegExpMacroAssemblerX64::register_location(int register_index) {
ASSERT(register_index < (1<<30));
if (num_registers_ <= register_index) {
@@ -1256,12 +1245,12 @@ void RegExpMacroAssemblerX64::FrameAlign(int num_arguments) {
}
-void RegExpMacroAssemblerX64::CallCFunction(Address function_address,
+void RegExpMacroAssemblerX64::CallCFunction(ExternalReference function,
int num_arguments) {
// Don't compile regexps with serialization enabled. The addresses of the C++
// function being called isn't relocatable.
ASSERT(!Serializer::enabled());
- __ movq(rax, reinterpret_cast<intptr_t>(function_address), RelocInfo::NONE);
+ __ movq(rax, function);
__ call(rax);
ASSERT(OS::ActivationFrameAlignment() != 0);
#ifdef _WIN64
@@ -1297,5 +1286,12 @@ void RegExpMacroAssemblerX64::LoadCurrentCharacterUnchecked(int cp_offset,
}
+void RegExpCEntryStub::Generate(MacroAssembler* masm_) {
+ __ int3(); // Unused on x64.
+}
+
#undef __
+
+#endif // V8_NATIVE_REGEXP
+
}} // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698