| 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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 ? CALL_AS_FUNCTION | 1408 ? CALL_AS_FUNCTION |
| 1409 : CALL_AS_METHOD; | 1409 : CALL_AS_METHOD; |
| 1410 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION, | 1410 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION, |
| 1411 NullCallWrapper(), call_kind); | 1411 NullCallWrapper(), call_kind); |
| 1412 | 1412 |
| 1413 // Handle call cache miss. | 1413 // Handle call cache miss. |
| 1414 __ bind(&miss); | 1414 __ bind(&miss); |
| 1415 GenerateMissBranch(); | 1415 GenerateMissBranch(); |
| 1416 | 1416 |
| 1417 // Return the generated code. | 1417 // Return the generated code. |
| 1418 return GetCode(FIELD, name); | 1418 return GetCode(Code::FIELD, name); |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 | 1421 |
| 1422 Handle<Code> CallStubCompiler::CompileArrayPushCall( | 1422 Handle<Code> CallStubCompiler::CompileArrayPushCall( |
| 1423 Handle<Object> object, | 1423 Handle<Object> object, |
| 1424 Handle<JSObject> holder, | 1424 Handle<JSObject> holder, |
| 1425 Handle<JSGlobalPropertyCell> cell, | 1425 Handle<JSGlobalPropertyCell> cell, |
| 1426 Handle<JSFunction> function, | 1426 Handle<JSFunction> function, |
| 1427 Handle<String> name) { | 1427 Handle<String> name) { |
| 1428 // ----------- S t a t e ------------- | 1428 // ----------- S t a t e ------------- |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 ? CALL_AS_FUNCTION | 1955 ? CALL_AS_FUNCTION |
| 1956 : CALL_AS_METHOD; | 1956 : CALL_AS_METHOD; |
| 1957 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, | 1957 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, |
| 1958 NullCallWrapper(), call_kind); | 1958 NullCallWrapper(), call_kind); |
| 1959 | 1959 |
| 1960 __ bind(&miss); | 1960 __ bind(&miss); |
| 1961 // ecx: function name. | 1961 // ecx: function name. |
| 1962 GenerateMissBranch(); | 1962 GenerateMissBranch(); |
| 1963 | 1963 |
| 1964 // Return the generated code. | 1964 // Return the generated code. |
| 1965 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); | 1965 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 | 1968 |
| 1969 Handle<Code> CallStubCompiler::CompileMathFloorCall( | 1969 Handle<Code> CallStubCompiler::CompileMathFloorCall( |
| 1970 Handle<Object> object, | 1970 Handle<Object> object, |
| 1971 Handle<JSObject> holder, | 1971 Handle<JSObject> holder, |
| 1972 Handle<JSGlobalPropertyCell> cell, | 1972 Handle<JSGlobalPropertyCell> cell, |
| 1973 Handle<JSFunction> function, | 1973 Handle<JSFunction> function, |
| 1974 Handle<String> name) { | 1974 Handle<String> name) { |
| 1975 // ----------- S t a t e ------------- | 1975 // ----------- S t a t e ------------- |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2085 // because the function makes no use of it. | 2085 // because the function makes no use of it. |
| 2086 __ bind(&slow); | 2086 __ bind(&slow); |
| 2087 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, | 2087 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, |
| 2088 NullCallWrapper(), CALL_AS_METHOD); | 2088 NullCallWrapper(), CALL_AS_METHOD); |
| 2089 | 2089 |
| 2090 __ bind(&miss); | 2090 __ bind(&miss); |
| 2091 // ecx: function name. | 2091 // ecx: function name. |
| 2092 GenerateMissBranch(); | 2092 GenerateMissBranch(); |
| 2093 | 2093 |
| 2094 // Return the generated code. | 2094 // Return the generated code. |
| 2095 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); | 2095 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 | 2098 |
| 2099 Handle<Code> CallStubCompiler::CompileMathAbsCall( | 2099 Handle<Code> CallStubCompiler::CompileMathAbsCall( |
| 2100 Handle<Object> object, | 2100 Handle<Object> object, |
| 2101 Handle<JSObject> holder, | 2101 Handle<JSObject> holder, |
| 2102 Handle<JSGlobalPropertyCell> cell, | 2102 Handle<JSGlobalPropertyCell> cell, |
| 2103 Handle<JSFunction> function, | 2103 Handle<JSFunction> function, |
| 2104 Handle<String> name) { | 2104 Handle<String> name) { |
| 2105 // ----------- S t a t e ------------- | 2105 // ----------- S t a t e ------------- |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 // because the function makes no use of it. | 2190 // because the function makes no use of it. |
| 2191 __ bind(&slow); | 2191 __ bind(&slow); |
| 2192 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, | 2192 __ InvokeFunction(function, arguments(), JUMP_FUNCTION, |
| 2193 NullCallWrapper(), CALL_AS_METHOD); | 2193 NullCallWrapper(), CALL_AS_METHOD); |
| 2194 | 2194 |
| 2195 __ bind(&miss); | 2195 __ bind(&miss); |
| 2196 // ecx: function name. | 2196 // ecx: function name. |
| 2197 GenerateMissBranch(); | 2197 GenerateMissBranch(); |
| 2198 | 2198 |
| 2199 // Return the generated code. | 2199 // Return the generated code. |
| 2200 return cell.is_null() ? GetCode(function) : GetCode(NORMAL, name); | 2200 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
| 2201 } | 2201 } |
| 2202 | 2202 |
| 2203 | 2203 |
| 2204 Handle<Code> CallStubCompiler::CompileFastApiCall( | 2204 Handle<Code> CallStubCompiler::CompileFastApiCall( |
| 2205 const CallOptimization& optimization, | 2205 const CallOptimization& optimization, |
| 2206 Handle<Object> object, | 2206 Handle<Object> object, |
| 2207 Handle<JSObject> holder, | 2207 Handle<JSObject> holder, |
| 2208 Handle<JSGlobalPropertyCell> cell, | 2208 Handle<JSGlobalPropertyCell> cell, |
| 2209 Handle<JSFunction> function, | 2209 Handle<JSFunction> function, |
| 2210 Handle<String> name) { | 2210 Handle<String> name) { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 ? CALL_AS_FUNCTION | 2437 ? CALL_AS_FUNCTION |
| 2438 : CALL_AS_METHOD; | 2438 : CALL_AS_METHOD; |
| 2439 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION, | 2439 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION, |
| 2440 NullCallWrapper(), call_kind); | 2440 NullCallWrapper(), call_kind); |
| 2441 | 2441 |
| 2442 // Handle load cache miss. | 2442 // Handle load cache miss. |
| 2443 __ bind(&miss); | 2443 __ bind(&miss); |
| 2444 GenerateMissBranch(); | 2444 GenerateMissBranch(); |
| 2445 | 2445 |
| 2446 // Return the generated code. | 2446 // Return the generated code. |
| 2447 return GetCode(INTERCEPTOR, name); | 2447 return GetCode(Code::INTERCEPTOR, name); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 | 2450 |
| 2451 Handle<Code> CallStubCompiler::CompileCallGlobal( | 2451 Handle<Code> CallStubCompiler::CompileCallGlobal( |
| 2452 Handle<JSObject> object, | 2452 Handle<JSObject> object, |
| 2453 Handle<GlobalObject> holder, | 2453 Handle<GlobalObject> holder, |
| 2454 Handle<JSGlobalPropertyCell> cell, | 2454 Handle<JSGlobalPropertyCell> cell, |
| 2455 Handle<JSFunction> function, | 2455 Handle<JSFunction> function, |
| 2456 Handle<String> name) { | 2456 Handle<String> name) { |
| 2457 // ----------- S t a t e ------------- | 2457 // ----------- S t a t e ------------- |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 __ InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2498 __ InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
| 2499 expected, arguments(), JUMP_FUNCTION, | 2499 expected, arguments(), JUMP_FUNCTION, |
| 2500 NullCallWrapper(), call_kind); | 2500 NullCallWrapper(), call_kind); |
| 2501 | 2501 |
| 2502 // Handle call cache miss. | 2502 // Handle call cache miss. |
| 2503 __ bind(&miss); | 2503 __ bind(&miss); |
| 2504 __ IncrementCounter(counters->call_global_inline_miss(), 1); | 2504 __ IncrementCounter(counters->call_global_inline_miss(), 1); |
| 2505 GenerateMissBranch(); | 2505 GenerateMissBranch(); |
| 2506 | 2506 |
| 2507 // Return the generated code. | 2507 // Return the generated code. |
| 2508 return GetCode(NORMAL, name); | 2508 return GetCode(Code::NORMAL, name); |
| 2509 } | 2509 } |
| 2510 | 2510 |
| 2511 | 2511 |
| 2512 Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, | 2512 Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
| 2513 int index, | 2513 int index, |
| 2514 Handle<Map> transition, | 2514 Handle<Map> transition, |
| 2515 Handle<String> name) { | 2515 Handle<String> name) { |
| 2516 // ----------- S t a t e ------------- | 2516 // ----------- S t a t e ------------- |
| 2517 // -- eax : value | 2517 // -- eax : value |
| 2518 // -- ecx : name | 2518 // -- ecx : name |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2529 name, | 2529 name, |
| 2530 edx, ecx, ebx, edi, | 2530 edx, ecx, ebx, edi, |
| 2531 &miss); | 2531 &miss); |
| 2532 // Handle store cache miss. | 2532 // Handle store cache miss. |
| 2533 __ bind(&miss); | 2533 __ bind(&miss); |
| 2534 __ mov(ecx, Immediate(name)); // restore name | 2534 __ mov(ecx, Immediate(name)); // restore name |
| 2535 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2535 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2536 __ jmp(ic, RelocInfo::CODE_TARGET); | 2536 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2537 | 2537 |
| 2538 // Return the generated code. | 2538 // Return the generated code. |
| 2539 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); | 2539 return GetCode(transition.is_null() |
| 2540 ? Code::FIELD |
| 2541 : Code::MAP_TRANSITION, name); |
| 2540 } | 2542 } |
| 2541 | 2543 |
| 2542 | 2544 |
| 2543 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2545 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 2544 Handle<JSObject> object, | 2546 Handle<JSObject> object, |
| 2545 Handle<AccessorInfo> callback, | 2547 Handle<AccessorInfo> callback, |
| 2546 Handle<String> name) { | 2548 Handle<String> name) { |
| 2547 // ----------- S t a t e ------------- | 2549 // ----------- S t a t e ------------- |
| 2548 // -- eax : value | 2550 // -- eax : value |
| 2549 // -- ecx : name | 2551 // -- ecx : name |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2576 ExternalReference store_callback_property = | 2578 ExternalReference store_callback_property = |
| 2577 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2579 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
| 2578 __ TailCallExternalReference(store_callback_property, 4, 1); | 2580 __ TailCallExternalReference(store_callback_property, 4, 1); |
| 2579 | 2581 |
| 2580 // Handle store cache miss. | 2582 // Handle store cache miss. |
| 2581 __ bind(&miss); | 2583 __ bind(&miss); |
| 2582 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2584 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2583 __ jmp(ic, RelocInfo::CODE_TARGET); | 2585 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2584 | 2586 |
| 2585 // Return the generated code. | 2587 // Return the generated code. |
| 2586 return GetCode(CALLBACKS, name); | 2588 return GetCode(Code::CALLBACKS, name); |
| 2587 } | 2589 } |
| 2588 | 2590 |
| 2589 | 2591 |
| 2590 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( | 2592 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| 2591 Handle<JSObject> receiver, | 2593 Handle<JSObject> receiver, |
| 2592 Handle<JSFunction> setter, | 2594 Handle<JSFunction> setter, |
| 2593 Handle<String> name) { | 2595 Handle<String> name) { |
| 2594 // ----------- S t a t e ------------- | 2596 // ----------- S t a t e ------------- |
| 2595 // -- eax : value | 2597 // -- eax : value |
| 2596 // -- ecx : name | 2598 // -- ecx : name |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2622 // Restore context register. | 2624 // Restore context register. |
| 2623 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2625 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2624 } | 2626 } |
| 2625 __ ret(0); | 2627 __ ret(0); |
| 2626 | 2628 |
| 2627 __ bind(&miss); | 2629 __ bind(&miss); |
| 2628 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2630 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2629 __ jmp(ic, RelocInfo::CODE_TARGET); | 2631 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2630 | 2632 |
| 2631 // Return the generated code. | 2633 // Return the generated code. |
| 2632 return GetCode(CALLBACKS, name); | 2634 return GetCode(Code::CALLBACKS, name); |
| 2633 } | 2635 } |
| 2634 | 2636 |
| 2635 | 2637 |
| 2636 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( | 2638 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
| 2637 Handle<JSObject> receiver, | 2639 Handle<JSObject> receiver, |
| 2638 Handle<String> name) { | 2640 Handle<String> name) { |
| 2639 // ----------- S t a t e ------------- | 2641 // ----------- S t a t e ------------- |
| 2640 // -- eax : value | 2642 // -- eax : value |
| 2641 // -- ecx : name | 2643 // -- ecx : name |
| 2642 // -- edx : receiver | 2644 // -- edx : receiver |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2668 ExternalReference store_ic_property = | 2670 ExternalReference store_ic_property = |
| 2669 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); | 2671 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), isolate()); |
| 2670 __ TailCallExternalReference(store_ic_property, 4, 1); | 2672 __ TailCallExternalReference(store_ic_property, 4, 1); |
| 2671 | 2673 |
| 2672 // Handle store cache miss. | 2674 // Handle store cache miss. |
| 2673 __ bind(&miss); | 2675 __ bind(&miss); |
| 2674 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2676 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2675 __ jmp(ic, RelocInfo::CODE_TARGET); | 2677 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2676 | 2678 |
| 2677 // Return the generated code. | 2679 // Return the generated code. |
| 2678 return GetCode(INTERCEPTOR, name); | 2680 return GetCode(Code::INTERCEPTOR, name); |
| 2679 } | 2681 } |
| 2680 | 2682 |
| 2681 | 2683 |
| 2682 Handle<Code> StoreStubCompiler::CompileStoreGlobal( | 2684 Handle<Code> StoreStubCompiler::CompileStoreGlobal( |
| 2683 Handle<GlobalObject> object, | 2685 Handle<GlobalObject> object, |
| 2684 Handle<JSGlobalPropertyCell> cell, | 2686 Handle<JSGlobalPropertyCell> cell, |
| 2685 Handle<String> name) { | 2687 Handle<String> name) { |
| 2686 // ----------- S t a t e ------------- | 2688 // ----------- S t a t e ------------- |
| 2687 // -- eax : value | 2689 // -- eax : value |
| 2688 // -- ecx : name | 2690 // -- ecx : name |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2716 __ IncrementCounter(counters->named_store_global_inline(), 1); | 2718 __ IncrementCounter(counters->named_store_global_inline(), 1); |
| 2717 __ ret(0); | 2719 __ ret(0); |
| 2718 | 2720 |
| 2719 // Handle store cache miss. | 2721 // Handle store cache miss. |
| 2720 __ bind(&miss); | 2722 __ bind(&miss); |
| 2721 __ IncrementCounter(counters->named_store_global_inline_miss(), 1); | 2723 __ IncrementCounter(counters->named_store_global_inline_miss(), 1); |
| 2722 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2724 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2723 __ jmp(ic, RelocInfo::CODE_TARGET); | 2725 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2724 | 2726 |
| 2725 // Return the generated code. | 2727 // Return the generated code. |
| 2726 return GetCode(NORMAL, name); | 2728 return GetCode(Code::NORMAL, name); |
| 2727 } | 2729 } |
| 2728 | 2730 |
| 2729 | 2731 |
| 2730 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, | 2732 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
| 2731 int index, | 2733 int index, |
| 2732 Handle<Map> transition, | 2734 Handle<Map> transition, |
| 2733 Handle<String> name) { | 2735 Handle<String> name) { |
| 2734 // ----------- S t a t e ------------- | 2736 // ----------- S t a t e ------------- |
| 2735 // -- eax : value | 2737 // -- eax : value |
| 2736 // -- ecx : key | 2738 // -- ecx : key |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2755 edx, ecx, ebx, edi, | 2757 edx, ecx, ebx, edi, |
| 2756 &miss); | 2758 &miss); |
| 2757 | 2759 |
| 2758 // Handle store cache miss. | 2760 // Handle store cache miss. |
| 2759 __ bind(&miss); | 2761 __ bind(&miss); |
| 2760 __ DecrementCounter(counters->keyed_store_field(), 1); | 2762 __ DecrementCounter(counters->keyed_store_field(), 1); |
| 2761 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2763 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 2762 __ jmp(ic, RelocInfo::CODE_TARGET); | 2764 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2763 | 2765 |
| 2764 // Return the generated code. | 2766 // Return the generated code. |
| 2765 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); | 2767 return GetCode(transition.is_null() |
| 2768 ? Code::FIELD |
| 2769 : Code::MAP_TRANSITION, name); |
| 2766 } | 2770 } |
| 2767 | 2771 |
| 2768 | 2772 |
| 2769 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( | 2773 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
| 2770 Handle<Map> receiver_map) { | 2774 Handle<Map> receiver_map) { |
| 2771 // ----------- S t a t e ------------- | 2775 // ----------- S t a t e ------------- |
| 2772 // -- eax : value | 2776 // -- eax : value |
| 2773 // -- ecx : key | 2777 // -- ecx : key |
| 2774 // -- edx : receiver | 2778 // -- edx : receiver |
| 2775 // -- esp[0] : return address | 2779 // -- esp[0] : return address |
| 2776 // ----------------------------------- | 2780 // ----------------------------------- |
| 2777 ElementsKind elements_kind = receiver_map->elements_kind(); | 2781 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 2778 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; | 2782 bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 2779 Handle<Code> stub = | 2783 Handle<Code> stub = |
| 2780 KeyedStoreElementStub(is_jsarray, elements_kind, grow_mode_).GetCode(); | 2784 KeyedStoreElementStub(is_jsarray, elements_kind, grow_mode_).GetCode(); |
| 2781 | 2785 |
| 2782 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); | 2786 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); |
| 2783 | 2787 |
| 2784 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2788 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 2785 __ jmp(ic, RelocInfo::CODE_TARGET); | 2789 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2786 | 2790 |
| 2787 // Return the generated code. | 2791 // Return the generated code. |
| 2788 return GetCode(NORMAL, factory()->empty_string()); | 2792 return GetCode(Code::NORMAL, factory()->empty_string()); |
| 2789 } | 2793 } |
| 2790 | 2794 |
| 2791 | 2795 |
| 2792 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( | 2796 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
| 2793 MapHandleList* receiver_maps, | 2797 MapHandleList* receiver_maps, |
| 2794 CodeHandleList* handler_stubs, | 2798 CodeHandleList* handler_stubs, |
| 2795 MapHandleList* transitioned_maps) { | 2799 MapHandleList* transitioned_maps) { |
| 2796 // ----------- S t a t e ------------- | 2800 // ----------- S t a t e ------------- |
| 2797 // -- eax : value | 2801 // -- eax : value |
| 2798 // -- ecx : key | 2802 // -- ecx : key |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2813 __ mov(ebx, Immediate(transitioned_maps->at(i))); | 2817 __ mov(ebx, Immediate(transitioned_maps->at(i))); |
| 2814 __ jmp(handler_stubs->at(i), RelocInfo::CODE_TARGET); | 2818 __ jmp(handler_stubs->at(i), RelocInfo::CODE_TARGET); |
| 2815 __ bind(&next_map); | 2819 __ bind(&next_map); |
| 2816 } | 2820 } |
| 2817 } | 2821 } |
| 2818 __ bind(&miss); | 2822 __ bind(&miss); |
| 2819 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2823 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 2820 __ jmp(miss_ic, RelocInfo::CODE_TARGET); | 2824 __ jmp(miss_ic, RelocInfo::CODE_TARGET); |
| 2821 | 2825 |
| 2822 // Return the generated code. | 2826 // Return the generated code. |
| 2823 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); | 2827 return GetCode(Code::NORMAL, factory()->empty_string(), MEGAMORPHIC); |
| 2824 } | 2828 } |
| 2825 | 2829 |
| 2826 | 2830 |
| 2827 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, | 2831 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, |
| 2828 Handle<JSObject> object, | 2832 Handle<JSObject> object, |
| 2829 Handle<JSObject> last) { | 2833 Handle<JSObject> last) { |
| 2830 // ----------- S t a t e ------------- | 2834 // ----------- S t a t e ------------- |
| 2831 // -- ecx : name | 2835 // -- ecx : name |
| 2832 // -- edx : receiver | 2836 // -- edx : receiver |
| 2833 // -- esp[0] : return address | 2837 // -- esp[0] : return address |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2853 | 2857 |
| 2854 // Return undefined if maps of the full prototype chain are still the | 2858 // Return undefined if maps of the full prototype chain are still the |
| 2855 // same and no global property with this name contains a value. | 2859 // same and no global property with this name contains a value. |
| 2856 __ mov(eax, isolate()->factory()->undefined_value()); | 2860 __ mov(eax, isolate()->factory()->undefined_value()); |
| 2857 __ ret(0); | 2861 __ ret(0); |
| 2858 | 2862 |
| 2859 __ bind(&miss); | 2863 __ bind(&miss); |
| 2860 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2864 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2861 | 2865 |
| 2862 // Return the generated code. | 2866 // Return the generated code. |
| 2863 return GetCode(NONEXISTENT, factory()->empty_string()); | 2867 return GetCode(Code::NONEXISTENT, factory()->empty_string()); |
| 2864 } | 2868 } |
| 2865 | 2869 |
| 2866 | 2870 |
| 2867 Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object, | 2871 Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object, |
| 2868 Handle<JSObject> holder, | 2872 Handle<JSObject> holder, |
| 2869 int index, | 2873 int index, |
| 2870 Handle<String> name) { | 2874 Handle<String> name) { |
| 2871 // ----------- S t a t e ------------- | 2875 // ----------- S t a t e ------------- |
| 2872 // -- ecx : name | 2876 // -- ecx : name |
| 2873 // -- edx : receiver | 2877 // -- edx : receiver |
| 2874 // -- esp[0] : return address | 2878 // -- esp[0] : return address |
| 2875 // ----------------------------------- | 2879 // ----------------------------------- |
| 2876 Label miss; | 2880 Label miss; |
| 2877 | 2881 |
| 2878 GenerateLoadField(object, holder, edx, ebx, eax, edi, index, name, &miss); | 2882 GenerateLoadField(object, holder, edx, ebx, eax, edi, index, name, &miss); |
| 2879 __ bind(&miss); | 2883 __ bind(&miss); |
| 2880 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2884 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2881 | 2885 |
| 2882 // Return the generated code. | 2886 // Return the generated code. |
| 2883 return GetCode(FIELD, name); | 2887 return GetCode(Code::FIELD, name); |
| 2884 } | 2888 } |
| 2885 | 2889 |
| 2886 | 2890 |
| 2887 Handle<Code> LoadStubCompiler::CompileLoadCallback( | 2891 Handle<Code> LoadStubCompiler::CompileLoadCallback( |
| 2888 Handle<String> name, | 2892 Handle<String> name, |
| 2889 Handle<JSObject> object, | 2893 Handle<JSObject> object, |
| 2890 Handle<JSObject> holder, | 2894 Handle<JSObject> holder, |
| 2891 Handle<AccessorInfo> callback) { | 2895 Handle<AccessorInfo> callback) { |
| 2892 // ----------- S t a t e ------------- | 2896 // ----------- S t a t e ------------- |
| 2893 // -- ecx : name | 2897 // -- ecx : name |
| 2894 // -- edx : receiver | 2898 // -- edx : receiver |
| 2895 // -- esp[0] : return address | 2899 // -- esp[0] : return address |
| 2896 // ----------------------------------- | 2900 // ----------------------------------- |
| 2897 Label miss; | 2901 Label miss; |
| 2898 | 2902 |
| 2899 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, | 2903 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, |
| 2900 name, &miss); | 2904 name, &miss); |
| 2901 __ bind(&miss); | 2905 __ bind(&miss); |
| 2902 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2906 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2903 | 2907 |
| 2904 // Return the generated code. | 2908 // Return the generated code. |
| 2905 return GetCode(CALLBACKS, name); | 2909 return GetCode(Code::CALLBACKS, name); |
| 2906 } | 2910 } |
| 2907 | 2911 |
| 2908 | 2912 |
| 2909 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( | 2913 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
| 2910 Handle<String> name, | 2914 Handle<String> name, |
| 2911 Handle<JSObject> receiver, | 2915 Handle<JSObject> receiver, |
| 2912 Handle<JSObject> holder, | 2916 Handle<JSObject> holder, |
| 2913 Handle<JSFunction> getter) { | 2917 Handle<JSFunction> getter) { |
| 2914 // ----------- S t a t e ------------- | 2918 // ----------- S t a t e ------------- |
| 2915 // -- ecx : name | 2919 // -- ecx : name |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2933 | 2937 |
| 2934 // Restore context register. | 2938 // Restore context register. |
| 2935 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2939 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2936 } | 2940 } |
| 2937 __ ret(0); | 2941 __ ret(0); |
| 2938 | 2942 |
| 2939 __ bind(&miss); | 2943 __ bind(&miss); |
| 2940 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2944 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2941 | 2945 |
| 2942 // Return the generated code. | 2946 // Return the generated code. |
| 2943 return GetCode(CALLBACKS, name); | 2947 return GetCode(Code::CALLBACKS, name); |
| 2944 } | 2948 } |
| 2945 | 2949 |
| 2946 | 2950 |
| 2947 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 2951 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
| 2948 Handle<JSObject> holder, | 2952 Handle<JSObject> holder, |
| 2949 Handle<JSFunction> value, | 2953 Handle<JSFunction> value, |
| 2950 Handle<String> name) { | 2954 Handle<String> name) { |
| 2951 // ----------- S t a t e ------------- | 2955 // ----------- S t a t e ------------- |
| 2952 // -- ecx : name | 2956 // -- ecx : name |
| 2953 // -- edx : receiver | 2957 // -- edx : receiver |
| 2954 // -- esp[0] : return address | 2958 // -- esp[0] : return address |
| 2955 // ----------------------------------- | 2959 // ----------------------------------- |
| 2956 Label miss; | 2960 Label miss; |
| 2957 | 2961 |
| 2958 GenerateLoadConstant(object, holder, edx, ebx, eax, edi, value, name, &miss); | 2962 GenerateLoadConstant(object, holder, edx, ebx, eax, edi, value, name, &miss); |
| 2959 __ bind(&miss); | 2963 __ bind(&miss); |
| 2960 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2964 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2961 | 2965 |
| 2962 // Return the generated code. | 2966 // Return the generated code. |
| 2963 return GetCode(CONSTANT_FUNCTION, name); | 2967 return GetCode(Code::CONSTANT_FUNCTION, name); |
| 2964 } | 2968 } |
| 2965 | 2969 |
| 2966 | 2970 |
| 2967 Handle<Code> LoadStubCompiler::CompileLoadInterceptor(Handle<JSObject> receiver, | 2971 Handle<Code> LoadStubCompiler::CompileLoadInterceptor(Handle<JSObject> receiver, |
| 2968 Handle<JSObject> holder, | 2972 Handle<JSObject> holder, |
| 2969 Handle<String> name) { | 2973 Handle<String> name) { |
| 2970 // ----------- S t a t e ------------- | 2974 // ----------- S t a t e ------------- |
| 2971 // -- ecx : name | 2975 // -- ecx : name |
| 2972 // -- edx : receiver | 2976 // -- edx : receiver |
| 2973 // -- esp[0] : return address | 2977 // -- esp[0] : return address |
| 2974 // ----------------------------------- | 2978 // ----------------------------------- |
| 2975 Label miss; | 2979 Label miss; |
| 2976 | 2980 |
| 2977 LookupResult lookup(isolate()); | 2981 LookupResult lookup(isolate()); |
| 2978 LookupPostInterceptor(holder, name, &lookup); | 2982 LookupPostInterceptor(holder, name, &lookup); |
| 2979 | 2983 |
| 2980 // TODO(368): Compile in the whole chain: all the interceptors in | 2984 // TODO(368): Compile in the whole chain: all the interceptors in |
| 2981 // prototypes and ultimate answer. | 2985 // prototypes and ultimate answer. |
| 2982 GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, | 2986 GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, |
| 2983 name, &miss); | 2987 name, &miss); |
| 2984 | 2988 |
| 2985 __ bind(&miss); | 2989 __ bind(&miss); |
| 2986 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2990 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2987 | 2991 |
| 2988 // Return the generated code. | 2992 // Return the generated code. |
| 2989 return GetCode(INTERCEPTOR, name); | 2993 return GetCode(Code::INTERCEPTOR, name); |
| 2990 } | 2994 } |
| 2991 | 2995 |
| 2992 | 2996 |
| 2993 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 2997 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
| 2994 Handle<JSObject> object, | 2998 Handle<JSObject> object, |
| 2995 Handle<GlobalObject> holder, | 2999 Handle<GlobalObject> holder, |
| 2996 Handle<JSGlobalPropertyCell> cell, | 3000 Handle<JSGlobalPropertyCell> cell, |
| 2997 Handle<String> name, | 3001 Handle<String> name, |
| 2998 bool is_dont_delete) { | 3002 bool is_dont_delete) { |
| 2999 // ----------- S t a t e ------------- | 3003 // ----------- S t a t e ------------- |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3027 Counters* counters = isolate()->counters(); | 3031 Counters* counters = isolate()->counters(); |
| 3028 __ IncrementCounter(counters->named_load_global_stub(), 1); | 3032 __ IncrementCounter(counters->named_load_global_stub(), 1); |
| 3029 __ mov(eax, ebx); | 3033 __ mov(eax, ebx); |
| 3030 __ ret(0); | 3034 __ ret(0); |
| 3031 | 3035 |
| 3032 __ bind(&miss); | 3036 __ bind(&miss); |
| 3033 __ IncrementCounter(counters->named_load_global_stub_miss(), 1); | 3037 __ IncrementCounter(counters->named_load_global_stub_miss(), 1); |
| 3034 GenerateLoadMiss(masm(), Code::LOAD_IC); | 3038 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 3035 | 3039 |
| 3036 // Return the generated code. | 3040 // Return the generated code. |
| 3037 return GetCode(NORMAL, name); | 3041 return GetCode(Code::NORMAL, name); |
| 3038 } | 3042 } |
| 3039 | 3043 |
| 3040 | 3044 |
| 3041 Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name, | 3045 Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name, |
| 3042 Handle<JSObject> receiver, | 3046 Handle<JSObject> receiver, |
| 3043 Handle<JSObject> holder, | 3047 Handle<JSObject> holder, |
| 3044 int index) { | 3048 int index) { |
| 3045 // ----------- S t a t e ------------- | 3049 // ----------- S t a t e ------------- |
| 3046 // -- ecx : key | 3050 // -- ecx : key |
| 3047 // -- edx : receiver | 3051 // -- edx : receiver |
| 3048 // -- esp[0] : return address | 3052 // -- esp[0] : return address |
| 3049 // ----------------------------------- | 3053 // ----------------------------------- |
| 3050 Label miss; | 3054 Label miss; |
| 3051 | 3055 |
| 3052 Counters* counters = isolate()->counters(); | 3056 Counters* counters = isolate()->counters(); |
| 3053 __ IncrementCounter(counters->keyed_load_field(), 1); | 3057 __ IncrementCounter(counters->keyed_load_field(), 1); |
| 3054 | 3058 |
| 3055 // Check that the name has not changed. | 3059 // Check that the name has not changed. |
| 3056 __ cmp(ecx, Immediate(name)); | 3060 __ cmp(ecx, Immediate(name)); |
| 3057 __ j(not_equal, &miss); | 3061 __ j(not_equal, &miss); |
| 3058 | 3062 |
| 3059 GenerateLoadField(receiver, holder, edx, ebx, eax, edi, index, name, &miss); | 3063 GenerateLoadField(receiver, holder, edx, ebx, eax, edi, index, name, &miss); |
| 3060 | 3064 |
| 3061 __ bind(&miss); | 3065 __ bind(&miss); |
| 3062 __ DecrementCounter(counters->keyed_load_field(), 1); | 3066 __ DecrementCounter(counters->keyed_load_field(), 1); |
| 3063 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3067 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3064 | 3068 |
| 3065 // Return the generated code. | 3069 // Return the generated code. |
| 3066 return GetCode(FIELD, name); | 3070 return GetCode(Code::FIELD, name); |
| 3067 } | 3071 } |
| 3068 | 3072 |
| 3069 | 3073 |
| 3070 Handle<Code> KeyedLoadStubCompiler::CompileLoadCallback( | 3074 Handle<Code> KeyedLoadStubCompiler::CompileLoadCallback( |
| 3071 Handle<String> name, | 3075 Handle<String> name, |
| 3072 Handle<JSObject> receiver, | 3076 Handle<JSObject> receiver, |
| 3073 Handle<JSObject> holder, | 3077 Handle<JSObject> holder, |
| 3074 Handle<AccessorInfo> callback) { | 3078 Handle<AccessorInfo> callback) { |
| 3075 // ----------- S t a t e ------------- | 3079 // ----------- S t a t e ------------- |
| 3076 // -- ecx : key | 3080 // -- ecx : key |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3087 __ j(not_equal, &miss); | 3091 __ j(not_equal, &miss); |
| 3088 | 3092 |
| 3089 GenerateLoadCallback(receiver, holder, edx, ecx, ebx, eax, edi, callback, | 3093 GenerateLoadCallback(receiver, holder, edx, ecx, ebx, eax, edi, callback, |
| 3090 name, &miss); | 3094 name, &miss); |
| 3091 | 3095 |
| 3092 __ bind(&miss); | 3096 __ bind(&miss); |
| 3093 __ DecrementCounter(counters->keyed_load_callback(), 1); | 3097 __ DecrementCounter(counters->keyed_load_callback(), 1); |
| 3094 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3098 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3095 | 3099 |
| 3096 // Return the generated code. | 3100 // Return the generated code. |
| 3097 return GetCode(CALLBACKS, name); | 3101 return GetCode(Code::CALLBACKS, name); |
| 3098 } | 3102 } |
| 3099 | 3103 |
| 3100 | 3104 |
| 3101 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( | 3105 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( |
| 3102 Handle<String> name, | 3106 Handle<String> name, |
| 3103 Handle<JSObject> receiver, | 3107 Handle<JSObject> receiver, |
| 3104 Handle<JSObject> holder, | 3108 Handle<JSObject> holder, |
| 3105 Handle<JSFunction> value) { | 3109 Handle<JSFunction> value) { |
| 3106 // ----------- S t a t e ------------- | 3110 // ----------- S t a t e ------------- |
| 3107 // -- ecx : key | 3111 // -- ecx : key |
| 3108 // -- edx : receiver | 3112 // -- edx : receiver |
| 3109 // -- esp[0] : return address | 3113 // -- esp[0] : return address |
| 3110 // ----------------------------------- | 3114 // ----------------------------------- |
| 3111 Label miss; | 3115 Label miss; |
| 3112 | 3116 |
| 3113 Counters* counters = isolate()->counters(); | 3117 Counters* counters = isolate()->counters(); |
| 3114 __ IncrementCounter(counters->keyed_load_constant_function(), 1); | 3118 __ IncrementCounter(counters->keyed_load_constant_function(), 1); |
| 3115 | 3119 |
| 3116 // Check that the name has not changed. | 3120 // Check that the name has not changed. |
| 3117 __ cmp(ecx, Immediate(name)); | 3121 __ cmp(ecx, Immediate(name)); |
| 3118 __ j(not_equal, &miss); | 3122 __ j(not_equal, &miss); |
| 3119 | 3123 |
| 3120 GenerateLoadConstant( | 3124 GenerateLoadConstant( |
| 3121 receiver, holder, edx, ebx, eax, edi, value, name, &miss); | 3125 receiver, holder, edx, ebx, eax, edi, value, name, &miss); |
| 3122 __ bind(&miss); | 3126 __ bind(&miss); |
| 3123 __ DecrementCounter(counters->keyed_load_constant_function(), 1); | 3127 __ DecrementCounter(counters->keyed_load_constant_function(), 1); |
| 3124 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3128 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3125 | 3129 |
| 3126 // Return the generated code. | 3130 // Return the generated code. |
| 3127 return GetCode(CONSTANT_FUNCTION, name); | 3131 return GetCode(Code::CONSTANT_FUNCTION, name); |
| 3128 } | 3132 } |
| 3129 | 3133 |
| 3130 | 3134 |
| 3131 Handle<Code> KeyedLoadStubCompiler::CompileLoadInterceptor( | 3135 Handle<Code> KeyedLoadStubCompiler::CompileLoadInterceptor( |
| 3132 Handle<JSObject> receiver, | 3136 Handle<JSObject> receiver, |
| 3133 Handle<JSObject> holder, | 3137 Handle<JSObject> holder, |
| 3134 Handle<String> name) { | 3138 Handle<String> name) { |
| 3135 // ----------- S t a t e ------------- | 3139 // ----------- S t a t e ------------- |
| 3136 // -- ecx : key | 3140 // -- ecx : key |
| 3137 // -- edx : receiver | 3141 // -- edx : receiver |
| (...skipping 10 matching lines...) Expand all Loading... |
| 3148 | 3152 |
| 3149 LookupResult lookup(isolate()); | 3153 LookupResult lookup(isolate()); |
| 3150 LookupPostInterceptor(holder, name, &lookup); | 3154 LookupPostInterceptor(holder, name, &lookup); |
| 3151 GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, | 3155 GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, |
| 3152 name, &miss); | 3156 name, &miss); |
| 3153 __ bind(&miss); | 3157 __ bind(&miss); |
| 3154 __ DecrementCounter(counters->keyed_load_interceptor(), 1); | 3158 __ DecrementCounter(counters->keyed_load_interceptor(), 1); |
| 3155 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3159 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3156 | 3160 |
| 3157 // Return the generated code. | 3161 // Return the generated code. |
| 3158 return GetCode(INTERCEPTOR, name); | 3162 return GetCode(Code::INTERCEPTOR, name); |
| 3159 } | 3163 } |
| 3160 | 3164 |
| 3161 | 3165 |
| 3162 Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength( | 3166 Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength( |
| 3163 Handle<String> name) { | 3167 Handle<String> name) { |
| 3164 // ----------- S t a t e ------------- | 3168 // ----------- S t a t e ------------- |
| 3165 // -- ecx : key | 3169 // -- ecx : key |
| 3166 // -- edx : receiver | 3170 // -- edx : receiver |
| 3167 // -- esp[0] : return address | 3171 // -- esp[0] : return address |
| 3168 // ----------------------------------- | 3172 // ----------------------------------- |
| 3169 Label miss; | 3173 Label miss; |
| 3170 | 3174 |
| 3171 Counters* counters = isolate()->counters(); | 3175 Counters* counters = isolate()->counters(); |
| 3172 __ IncrementCounter(counters->keyed_load_array_length(), 1); | 3176 __ IncrementCounter(counters->keyed_load_array_length(), 1); |
| 3173 | 3177 |
| 3174 // Check that the name has not changed. | 3178 // Check that the name has not changed. |
| 3175 __ cmp(ecx, Immediate(name)); | 3179 __ cmp(ecx, Immediate(name)); |
| 3176 __ j(not_equal, &miss); | 3180 __ j(not_equal, &miss); |
| 3177 | 3181 |
| 3178 GenerateLoadArrayLength(masm(), edx, eax, &miss); | 3182 GenerateLoadArrayLength(masm(), edx, eax, &miss); |
| 3179 __ bind(&miss); | 3183 __ bind(&miss); |
| 3180 __ DecrementCounter(counters->keyed_load_array_length(), 1); | 3184 __ DecrementCounter(counters->keyed_load_array_length(), 1); |
| 3181 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3185 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3182 | 3186 |
| 3183 // Return the generated code. | 3187 // Return the generated code. |
| 3184 return GetCode(CALLBACKS, name); | 3188 return GetCode(Code::CALLBACKS, name); |
| 3185 } | 3189 } |
| 3186 | 3190 |
| 3187 | 3191 |
| 3188 Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength( | 3192 Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength( |
| 3189 Handle<String> name) { | 3193 Handle<String> name) { |
| 3190 // ----------- S t a t e ------------- | 3194 // ----------- S t a t e ------------- |
| 3191 // -- ecx : key | 3195 // -- ecx : key |
| 3192 // -- edx : receiver | 3196 // -- edx : receiver |
| 3193 // -- esp[0] : return address | 3197 // -- esp[0] : return address |
| 3194 // ----------------------------------- | 3198 // ----------------------------------- |
| 3195 Label miss; | 3199 Label miss; |
| 3196 | 3200 |
| 3197 Counters* counters = isolate()->counters(); | 3201 Counters* counters = isolate()->counters(); |
| 3198 __ IncrementCounter(counters->keyed_load_string_length(), 1); | 3202 __ IncrementCounter(counters->keyed_load_string_length(), 1); |
| 3199 | 3203 |
| 3200 // Check that the name has not changed. | 3204 // Check that the name has not changed. |
| 3201 __ cmp(ecx, Immediate(name)); | 3205 __ cmp(ecx, Immediate(name)); |
| 3202 __ j(not_equal, &miss); | 3206 __ j(not_equal, &miss); |
| 3203 | 3207 |
| 3204 GenerateLoadStringLength(masm(), edx, eax, ebx, &miss, true); | 3208 GenerateLoadStringLength(masm(), edx, eax, ebx, &miss, true); |
| 3205 __ bind(&miss); | 3209 __ bind(&miss); |
| 3206 __ DecrementCounter(counters->keyed_load_string_length(), 1); | 3210 __ DecrementCounter(counters->keyed_load_string_length(), 1); |
| 3207 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3211 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3208 | 3212 |
| 3209 // Return the generated code. | 3213 // Return the generated code. |
| 3210 return GetCode(CALLBACKS, name); | 3214 return GetCode(Code::CALLBACKS, name); |
| 3211 } | 3215 } |
| 3212 | 3216 |
| 3213 | 3217 |
| 3214 Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype( | 3218 Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype( |
| 3215 Handle<String> name) { | 3219 Handle<String> name) { |
| 3216 // ----------- S t a t e ------------- | 3220 // ----------- S t a t e ------------- |
| 3217 // -- ecx : key | 3221 // -- ecx : key |
| 3218 // -- edx : receiver | 3222 // -- edx : receiver |
| 3219 // -- esp[0] : return address | 3223 // -- esp[0] : return address |
| 3220 // ----------------------------------- | 3224 // ----------------------------------- |
| 3221 Label miss; | 3225 Label miss; |
| 3222 | 3226 |
| 3223 Counters* counters = isolate()->counters(); | 3227 Counters* counters = isolate()->counters(); |
| 3224 __ IncrementCounter(counters->keyed_load_function_prototype(), 1); | 3228 __ IncrementCounter(counters->keyed_load_function_prototype(), 1); |
| 3225 | 3229 |
| 3226 // Check that the name has not changed. | 3230 // Check that the name has not changed. |
| 3227 __ cmp(ecx, Immediate(name)); | 3231 __ cmp(ecx, Immediate(name)); |
| 3228 __ j(not_equal, &miss); | 3232 __ j(not_equal, &miss); |
| 3229 | 3233 |
| 3230 GenerateLoadFunctionPrototype(masm(), edx, eax, ebx, &miss); | 3234 GenerateLoadFunctionPrototype(masm(), edx, eax, ebx, &miss); |
| 3231 __ bind(&miss); | 3235 __ bind(&miss); |
| 3232 __ DecrementCounter(counters->keyed_load_function_prototype(), 1); | 3236 __ DecrementCounter(counters->keyed_load_function_prototype(), 1); |
| 3233 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3237 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3234 | 3238 |
| 3235 // Return the generated code. | 3239 // Return the generated code. |
| 3236 return GetCode(CALLBACKS, name); | 3240 return GetCode(Code::CALLBACKS, name); |
| 3237 } | 3241 } |
| 3238 | 3242 |
| 3239 | 3243 |
| 3240 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( | 3244 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
| 3241 Handle<Map> receiver_map) { | 3245 Handle<Map> receiver_map) { |
| 3242 // ----------- S t a t e ------------- | 3246 // ----------- S t a t e ------------- |
| 3243 // -- ecx : key | 3247 // -- ecx : key |
| 3244 // -- edx : receiver | 3248 // -- edx : receiver |
| 3245 // -- esp[0] : return address | 3249 // -- esp[0] : return address |
| 3246 // ----------------------------------- | 3250 // ----------------------------------- |
| 3247 | 3251 |
| 3248 ElementsKind elements_kind = receiver_map->elements_kind(); | 3252 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 3249 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode(); | 3253 Handle<Code> stub = KeyedLoadElementStub(elements_kind).GetCode(); |
| 3250 | 3254 |
| 3251 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); | 3255 __ DispatchMap(edx, receiver_map, stub, DO_SMI_CHECK); |
| 3252 | 3256 |
| 3253 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3257 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3254 | 3258 |
| 3255 // Return the generated code. | 3259 // Return the generated code. |
| 3256 return GetCode(NORMAL, factory()->empty_string()); | 3260 return GetCode(Code::NORMAL, factory()->empty_string()); |
| 3257 } | 3261 } |
| 3258 | 3262 |
| 3259 | 3263 |
| 3260 Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic( | 3264 Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic( |
| 3261 MapHandleList* receiver_maps, | 3265 MapHandleList* receiver_maps, |
| 3262 CodeHandleList* handler_ics) { | 3266 CodeHandleList* handler_ics) { |
| 3263 // ----------- S t a t e ------------- | 3267 // ----------- S t a t e ------------- |
| 3264 // -- ecx : key | 3268 // -- ecx : key |
| 3265 // -- edx : receiver | 3269 // -- edx : receiver |
| 3266 // -- esp[0] : return address | 3270 // -- esp[0] : return address |
| 3267 // ----------------------------------- | 3271 // ----------------------------------- |
| 3268 Label miss; | 3272 Label miss; |
| 3269 __ JumpIfSmi(edx, &miss); | 3273 __ JumpIfSmi(edx, &miss); |
| 3270 | 3274 |
| 3271 Register map_reg = ebx; | 3275 Register map_reg = ebx; |
| 3272 __ mov(map_reg, FieldOperand(edx, HeapObject::kMapOffset)); | 3276 __ mov(map_reg, FieldOperand(edx, HeapObject::kMapOffset)); |
| 3273 int receiver_count = receiver_maps->length(); | 3277 int receiver_count = receiver_maps->length(); |
| 3274 for (int current = 0; current < receiver_count; ++current) { | 3278 for (int current = 0; current < receiver_count; ++current) { |
| 3275 __ cmp(map_reg, receiver_maps->at(current)); | 3279 __ cmp(map_reg, receiver_maps->at(current)); |
| 3276 __ j(equal, handler_ics->at(current)); | 3280 __ j(equal, handler_ics->at(current)); |
| 3277 } | 3281 } |
| 3278 | 3282 |
| 3279 __ bind(&miss); | 3283 __ bind(&miss); |
| 3280 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3284 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3281 | 3285 |
| 3282 // Return the generated code. | 3286 // Return the generated code. |
| 3283 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); | 3287 return GetCode(Code::NORMAL, factory()->empty_string(), MEGAMORPHIC); |
| 3284 } | 3288 } |
| 3285 | 3289 |
| 3286 | 3290 |
| 3287 // Specialized stub for constructing objects from functions which only have only | 3291 // Specialized stub for constructing objects from functions which only have only |
| 3288 // simple assignments of the form this.x = ...; in their body. | 3292 // simple assignments of the form this.x = ...; in their body. |
| 3289 Handle<Code> ConstructStubCompiler::CompileConstructStub( | 3293 Handle<Code> ConstructStubCompiler::CompileConstructStub( |
| 3290 Handle<JSFunction> function) { | 3294 Handle<JSFunction> function) { |
| 3291 // ----------- S t a t e ------------- | 3295 // ----------- S t a t e ------------- |
| 3292 // -- eax : argc | 3296 // -- eax : argc |
| 3293 // -- edi : constructor | 3297 // -- edi : constructor |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4238 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4242 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 4239 } | 4243 } |
| 4240 } | 4244 } |
| 4241 | 4245 |
| 4242 | 4246 |
| 4243 #undef __ | 4247 #undef __ |
| 4244 | 4248 |
| 4245 } } // namespace v8::internal | 4249 } } // namespace v8::internal |
| 4246 | 4250 |
| 4247 #endif // V8_TARGET_ARCH_IA32 | 4251 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |