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 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2376 void ArrayLengthStub::Generate(MacroAssembler* masm) { | 2376 void ArrayLengthStub::Generate(MacroAssembler* masm) { |
2377 Label miss; | 2377 Label miss; |
2378 Register receiver; | 2378 Register receiver; |
2379 if (kind() == Code::KEYED_LOAD_IC) { | 2379 if (kind() == Code::KEYED_LOAD_IC) { |
2380 // ----------- S t a t e ------------- | 2380 // ----------- S t a t e ------------- |
2381 // -- rax : key | 2381 // -- rax : key |
2382 // -- rdx : receiver | 2382 // -- rdx : receiver |
2383 // -- rsp[0] : return address | 2383 // -- rsp[0] : return address |
2384 // ----------------------------------- | 2384 // ----------------------------------- |
2385 __ Cmp(rax, masm->isolate()->factory()->length_symbol()); | 2385 __ Cmp(rax, masm->isolate()->factory()->length_symbol()); |
| 2386 __ j(not_equal, &miss); |
2386 receiver = rdx; | 2387 receiver = rdx; |
2387 } else { | 2388 } else { |
2388 ASSERT(kind() == Code::LOAD_IC); | 2389 ASSERT(kind() == Code::LOAD_IC); |
2389 // ----------- S t a t e ------------- | 2390 // ----------- S t a t e ------------- |
2390 // -- rax : receiver | 2391 // -- rax : receiver |
2391 // -- rcx : name | 2392 // -- rcx : name |
2392 // -- rsp[0] : return address | 2393 // -- rsp[0] : return address |
2393 // ----------------------------------- | 2394 // ----------------------------------- |
2394 receiver = rax; | 2395 receiver = rax; |
2395 } | 2396 } |
2396 | 2397 |
2397 StubCompiler::GenerateLoadArrayLength(masm, receiver, r8, &miss); | 2398 StubCompiler::GenerateLoadArrayLength(masm, receiver, r8, &miss); |
2398 __ bind(&miss); | 2399 __ bind(&miss); |
2399 StubCompiler::GenerateLoadMiss(masm, kind()); | 2400 StubCompiler::GenerateLoadMiss(masm, kind()); |
2400 } | 2401 } |
2401 | 2402 |
2402 | 2403 |
2403 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 2404 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
2404 Label miss; | 2405 Label miss; |
2405 Register receiver; | 2406 Register receiver; |
2406 if (kind() == Code::KEYED_LOAD_IC) { | 2407 if (kind() == Code::KEYED_LOAD_IC) { |
2407 // ----------- S t a t e ------------- | 2408 // ----------- S t a t e ------------- |
2408 // -- rax : key | 2409 // -- rax : key |
2409 // -- rdx : receiver | 2410 // -- rdx : receiver |
2410 // -- rsp[0] : return address | 2411 // -- rsp[0] : return address |
2411 // ----------------------------------- | 2412 // ----------------------------------- |
2412 __ Cmp(rax, masm->isolate()->factory()->prototype_symbol()); | 2413 __ Cmp(rax, masm->isolate()->factory()->prototype_symbol()); |
| 2414 __ j(not_equal, &miss); |
2413 receiver = rdx; | 2415 receiver = rdx; |
2414 } else { | 2416 } else { |
2415 ASSERT(kind() == Code::LOAD_IC); | 2417 ASSERT(kind() == Code::LOAD_IC); |
2416 // ----------- S t a t e ------------- | 2418 // ----------- S t a t e ------------- |
2417 // -- rax : receiver | 2419 // -- rax : receiver |
2418 // -- rcx : name | 2420 // -- rcx : name |
2419 // -- rsp[0] : return address | 2421 // -- rsp[0] : return address |
2420 // ----------------------------------- | 2422 // ----------------------------------- |
2421 receiver = rax; | 2423 receiver = rax; |
2422 } | 2424 } |
2423 | 2425 |
2424 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss); | 2426 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss); |
2425 __ bind(&miss); | 2427 __ bind(&miss); |
2426 StubCompiler::GenerateLoadMiss(masm, kind()); | 2428 StubCompiler::GenerateLoadMiss(masm, kind()); |
2427 } | 2429 } |
2428 | 2430 |
2429 | 2431 |
2430 void StringLengthStub::Generate(MacroAssembler* masm) { | 2432 void StringLengthStub::Generate(MacroAssembler* masm) { |
2431 Label miss; | 2433 Label miss; |
2432 Register receiver; | 2434 Register receiver; |
2433 if (kind() == Code::KEYED_LOAD_IC) { | 2435 if (kind() == Code::KEYED_LOAD_IC) { |
2434 // ----------- S t a t e ------------- | 2436 // ----------- S t a t e ------------- |
2435 // -- rax : key | 2437 // -- rax : key |
2436 // -- rdx : receiver | 2438 // -- rdx : receiver |
2437 // -- rsp[0] : return address | 2439 // -- rsp[0] : return address |
2438 // ----------------------------------- | 2440 // ----------------------------------- |
2439 __ Cmp(rax, masm->isolate()->factory()->length_symbol()); | 2441 __ Cmp(rax, masm->isolate()->factory()->length_symbol()); |
| 2442 __ j(not_equal, &miss); |
2440 receiver = rdx; | 2443 receiver = rdx; |
2441 } else { | 2444 } else { |
2442 ASSERT(kind() == Code::LOAD_IC); | 2445 ASSERT(kind() == Code::LOAD_IC); |
2443 // ----------- S t a t e ------------- | 2446 // ----------- S t a t e ------------- |
2444 // -- rax : receiver | 2447 // -- rax : receiver |
2445 // -- rcx : name | 2448 // -- rcx : name |
2446 // -- rsp[0] : return address | 2449 // -- rsp[0] : return address |
2447 // ----------------------------------- | 2450 // ----------------------------------- |
2448 receiver = rax; | 2451 receiver = rax; |
2449 } | 2452 } |
(...skipping 18 matching lines...) Expand all Loading... |
2468 // elements of FixedArray type). Value must be a number, but only smis are | 2471 // elements of FixedArray type). Value must be a number, but only smis are |
2469 // accepted as the most common case. | 2472 // accepted as the most common case. |
2470 | 2473 |
2471 Label miss; | 2474 Label miss; |
2472 | 2475 |
2473 Register receiver = rdx; | 2476 Register receiver = rdx; |
2474 Register value = rax; | 2477 Register value = rax; |
2475 Register scratch = rbx; | 2478 Register scratch = rbx; |
2476 if (kind() == Code::KEYED_STORE_IC) { | 2479 if (kind() == Code::KEYED_STORE_IC) { |
2477 __ Cmp(rcx, masm->isolate()->factory()->length_symbol()); | 2480 __ Cmp(rcx, masm->isolate()->factory()->length_symbol()); |
| 2481 __ j(not_equal, &miss); |
2478 } | 2482 } |
2479 | 2483 |
2480 // Check that the receiver isn't a smi. | 2484 // Check that the receiver isn't a smi. |
2481 __ JumpIfSmi(receiver, &miss); | 2485 __ JumpIfSmi(receiver, &miss); |
2482 | 2486 |
2483 // Check that the object is a JS array. | 2487 // Check that the object is a JS array. |
2484 __ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch); | 2488 __ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch); |
2485 __ j(not_equal, &miss); | 2489 __ j(not_equal, &miss); |
2486 | 2490 |
2487 // Check that elements are FixedArray. | 2491 // Check that elements are FixedArray. |
(...skipping 4224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6712 #endif | 6716 #endif |
6713 | 6717 |
6714 __ Ret(); | 6718 __ Ret(); |
6715 } | 6719 } |
6716 | 6720 |
6717 #undef __ | 6721 #undef __ |
6718 | 6722 |
6719 } } // namespace v8::internal | 6723 } } // namespace v8::internal |
6720 | 6724 |
6721 #endif // V8_TARGET_ARCH_X64 | 6725 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |