| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 __ mov(r0, scratch1); | 418 __ mov(r0, scratch1); |
| 419 __ Ret(); | 419 __ Ret(); |
| 420 } | 420 } |
| 421 | 421 |
| 422 | 422 |
| 423 // Generate StoreField code, value is passed in r0 register. | 423 // Generate StoreField code, value is passed in r0 register. |
| 424 // When leaving generated code after success, the receiver_reg and name_reg | 424 // When leaving generated code after success, the receiver_reg and name_reg |
| 425 // may be clobbered. Upon branch to miss_label, the receiver and name | 425 // may be clobbered. Upon branch to miss_label, the receiver and name |
| 426 // registers have their original values. | 426 // registers have their original values. |
| 427 void StubCompiler::GenerateStoreField(MacroAssembler* masm, | 427 void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
| 428 JSObject* object, | 428 Handle<JSObject> object, |
| 429 int index, | 429 int index, |
| 430 Map* transition, | 430 Handle<Map> transition, |
| 431 Register receiver_reg, | 431 Register receiver_reg, |
| 432 Register name_reg, | 432 Register name_reg, |
| 433 Register scratch, | 433 Register scratch, |
| 434 Label* miss_label) { | 434 Label* miss_label) { |
| 435 // r0 : value | 435 // r0 : value |
| 436 Label exit; | 436 Label exit; |
| 437 | 437 |
| 438 // Check that the receiver isn't a smi. | 438 // Check that the receiver isn't a smi. |
| 439 __ JumpIfSmi(receiver_reg, miss_label); | 439 __ JumpIfSmi(receiver_reg, miss_label); |
| 440 | 440 |
| 441 // Check that the map of the receiver hasn't changed. | 441 // Check that the map of the receiver hasn't changed. |
| 442 __ ldr(scratch, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); | 442 __ ldr(scratch, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); |
| 443 __ cmp(scratch, Operand(Handle<Map>(object->map()))); | 443 __ cmp(scratch, Operand(Handle<Map>(object->map()))); |
| 444 __ b(ne, miss_label); | 444 __ b(ne, miss_label); |
| 445 | 445 |
| 446 // Perform global security token check if needed. | 446 // Perform global security token check if needed. |
| 447 if (object->IsJSGlobalProxy()) { | 447 if (object->IsJSGlobalProxy()) { |
| 448 __ CheckAccessGlobalProxy(receiver_reg, scratch, miss_label); | 448 __ CheckAccessGlobalProxy(receiver_reg, scratch, miss_label); |
| 449 } | 449 } |
| 450 | 450 |
| 451 // Stub never generated for non-global objects that require access | 451 // Stub never generated for non-global objects that require access |
| 452 // checks. | 452 // checks. |
| 453 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 453 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
| 454 | 454 |
| 455 // Perform map transition for the receiver if necessary. | 455 // Perform map transition for the receiver if necessary. |
| 456 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { | 456 if (!transition.is_null() && (object->map()->unused_property_fields() == 0)) { |
| 457 // The properties must be extended before we can store the value. | 457 // The properties must be extended before we can store the value. |
| 458 // We jump to a runtime call that extends the properties array. | 458 // We jump to a runtime call that extends the properties array. |
| 459 __ push(receiver_reg); | 459 __ push(receiver_reg); |
| 460 __ mov(r2, Operand(Handle<Map>(transition))); | 460 __ mov(r2, Operand(transition)); |
| 461 __ Push(r2, r0); | 461 __ Push(r2, r0); |
| 462 __ TailCallExternalReference( | 462 __ TailCallExternalReference( |
| 463 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), | 463 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), |
| 464 masm->isolate()), | 464 masm->isolate()), |
| 465 3, | 465 3, |
| 466 1); | 466 1); |
| 467 return; | 467 return; |
| 468 } | 468 } |
| 469 | 469 |
| 470 if (transition != NULL) { | 470 if (!transition.is_null()) { |
| 471 // Update the map of the object; no write barrier updating is | 471 // Update the map of the object; no write barrier updating is |
| 472 // needed because the map is never in new space. | 472 // needed because the map is never in new space. |
| 473 __ mov(ip, Operand(Handle<Map>(transition))); | 473 __ mov(ip, Operand(transition)); |
| 474 __ str(ip, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); | 474 __ str(ip, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); |
| 475 } | 475 } |
| 476 | 476 |
| 477 // Adjust for the number of properties stored in the object. Even in the | 477 // Adjust for the number of properties stored in the object. Even in the |
| 478 // face of a transition we can use the old map here because the size of the | 478 // face of a transition we can use the old map here because the size of the |
| 479 // object and the number of in-object properties is not going to change. | 479 // object and the number of in-object properties is not going to change. |
| 480 index -= object->map()->inobject_properties(); | 480 index -= object->map()->inobject_properties(); |
| 481 | 481 |
| 482 if (index < 0) { | 482 if (index < 0) { |
| 483 // Set the property straight into the object. | 483 // Set the property straight into the object. |
| (...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 __ bind(&miss); | 2814 __ bind(&miss); |
| 2815 __ IncrementCounter(counters->call_global_inline_miss(), 1, r1, r3); | 2815 __ IncrementCounter(counters->call_global_inline_miss(), 1, r1, r3); |
| 2816 MaybeObject* maybe_result = TryGenerateMissBranch(); | 2816 MaybeObject* maybe_result = TryGenerateMissBranch(); |
| 2817 if (maybe_result->IsFailure()) return maybe_result; | 2817 if (maybe_result->IsFailure()) return maybe_result; |
| 2818 | 2818 |
| 2819 // Return the generated code. | 2819 // Return the generated code. |
| 2820 return TryGetCode(NORMAL, name); | 2820 return TryGetCode(NORMAL, name); |
| 2821 } | 2821 } |
| 2822 | 2822 |
| 2823 | 2823 |
| 2824 MaybeObject* StoreStubCompiler::CompileStoreField(JSObject* object, | 2824 Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
| 2825 int index, | 2825 int index, |
| 2826 Map* transition, | 2826 Handle<Map> transition, |
| 2827 String* name) { | 2827 Handle<String> name) { |
| 2828 // ----------- S t a t e ------------- | 2828 // ----------- S t a t e ------------- |
| 2829 // -- r0 : value | 2829 // -- r0 : value |
| 2830 // -- r1 : receiver | 2830 // -- r1 : receiver |
| 2831 // -- r2 : name | 2831 // -- r2 : name |
| 2832 // -- lr : return address | 2832 // -- lr : return address |
| 2833 // ----------------------------------- | 2833 // ----------------------------------- |
| 2834 Label miss; | 2834 Label miss; |
| 2835 | 2835 |
| 2836 GenerateStoreField(masm(), | 2836 GenerateStoreField(masm(), object, index, transition, r1, r2, r3, &miss); |
| 2837 object, | |
| 2838 index, | |
| 2839 transition, | |
| 2840 r1, r2, r3, | |
| 2841 &miss); | |
| 2842 __ bind(&miss); | 2837 __ bind(&miss); |
| 2843 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2838 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
| 2844 __ Jump(ic, RelocInfo::CODE_TARGET); | 2839 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 2845 | 2840 |
| 2846 // Return the generated code. | 2841 // Return the generated code. |
| 2847 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 2842 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); |
| 2848 } | 2843 } |
| 2849 | 2844 |
| 2850 | 2845 |
| 2851 MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, | 2846 MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, |
| 2852 AccessorInfo* callback, | 2847 AccessorInfo* callback, |
| 2853 String* name) { | 2848 String* name) { |
| 2854 // ----------- S t a t e ------------- | 2849 // ----------- S t a t e ------------- |
| 2855 // -- r0 : value | 2850 // -- r0 : value |
| 2856 // -- r1 : receiver | 2851 // -- r1 : receiver |
| 2857 // -- r2 : name | 2852 // -- r2 : name |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2885 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), | 2880 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), |
| 2886 masm()->isolate()); | 2881 masm()->isolate()); |
| 2887 __ TailCallExternalReference(store_callback_property, 4, 1); | 2882 __ TailCallExternalReference(store_callback_property, 4, 1); |
| 2888 | 2883 |
| 2889 // Handle store cache miss. | 2884 // Handle store cache miss. |
| 2890 __ bind(&miss); | 2885 __ bind(&miss); |
| 2891 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2886 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
| 2892 __ Jump(ic, RelocInfo::CODE_TARGET); | 2887 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 2893 | 2888 |
| 2894 // Return the generated code. | 2889 // Return the generated code. |
| 2895 return GetCode(CALLBACKS, name); | 2890 return TryGetCode(CALLBACKS, name); |
| 2896 } | 2891 } |
| 2897 | 2892 |
| 2898 | 2893 |
| 2899 MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, | 2894 MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, |
| 2900 String* name) { | 2895 String* name) { |
| 2901 // ----------- S t a t e ------------- | 2896 // ----------- S t a t e ------------- |
| 2902 // -- r0 : value | 2897 // -- r0 : value |
| 2903 // -- r1 : receiver | 2898 // -- r1 : receiver |
| 2904 // -- r2 : name | 2899 // -- r2 : name |
| 2905 // -- lr : return address | 2900 // -- lr : return address |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2933 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), | 2928 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty), |
| 2934 masm()->isolate()); | 2929 masm()->isolate()); |
| 2935 __ TailCallExternalReference(store_ic_property, 4, 1); | 2930 __ TailCallExternalReference(store_ic_property, 4, 1); |
| 2936 | 2931 |
| 2937 // Handle store cache miss. | 2932 // Handle store cache miss. |
| 2938 __ bind(&miss); | 2933 __ bind(&miss); |
| 2939 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2934 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
| 2940 __ Jump(ic, RelocInfo::CODE_TARGET); | 2935 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 2941 | 2936 |
| 2942 // Return the generated code. | 2937 // Return the generated code. |
| 2943 return GetCode(INTERCEPTOR, name); | 2938 return TryGetCode(INTERCEPTOR, name); |
| 2944 } | 2939 } |
| 2945 | 2940 |
| 2946 | 2941 |
| 2947 MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, | 2942 Handle<Code> StoreStubCompiler::CompileStoreGlobal( |
| 2948 JSGlobalPropertyCell* cell, | 2943 Handle<GlobalObject> object, |
| 2949 String* name) { | 2944 Handle<JSGlobalPropertyCell> cell, |
| 2945 Handle<String> name) { |
| 2950 // ----------- S t a t e ------------- | 2946 // ----------- S t a t e ------------- |
| 2951 // -- r0 : value | 2947 // -- r0 : value |
| 2952 // -- r1 : receiver | 2948 // -- r1 : receiver |
| 2953 // -- r2 : name | 2949 // -- r2 : name |
| 2954 // -- lr : return address | 2950 // -- lr : return address |
| 2955 // ----------------------------------- | 2951 // ----------------------------------- |
| 2956 Label miss; | 2952 Label miss; |
| 2957 | 2953 |
| 2958 // Check that the map of the global has not changed. | 2954 // Check that the map of the global has not changed. |
| 2959 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); | 2955 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); |
| 2960 __ cmp(r3, Operand(Handle<Map>(object->map()))); | 2956 __ cmp(r3, Operand(Handle<Map>(object->map()))); |
| 2961 __ b(ne, &miss); | 2957 __ b(ne, &miss); |
| 2962 | 2958 |
| 2963 // Check that the value in the cell is not the hole. If it is, this | 2959 // Check that the value in the cell is not the hole. If it is, this |
| 2964 // cell could have been deleted and reintroducing the global needs | 2960 // cell could have been deleted and reintroducing the global needs |
| 2965 // to update the property details in the property dictionary of the | 2961 // to update the property details in the property dictionary of the |
| 2966 // global object. We bail out to the runtime system to do that. | 2962 // global object. We bail out to the runtime system to do that. |
| 2967 __ mov(r4, Operand(Handle<JSGlobalPropertyCell>(cell))); | 2963 __ mov(r4, Operand(cell)); |
| 2968 __ LoadRoot(r5, Heap::kTheHoleValueRootIndex); | 2964 __ LoadRoot(r5, Heap::kTheHoleValueRootIndex); |
| 2969 __ ldr(r6, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset)); | 2965 __ ldr(r6, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset)); |
| 2970 __ cmp(r5, r6); | 2966 __ cmp(r5, r6); |
| 2971 __ b(eq, &miss); | 2967 __ b(eq, &miss); |
| 2972 | 2968 |
| 2973 // Store the value in the cell. | 2969 // Store the value in the cell. |
| 2974 __ str(r0, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset)); | 2970 __ str(r0, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset)); |
| 2975 | 2971 |
| 2976 __ mov(r1, r0); | 2972 __ mov(r1, r0); |
| 2977 __ RecordWriteField(r4, | 2973 __ RecordWriteField(r4, |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3404 | 3400 |
| 3405 __ bind(&miss); | 3401 __ bind(&miss); |
| 3406 Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss(); | 3402 Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss(); |
| 3407 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); | 3403 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); |
| 3408 | 3404 |
| 3409 // Return the generated code. | 3405 // Return the generated code. |
| 3410 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); | 3406 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); |
| 3411 } | 3407 } |
| 3412 | 3408 |
| 3413 | 3409 |
| 3414 MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | 3410 Handle<Code> KeyedStoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
| 3415 int index, | 3411 int index, |
| 3416 Map* transition, | 3412 Handle<Map> transition, |
| 3417 String* name) { | 3413 Handle<String> name) { |
| 3418 // ----------- S t a t e ------------- | 3414 // ----------- S t a t e ------------- |
| 3419 // -- r0 : value | 3415 // -- r0 : value |
| 3420 // -- r1 : name | 3416 // -- r1 : name |
| 3421 // -- r2 : receiver | 3417 // -- r2 : receiver |
| 3422 // -- lr : return address | 3418 // -- lr : return address |
| 3423 // ----------------------------------- | 3419 // ----------------------------------- |
| 3424 Label miss; | 3420 Label miss; |
| 3425 | 3421 |
| 3426 Counters* counters = masm()->isolate()->counters(); | 3422 Counters* counters = masm()->isolate()->counters(); |
| 3427 __ IncrementCounter(counters->keyed_store_field(), 1, r3, r4); | 3423 __ IncrementCounter(counters->keyed_store_field(), 1, r3, r4); |
| 3428 | 3424 |
| 3429 // Check that the name has not changed. | 3425 // Check that the name has not changed. |
| 3430 __ cmp(r1, Operand(Handle<String>(name))); | 3426 __ cmp(r1, Operand(name)); |
| 3431 __ b(ne, &miss); | 3427 __ b(ne, &miss); |
| 3432 | 3428 |
| 3433 // r3 is used as scratch register. r1 and r2 keep their values if a jump to | 3429 // r3 is used as scratch register. r1 and r2 keep their values if a jump to |
| 3434 // the miss label is generated. | 3430 // the miss label is generated. |
| 3435 GenerateStoreField(masm(), | 3431 GenerateStoreField(masm(), object, index, transition, r2, r1, r3, &miss); |
| 3436 object, | |
| 3437 index, | |
| 3438 transition, | |
| 3439 r2, r1, r3, | |
| 3440 &miss); | |
| 3441 __ bind(&miss); | 3432 __ bind(&miss); |
| 3442 | 3433 |
| 3443 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4); | 3434 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4); |
| 3444 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); | 3435 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); |
| 3445 __ Jump(ic, RelocInfo::CODE_TARGET); | 3436 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 3446 | 3437 |
| 3447 // Return the generated code. | 3438 // Return the generated code. |
| 3448 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 3439 return GetCode(transition.is_null() ? FIELD : MAP_TRANSITION, name); |
| 3449 } | 3440 } |
| 3450 | 3441 |
| 3451 | 3442 |
| 3452 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) { | 3443 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( |
| 3444 Handle<Map> receiver_map) { |
| 3453 // ----------- S t a t e ------------- | 3445 // ----------- S t a t e ------------- |
| 3454 // -- r0 : value | 3446 // -- r0 : value |
| 3455 // -- r1 : key | 3447 // -- r1 : key |
| 3456 // -- r2 : receiver | 3448 // -- r2 : receiver |
| 3457 // -- lr : return address | 3449 // -- lr : return address |
| 3458 // -- r3 : scratch | 3450 // -- r3 : scratch |
| 3459 // ----------------------------------- | 3451 // ----------------------------------- |
| 3460 Code* stub; | |
| 3461 ElementsKind elements_kind = receiver_map->elements_kind(); | 3452 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 3462 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 3453 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 3463 MaybeObject* maybe_stub = | 3454 Handle<Code> stub = |
| 3464 KeyedStoreElementStub(is_js_array, elements_kind).TryGetCode(); | 3455 KeyedStoreElementStub(is_js_array, elements_kind).GetCode(); |
| 3465 if (!maybe_stub->To(&stub)) return maybe_stub; | 3456 |
| 3466 __ DispatchMap(r2, | 3457 __ DispatchMap(r2, r3, receiver_map, stub, DO_SMI_CHECK); |
| 3467 r3, | |
| 3468 Handle<Map>(receiver_map), | |
| 3469 Handle<Code>(stub), | |
| 3470 DO_SMI_CHECK); | |
| 3471 | 3458 |
| 3472 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 3459 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 3473 __ Jump(ic, RelocInfo::CODE_TARGET); | 3460 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 3474 | 3461 |
| 3475 // Return the generated code. | 3462 // Return the generated code. |
| 3476 return GetCode(NORMAL, NULL); | 3463 return GetCode(NORMAL, factory()->empty_string()); |
| 3477 } | 3464 } |
| 3478 | 3465 |
| 3479 | 3466 |
| 3480 MaybeObject* KeyedStoreStubCompiler::CompileStorePolymorphic( | 3467 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
| 3481 MapList* receiver_maps, | 3468 MapHandleList* receiver_maps, |
| 3482 CodeList* handler_stubs, | 3469 CodeHandleList* handler_stubs, |
| 3483 MapList* transitioned_maps) { | 3470 MapHandleList* transitioned_maps) { |
| 3484 // ----------- S t a t e ------------- | 3471 // ----------- S t a t e ------------- |
| 3485 // -- r0 : value | 3472 // -- r0 : value |
| 3486 // -- r1 : key | 3473 // -- r1 : key |
| 3487 // -- r2 : receiver | 3474 // -- r2 : receiver |
| 3488 // -- lr : return address | 3475 // -- lr : return address |
| 3489 // -- r3 : scratch | 3476 // -- r3 : scratch |
| 3490 // ----------------------------------- | 3477 // ----------------------------------- |
| 3491 Label miss; | 3478 Label miss; |
| 3492 __ JumpIfSmi(r2, &miss); | 3479 __ JumpIfSmi(r2, &miss); |
| 3493 | 3480 |
| 3494 int receiver_count = receiver_maps->length(); | 3481 int receiver_count = receiver_maps->length(); |
| 3495 __ ldr(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); | 3482 __ ldr(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); |
| 3496 for (int i = 0; i < receiver_count; ++i) { | 3483 for (int i = 0; i < receiver_count; ++i) { |
| 3497 Handle<Map> map(receiver_maps->at(i)); | 3484 __ mov(ip, Operand(receiver_maps->at(i))); |
| 3498 Handle<Code> code(handler_stubs->at(i)); | |
| 3499 __ mov(ip, Operand(map)); | |
| 3500 __ cmp(r3, ip); | 3485 __ cmp(r3, ip); |
| 3501 if (transitioned_maps->at(i) == NULL) { | 3486 if (transitioned_maps->at(i).is_null()) { |
| 3502 __ Jump(code, RelocInfo::CODE_TARGET, eq); | 3487 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq); |
| 3503 } else { | 3488 } else { |
| 3504 Label next_map; | 3489 Label next_map; |
| 3505 __ b(ne, &next_map); | 3490 __ b(ne, &next_map); |
| 3506 __ mov(r3, Operand(Handle<Map>(transitioned_maps->at(i)))); | 3491 __ mov(r3, Operand(transitioned_maps->at(i))); |
| 3507 __ Jump(code, RelocInfo::CODE_TARGET, al); | 3492 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, al); |
| 3508 __ bind(&next_map); | 3493 __ bind(&next_map); |
| 3509 } | 3494 } |
| 3510 } | 3495 } |
| 3511 | 3496 |
| 3512 __ bind(&miss); | 3497 __ bind(&miss); |
| 3513 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 3498 Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
| 3514 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); | 3499 __ Jump(miss_ic, RelocInfo::CODE_TARGET, al); |
| 3515 | 3500 |
| 3516 // Return the generated code. | 3501 // Return the generated code. |
| 3517 return GetCode(NORMAL, NULL, MEGAMORPHIC); | 3502 return GetCode(NORMAL, factory()->empty_string(), MEGAMORPHIC); |
| 3518 } | 3503 } |
| 3519 | 3504 |
| 3520 | 3505 |
| 3521 MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) { | 3506 MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) { |
| 3522 // ----------- S t a t e ------------- | 3507 // ----------- S t a t e ------------- |
| 3523 // -- r0 : argc | 3508 // -- r0 : argc |
| 3524 // -- r1 : constructor | 3509 // -- r1 : constructor |
| 3525 // -- lr : return address | 3510 // -- lr : return address |
| 3526 // -- [sp] : last argument | 3511 // -- [sp] : last argument |
| 3527 // ----------------------------------- | 3512 // ----------------------------------- |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4663 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 4648 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
| 4664 __ Jump(ic_miss, RelocInfo::CODE_TARGET); | 4649 __ Jump(ic_miss, RelocInfo::CODE_TARGET); |
| 4665 } | 4650 } |
| 4666 | 4651 |
| 4667 | 4652 |
| 4668 #undef __ | 4653 #undef __ |
| 4669 | 4654 |
| 4670 } } // namespace v8::internal | 4655 } } // namespace v8::internal |
| 4671 | 4656 |
| 4672 #endif // V8_TARGET_ARCH_ARM | 4657 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |