OLD | NEW |
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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 __ leap(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize)); | 1089 __ leap(rdi, FieldOperand(rdi, rdx, times_1, Code::kHeaderSize)); |
1090 __ jmp(rdi); | 1090 __ jmp(rdi); |
1091 } | 1091 } |
1092 | 1092 |
1093 | 1093 |
1094 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1094 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1095 // Just jump directly to runtime if native RegExp is not selected at compile | 1095 // Just jump directly to runtime if native RegExp is not selected at compile |
1096 // time or if regexp entry in generated code is turned off runtime switch or | 1096 // time or if regexp entry in generated code is turned off runtime switch or |
1097 // at compilation. | 1097 // at compilation. |
1098 #ifdef V8_INTERPRETED_REGEXP | 1098 #ifdef V8_INTERPRETED_REGEXP |
1099 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); | 1099 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
1100 #else // V8_INTERPRETED_REGEXP | 1100 #else // V8_INTERPRETED_REGEXP |
1101 | 1101 |
1102 // Stack frame on entry. | 1102 // Stack frame on entry. |
1103 // rsp[0] : return address | 1103 // rsp[0] : return address |
1104 // rsp[8] : last_match_info (expected JSArray) | 1104 // rsp[8] : last_match_info (expected JSArray) |
1105 // rsp[16] : previous index | 1105 // rsp[16] : previous index |
1106 // rsp[24] : subject string | 1106 // rsp[24] : subject string |
1107 // rsp[32] : JSRegExp object | 1107 // rsp[32] : JSRegExp object |
1108 | 1108 |
1109 enum RegExpExecStubArgumentIndices { | 1109 enum RegExpExecStubArgumentIndices { |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); | 1477 __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex); |
1478 __ cmpp(rax, rdx); | 1478 __ cmpp(rax, rdx); |
1479 __ j(equal, &runtime); | 1479 __ j(equal, &runtime); |
1480 | 1480 |
1481 // For exception, throw the exception again. | 1481 // For exception, throw the exception again. |
1482 __ EnterExitFrame(false); | 1482 __ EnterExitFrame(false); |
1483 ThrowPendingException(masm); | 1483 ThrowPendingException(masm); |
1484 | 1484 |
1485 // Do the runtime call to execute the regexp. | 1485 // Do the runtime call to execute the regexp. |
1486 __ bind(&runtime); | 1486 __ bind(&runtime); |
1487 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); | 1487 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
1488 | 1488 |
1489 // Deferred code for string handling. | 1489 // Deferred code for string handling. |
1490 // (7) Not a long external string? If yes, go to (10). | 1490 // (7) Not a long external string? If yes, go to (10). |
1491 __ bind(¬_seq_nor_cons); | 1491 __ bind(¬_seq_nor_cons); |
1492 // Compare flags are still set from (3). | 1492 // Compare flags are still set from (3). |
1493 __ j(greater, ¬_long_external, Label::kNear); // Go to (10). | 1493 __ j(greater, ¬_long_external, Label::kNear); // Go to (10). |
1494 | 1494 |
1495 // (8) External string. Short external strings have been ruled out. | 1495 // (8) External string. Short external strings have been ruled out. |
1496 __ bind(&external_string); | 1496 __ bind(&external_string); |
1497 __ movp(rbx, FieldOperand(rdi, HeapObject::kMapOffset)); | 1497 __ movp(rbx, FieldOperand(rdi, HeapObject::kMapOffset)); |
(...skipping 3647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5145 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5145 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5146 kStackSpace, nullptr, return_value_operand, NULL); | 5146 kStackSpace, nullptr, return_value_operand, NULL); |
5147 } | 5147 } |
5148 | 5148 |
5149 | 5149 |
5150 #undef __ | 5150 #undef __ |
5151 | 5151 |
5152 } } // namespace v8::internal | 5152 } } // namespace v8::internal |
5153 | 5153 |
5154 #endif // V8_TARGET_ARCH_X64 | 5154 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |