OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2523 __ bind(&miss); | 2523 __ bind(&miss); |
2524 __ DecrementCounter(counters->keyed_store_field(), 1); | 2524 __ DecrementCounter(counters->keyed_store_field(), 1); |
2525 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2525 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
2526 __ Jump(ic, RelocInfo::CODE_TARGET); | 2526 __ Jump(ic, RelocInfo::CODE_TARGET); |
2527 | 2527 |
2528 // Return the generated code. | 2528 // Return the generated code. |
2529 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 2529 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
2530 } | 2530 } |
2531 | 2531 |
2532 | 2532 |
2533 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( | 2533 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) { |
2534 Map* receiver_map) { | |
2535 // ----------- S t a t e ------------- | 2534 // ----------- S t a t e ------------- |
2536 // -- rax : value | 2535 // -- rax : value |
2537 // -- rcx : key | 2536 // -- rcx : key |
2538 // -- rdx : receiver | 2537 // -- rdx : receiver |
2539 // -- rsp[0] : return address | 2538 // -- rsp[0] : return address |
2540 // ----------------------------------- | 2539 // ----------------------------------- |
2541 MaybeObject* maybe_stub; | |
2542 if (receiver_map->has_fast_elements()) { | |
2543 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | |
2544 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode(); | |
2545 } else { | |
2546 ASSERT(receiver_map->has_external_array_elements()); | |
2547 JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); | |
2548 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode(); | |
2549 } | |
2550 Code* stub; | 2540 Code* stub; |
| 2541 MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map); |
2551 if (!maybe_stub->To(&stub)) return maybe_stub; | 2542 if (!maybe_stub->To(&stub)) return maybe_stub; |
2552 __ DispatchMap(rdx, | 2543 __ DispatchMap(rdx, |
2553 Handle<Map>(receiver_map), | 2544 Handle<Map>(receiver_map), |
2554 Handle<Code>(stub), | 2545 Handle<Code>(stub), |
2555 DO_SMI_CHECK); | 2546 DO_SMI_CHECK); |
2556 | 2547 |
2557 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 2548 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
2558 __ jmp(ic, RelocInfo::CODE_TARGET); | 2549 __ jmp(ic, RelocInfo::CODE_TARGET); |
2559 | 2550 |
2560 // Return the generated code. | 2551 // Return the generated code. |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 return GetCode(CALLBACKS, name); | 2986 return GetCode(CALLBACKS, name); |
2996 } | 2987 } |
2997 | 2988 |
2998 | 2989 |
2999 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { | 2990 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { |
3000 // ----------- S t a t e ------------- | 2991 // ----------- S t a t e ------------- |
3001 // -- rax : key | 2992 // -- rax : key |
3002 // -- rdx : receiver | 2993 // -- rdx : receiver |
3003 // -- rsp[0] : return address | 2994 // -- rsp[0] : return address |
3004 // ----------------------------------- | 2995 // ----------------------------------- |
3005 MaybeObject* maybe_stub; | |
3006 if (receiver_map->has_fast_elements()) { | |
3007 maybe_stub = KeyedLoadFastElementStub().TryGetCode(); | |
3008 } else { | |
3009 ASSERT(receiver_map->has_external_array_elements()); | |
3010 JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); | |
3011 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode(); | |
3012 } | |
3013 Code* stub; | 2996 Code* stub; |
| 2997 MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map); |
3014 if (!maybe_stub->To(&stub)) return maybe_stub; | 2998 if (!maybe_stub->To(&stub)) return maybe_stub; |
3015 __ DispatchMap(rdx, | 2999 __ DispatchMap(rdx, |
3016 Handle<Map>(receiver_map), | 3000 Handle<Map>(receiver_map), |
3017 Handle<Code>(stub), | 3001 Handle<Code>(stub), |
3018 DO_SMI_CHECK); | 3002 DO_SMI_CHECK); |
3019 | 3003 |
3020 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); | 3004 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); |
3021 __ jmp(ic, RelocInfo::CODE_TARGET); | 3005 __ jmp(ic, RelocInfo::CODE_TARGET); |
3022 | 3006 |
3023 // Return the generated code. | 3007 // Return the generated code. |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3597 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3581 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
3598 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3582 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
3599 } | 3583 } |
3600 | 3584 |
3601 | 3585 |
3602 #undef __ | 3586 #undef __ |
3603 | 3587 |
3604 } } // namespace v8::internal | 3588 } } // namespace v8::internal |
3605 | 3589 |
3606 #endif // V8_TARGET_ARCH_X64 | 3590 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |