| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #if defined(V8_TARGET_ARCH_X64) | 30 #if defined(V8_TARGET_ARCH_X64) |
| 31 | 31 |
| 32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
| 33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
| 34 #include "regexp-macro-assembler.h" | 34 #include "regexp-macro-assembler.h" |
| 35 #include "stub-cache.h" |
| 35 | 36 |
| 36 namespace v8 { | 37 namespace v8 { |
| 37 namespace internal { | 38 namespace internal { |
| 38 | 39 |
| 39 | 40 |
| 40 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | 41 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( |
| 41 Isolate* isolate, | 42 Isolate* isolate, |
| 42 CodeStubInterfaceDescriptor* descriptor) { | 43 CodeStubInterfaceDescriptor* descriptor) { |
| 43 static Register registers[] = { rdx, rax }; | 44 static Register registers[] = { rdx, rax }; |
| 44 descriptor->register_param_count_ = 2; | 45 descriptor->register_param_count_ = 2; |
| (...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 // Restore context register. | 2353 // Restore context register. |
| 2353 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2354 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 2354 | 2355 |
| 2355 __ bind(&done); | 2356 __ bind(&done); |
| 2356 __ IncrementCounter(counters->math_pow(), 1); | 2357 __ IncrementCounter(counters->math_pow(), 1); |
| 2357 __ ret(0); | 2358 __ ret(0); |
| 2358 } | 2359 } |
| 2359 } | 2360 } |
| 2360 | 2361 |
| 2361 | 2362 |
| 2363 void StringLengthStub::Generate(MacroAssembler* masm) { |
| 2364 Label miss; |
| 2365 Register receiver; |
| 2366 if (kind() == Code::KEYED_LOAD_IC) { |
| 2367 // ----------- S t a t e ------------- |
| 2368 // -- rax : key |
| 2369 // -- rdx : receiver |
| 2370 // -- rsp[0] : return address |
| 2371 // ----------------------------------- |
| 2372 __ Cmp(rax, masm->isolate()->factory()->length_symbol()); |
| 2373 receiver = rdx; |
| 2374 } else { |
| 2375 ASSERT(kind() == Code::LOAD_IC); |
| 2376 // ----------- S t a t e ------------- |
| 2377 // -- rax : receiver |
| 2378 // -- rcx : name |
| 2379 // -- rsp[0] : return address |
| 2380 // ----------------------------------- |
| 2381 receiver = rax; |
| 2382 } |
| 2383 |
| 2384 StubCompiler::GenerateLoadStringLength(masm, receiver, r8, r9, &miss, |
| 2385 support_wrapper_); |
| 2386 __ bind(&miss); |
| 2387 StubCompiler::GenerateLoadMiss(masm, kind()); |
| 2388 } |
| 2389 |
| 2390 |
| 2362 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { | 2391 void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { |
| 2363 // The key is in rdx and the parameter count is in rax. | 2392 // The key is in rdx and the parameter count is in rax. |
| 2364 | 2393 |
| 2365 // The displacement is used for skipping the frame pointer on the | 2394 // The displacement is used for skipping the frame pointer on the |
| 2366 // stack. It is the offset of the last parameter (if any) relative | 2395 // stack. It is the offset of the last parameter (if any) relative |
| 2367 // to the frame pointer. | 2396 // to the frame pointer. |
| 2368 static const int kDisplacement = 1 * kPointerSize; | 2397 static const int kDisplacement = 1 * kPointerSize; |
| 2369 | 2398 |
| 2370 // Check that the key is a smi. | 2399 // Check that the key is a smi. |
| 2371 Label slow; | 2400 Label slow; |
| (...skipping 4167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6539 #endif | 6568 #endif |
| 6540 | 6569 |
| 6541 __ Ret(); | 6570 __ Ret(); |
| 6542 } | 6571 } |
| 6543 | 6572 |
| 6544 #undef __ | 6573 #undef __ |
| 6545 | 6574 |
| 6546 } } // namespace v8::internal | 6575 } } // namespace v8::internal |
| 6547 | 6576 |
| 6548 #endif // V8_TARGET_ARCH_X64 | 6577 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |