OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 // what it thinks is C code compiled for the simulator/host | 2358 // what it thinks is C code compiled for the simulator/host |
2359 // platform. | 2359 // platform. |
2360 __ LoadP(code, MemOperand(code, 0)); // Instruction address | 2360 __ LoadP(code, MemOperand(code, 0)); // Instruction address |
2361 #endif | 2361 #endif |
2362 | 2362 |
2363 DirectCEntryStub stub(isolate()); | 2363 DirectCEntryStub stub(isolate()); |
2364 stub.GenerateCall(masm, code); | 2364 stub.GenerateCall(masm, code); |
2365 | 2365 |
2366 __ LeaveExitFrame(false, no_reg, true); | 2366 __ LeaveExitFrame(false, no_reg, true); |
2367 | 2367 |
2368 // r3: result | 2368 // r3: result (int32) |
2369 // subject: subject string (callee saved) | 2369 // subject: subject string (callee saved) |
2370 // regexp_data: RegExp data (callee saved) | 2370 // regexp_data: RegExp data (callee saved) |
2371 // last_match_info_elements: Last match info elements (callee saved) | 2371 // last_match_info_elements: Last match info elements (callee saved) |
2372 // Check the result. | 2372 // Check the result. |
2373 Label success; | 2373 Label success; |
2374 __ cmpi(r3, Operand(1)); | 2374 __ cmpwi(r3, Operand(1)); |
2375 // We expect exactly one result since we force the called regexp to behave | 2375 // We expect exactly one result since we force the called regexp to behave |
2376 // as non-global. | 2376 // as non-global. |
2377 __ beq(&success); | 2377 __ beq(&success); |
2378 Label failure; | 2378 Label failure; |
2379 __ cmpi(r3, Operand(NativeRegExpMacroAssembler::FAILURE)); | 2379 __ cmpwi(r3, Operand(NativeRegExpMacroAssembler::FAILURE)); |
2380 __ beq(&failure); | 2380 __ beq(&failure); |
2381 __ cmpi(r3, Operand(NativeRegExpMacroAssembler::EXCEPTION)); | 2381 __ cmpwi(r3, Operand(NativeRegExpMacroAssembler::EXCEPTION)); |
2382 // If not exception it can only be retry. Handle that in the runtime system. | 2382 // If not exception it can only be retry. Handle that in the runtime system. |
2383 __ bne(&runtime); | 2383 __ bne(&runtime); |
2384 // Result must now be exception. If there is no pending exception already a | 2384 // Result must now be exception. If there is no pending exception already a |
2385 // stack overflow (on the backtrack stack) was detected in RegExp code but | 2385 // stack overflow (on the backtrack stack) was detected in RegExp code but |
2386 // haven't created the exception yet. Handle that in the runtime system. | 2386 // haven't created the exception yet. Handle that in the runtime system. |
2387 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | 2387 // TODO(592): Rerunning the RegExp to get the stack overflow exception. |
2388 __ mov(r4, Operand(isolate()->factory()->the_hole_value())); | 2388 __ mov(r4, Operand(isolate()->factory()->the_hole_value())); |
2389 __ mov(r5, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 2389 __ mov(r5, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
2390 isolate()))); | 2390 isolate()))); |
2391 __ LoadP(r3, MemOperand(r5, 0)); | 2391 __ LoadP(r3, MemOperand(r5, 0)); |
(...skipping 3194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5586 kStackUnwindSpace, NULL, | 5586 kStackUnwindSpace, NULL, |
5587 MemOperand(fp, 6 * kPointerSize), NULL); | 5587 MemOperand(fp, 6 * kPointerSize), NULL); |
5588 } | 5588 } |
5589 | 5589 |
5590 | 5590 |
5591 #undef __ | 5591 #undef __ |
5592 } | 5592 } |
5593 } // namespace v8::internal | 5593 } // namespace v8::internal |
5594 | 5594 |
5595 #endif // V8_TARGET_ARCH_PPC | 5595 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |