| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // Will clobber 4 registers: object, address, scratch, ip. The | 502 // Will clobber 4 registers: object, address, scratch, ip. The |
| 503 // register 'object' contains a heap object pointer. The heap object | 503 // register 'object' contains a heap object pointer. The heap object |
| 504 // tag is shifted away. | 504 // tag is shifted away. |
| 505 void MacroAssembler::RecordWrite(Register object, | 505 void MacroAssembler::RecordWrite(Register object, |
| 506 Register address, | 506 Register address, |
| 507 Register value, | 507 Register value, |
| 508 LinkRegisterStatus lr_status, | 508 LinkRegisterStatus lr_status, |
| 509 SaveFPRegsMode fp_mode, | 509 SaveFPRegsMode fp_mode, |
| 510 RememberedSetAction remembered_set_action, | 510 RememberedSetAction remembered_set_action, |
| 511 SmiCheck smi_check) { | 511 SmiCheck smi_check) { |
| 512 ASSERT(!object.is(value)); |
| 512 if (emit_debug_code()) { | 513 if (emit_debug_code()) { |
| 513 ldr(ip, MemOperand(address)); | 514 ldr(ip, MemOperand(address)); |
| 514 cmp(ip, value); | 515 cmp(ip, value); |
| 515 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 516 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
| 516 } | 517 } |
| 517 | 518 |
| 518 // Count number of write barriers in generated code. | 519 // Count number of write barriers in generated code. |
| 519 isolate()->counters()->write_barriers_static()->Increment(); | 520 isolate()->counters()->write_barriers_static()->Increment(); |
| 520 // TODO(mstarzinger): Dynamic counter missing. | 521 // TODO(mstarzinger): Dynamic counter missing. |
| 521 | 522 |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 ldr(result, FieldMemOperand(t2, kValueOffset)); | 1633 ldr(result, FieldMemOperand(t2, kValueOffset)); |
| 1633 } | 1634 } |
| 1634 | 1635 |
| 1635 | 1636 |
| 1636 void MacroAssembler::Allocate(int object_size, | 1637 void MacroAssembler::Allocate(int object_size, |
| 1637 Register result, | 1638 Register result, |
| 1638 Register scratch1, | 1639 Register scratch1, |
| 1639 Register scratch2, | 1640 Register scratch2, |
| 1640 Label* gc_required, | 1641 Label* gc_required, |
| 1641 AllocationFlags flags) { | 1642 AllocationFlags flags) { |
| 1642 ASSERT(object_size <= Page::kMaxNonCodeHeapObjectSize); | 1643 ASSERT(object_size <= Page::kMaxRegularHeapObjectSize); |
| 1643 if (!FLAG_inline_new) { | 1644 if (!FLAG_inline_new) { |
| 1644 if (emit_debug_code()) { | 1645 if (emit_debug_code()) { |
| 1645 // Trash the registers to simulate an allocation failure. | 1646 // Trash the registers to simulate an allocation failure. |
| 1646 mov(result, Operand(0x7091)); | 1647 mov(result, Operand(0x7091)); |
| 1647 mov(scratch1, Operand(0x7191)); | 1648 mov(scratch1, Operand(0x7191)); |
| 1648 mov(scratch2, Operand(0x7291)); | 1649 mov(scratch2, Operand(0x7291)); |
| 1649 } | 1650 } |
| 1650 jmp(gc_required); | 1651 jmp(gc_required); |
| 1651 return; | 1652 return; |
| 1652 } | 1653 } |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond); | 2292 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond); |
| 2292 } | 2293 } |
| 2293 | 2294 |
| 2294 | 2295 |
| 2295 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | 2296 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
| 2296 return ref0.address() - ref1.address(); | 2297 return ref0.address() - ref1.address(); |
| 2297 } | 2298 } |
| 2298 | 2299 |
| 2299 | 2300 |
| 2300 void MacroAssembler::CallApiFunctionAndReturn( | 2301 void MacroAssembler::CallApiFunctionAndReturn( |
| 2301 ExternalReference function, | 2302 Register function_address, |
| 2302 Address function_address, | |
| 2303 ExternalReference thunk_ref, | 2303 ExternalReference thunk_ref, |
| 2304 Register thunk_last_arg, | |
| 2305 int stack_space, | 2304 int stack_space, |
| 2306 MemOperand return_value_operand, | 2305 MemOperand return_value_operand, |
| 2307 MemOperand* context_restore_operand) { | 2306 MemOperand* context_restore_operand) { |
| 2308 ExternalReference next_address = | 2307 ExternalReference next_address = |
| 2309 ExternalReference::handle_scope_next_address(isolate()); | 2308 ExternalReference::handle_scope_next_address(isolate()); |
| 2310 const int kNextOffset = 0; | 2309 const int kNextOffset = 0; |
| 2311 const int kLimitOffset = AddressOffset( | 2310 const int kLimitOffset = AddressOffset( |
| 2312 ExternalReference::handle_scope_limit_address(isolate()), | 2311 ExternalReference::handle_scope_limit_address(isolate()), |
| 2313 next_address); | 2312 next_address); |
| 2314 const int kLevelOffset = AddressOffset( | 2313 const int kLevelOffset = AddressOffset( |
| 2315 ExternalReference::handle_scope_level_address(isolate()), | 2314 ExternalReference::handle_scope_level_address(isolate()), |
| 2316 next_address); | 2315 next_address); |
| 2317 | 2316 |
| 2318 ASSERT(!thunk_last_arg.is(r3)); | 2317 ASSERT(function_address.is(r1) || function_address.is(r2)); |
| 2318 |
| 2319 Label profiler_disabled; |
| 2320 Label end_profiler_check; |
| 2321 bool* is_profiling_flag = |
| 2322 isolate()->cpu_profiler()->is_profiling_address(); |
| 2323 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); |
| 2324 mov(r9, Operand(reinterpret_cast<int32_t>(is_profiling_flag))); |
| 2325 ldrb(r9, MemOperand(r9, 0)); |
| 2326 cmp(r9, Operand(0)); |
| 2327 b(eq, &profiler_disabled); |
| 2328 |
| 2329 // Additional parameter is the address of the actual callback. |
| 2330 mov(r3, Operand(thunk_ref)); |
| 2331 jmp(&end_profiler_check); |
| 2332 |
| 2333 bind(&profiler_disabled); |
| 2334 Move(r3, function_address); |
| 2335 bind(&end_profiler_check); |
| 2319 | 2336 |
| 2320 // Allocate HandleScope in callee-save registers. | 2337 // Allocate HandleScope in callee-save registers. |
| 2321 mov(r9, Operand(next_address)); | 2338 mov(r9, Operand(next_address)); |
| 2322 ldr(r4, MemOperand(r9, kNextOffset)); | 2339 ldr(r4, MemOperand(r9, kNextOffset)); |
| 2323 ldr(r5, MemOperand(r9, kLimitOffset)); | 2340 ldr(r5, MemOperand(r9, kLimitOffset)); |
| 2324 ldr(r6, MemOperand(r9, kLevelOffset)); | 2341 ldr(r6, MemOperand(r9, kLevelOffset)); |
| 2325 add(r6, r6, Operand(1)); | 2342 add(r6, r6, Operand(1)); |
| 2326 str(r6, MemOperand(r9, kLevelOffset)); | 2343 str(r6, MemOperand(r9, kLevelOffset)); |
| 2327 | 2344 |
| 2328 if (FLAG_log_timer_events) { | 2345 if (FLAG_log_timer_events) { |
| 2329 FrameScope frame(this, StackFrame::MANUAL); | 2346 FrameScope frame(this, StackFrame::MANUAL); |
| 2330 PushSafepointRegisters(); | 2347 PushSafepointRegisters(); |
| 2331 PrepareCallCFunction(1, r0); | 2348 PrepareCallCFunction(1, r0); |
| 2332 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); | 2349 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); |
| 2333 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); | 2350 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); |
| 2334 PopSafepointRegisters(); | 2351 PopSafepointRegisters(); |
| 2335 } | 2352 } |
| 2336 | 2353 |
| 2337 Label profiler_disabled; | |
| 2338 Label end_profiler_check; | |
| 2339 bool* is_profiling_flag = | |
| 2340 isolate()->cpu_profiler()->is_profiling_address(); | |
| 2341 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); | |
| 2342 mov(r3, Operand(reinterpret_cast<int32_t>(is_profiling_flag))); | |
| 2343 ldrb(r3, MemOperand(r3, 0)); | |
| 2344 cmp(r3, Operand(0)); | |
| 2345 b(eq, &profiler_disabled); | |
| 2346 | |
| 2347 // Additional parameter is the address of the actual callback. | |
| 2348 mov(thunk_last_arg, Operand(reinterpret_cast<int32_t>(function_address))); | |
| 2349 mov(r3, Operand(thunk_ref)); | |
| 2350 jmp(&end_profiler_check); | |
| 2351 | |
| 2352 bind(&profiler_disabled); | |
| 2353 mov(r3, Operand(function)); | |
| 2354 bind(&end_profiler_check); | |
| 2355 | |
| 2356 // Native call returns to the DirectCEntry stub which redirects to the | 2354 // Native call returns to the DirectCEntry stub which redirects to the |
| 2357 // return address pushed on stack (could have moved after GC). | 2355 // return address pushed on stack (could have moved after GC). |
| 2358 // DirectCEntry stub itself is generated early and never moves. | 2356 // DirectCEntry stub itself is generated early and never moves. |
| 2359 DirectCEntryStub stub; | 2357 DirectCEntryStub stub; |
| 2360 stub.GenerateCall(this, r3); | 2358 stub.GenerateCall(this, r3); |
| 2361 | 2359 |
| 2362 if (FLAG_log_timer_events) { | 2360 if (FLAG_log_timer_events) { |
| 2363 FrameScope frame(this, StackFrame::MANUAL); | 2361 FrameScope frame(this, StackFrame::MANUAL); |
| 2364 PushSafepointRegisters(); | 2362 PushSafepointRegisters(); |
| 2365 PrepareCallCFunction(1, r0); | 2363 PrepareCallCFunction(1, r0); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 b(cond, &L); | 2799 b(cond, &L); |
| 2802 Abort(reason); | 2800 Abort(reason); |
| 2803 // will not return here | 2801 // will not return here |
| 2804 bind(&L); | 2802 bind(&L); |
| 2805 } | 2803 } |
| 2806 | 2804 |
| 2807 | 2805 |
| 2808 void MacroAssembler::Abort(BailoutReason reason) { | 2806 void MacroAssembler::Abort(BailoutReason reason) { |
| 2809 Label abort_start; | 2807 Label abort_start; |
| 2810 bind(&abort_start); | 2808 bind(&abort_start); |
| 2811 // We want to pass the msg string like a smi to avoid GC | 2809 #ifdef DEBUG |
| 2812 // problems, however msg is not guaranteed to be aligned | |
| 2813 // properly. Instead, we pass an aligned pointer that is | |
| 2814 // a proper v8 smi, but also pass the alignment difference | |
| 2815 // from the real pointer as a smi. | |
| 2816 const char* msg = GetBailoutReason(reason); | 2810 const char* msg = GetBailoutReason(reason); |
| 2817 intptr_t p1 = reinterpret_cast<intptr_t>(msg); | |
| 2818 intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag; | |
| 2819 ASSERT(reinterpret_cast<Object*>(p0)->IsSmi()); | |
| 2820 #ifdef DEBUG | |
| 2821 if (msg != NULL) { | 2811 if (msg != NULL) { |
| 2822 RecordComment("Abort message: "); | 2812 RecordComment("Abort message: "); |
| 2823 RecordComment(msg); | 2813 RecordComment(msg); |
| 2824 } | 2814 } |
| 2825 | 2815 |
| 2826 if (FLAG_trap_on_abort) { | 2816 if (FLAG_trap_on_abort) { |
| 2827 stop(msg); | 2817 stop(msg); |
| 2828 return; | 2818 return; |
| 2829 } | 2819 } |
| 2830 #endif | 2820 #endif |
| 2831 | 2821 |
| 2832 mov(r0, Operand(p0)); | 2822 mov(r0, Operand(Smi::FromInt(reason))); |
| 2833 push(r0); | 2823 push(r0); |
| 2834 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 2824 |
| 2835 push(r0); | |
| 2836 // Disable stub call restrictions to always allow calls to abort. | 2825 // Disable stub call restrictions to always allow calls to abort. |
| 2837 if (!has_frame_) { | 2826 if (!has_frame_) { |
| 2838 // We don't actually want to generate a pile of code for this, so just | 2827 // We don't actually want to generate a pile of code for this, so just |
| 2839 // claim there is a stack frame, without generating one. | 2828 // claim there is a stack frame, without generating one. |
| 2840 FrameScope scope(this, StackFrame::NONE); | 2829 FrameScope scope(this, StackFrame::NONE); |
| 2841 CallRuntime(Runtime::kAbort, 2); | 2830 CallRuntime(Runtime::kAbort, 1); |
| 2842 } else { | 2831 } else { |
| 2843 CallRuntime(Runtime::kAbort, 2); | 2832 CallRuntime(Runtime::kAbort, 1); |
| 2844 } | 2833 } |
| 2845 // will not return here | 2834 // will not return here |
| 2846 if (is_const_pool_blocked()) { | 2835 if (is_const_pool_blocked()) { |
| 2847 // If the calling code cares about the exact number of | 2836 // If the calling code cares about the exact number of |
| 2848 // instructions generated, we insert padding here to keep the size | 2837 // instructions generated, we insert padding here to keep the size |
| 2849 // of the Abort macro constant. | 2838 // of the Abort macro constant. |
| 2850 static const int kExpectedAbortInstructions = 10; | 2839 static const int kExpectedAbortInstructions = 7; |
| 2851 int abort_instructions = InstructionsGeneratedSince(&abort_start); | 2840 int abort_instructions = InstructionsGeneratedSince(&abort_start); |
| 2852 ASSERT(abort_instructions <= kExpectedAbortInstructions); | 2841 ASSERT(abort_instructions <= kExpectedAbortInstructions); |
| 2853 while (abort_instructions++ < kExpectedAbortInstructions) { | 2842 while (abort_instructions++ < kExpectedAbortInstructions) { |
| 2854 nop(); | 2843 nop(); |
| 2855 } | 2844 } |
| 2856 } | 2845 } |
| 2857 } | 2846 } |
| 2858 | 2847 |
| 2859 | 2848 |
| 2860 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { | 2849 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2894 cmp(map_in_out, ip); | 2883 cmp(map_in_out, ip); |
| 2895 b(ne, no_map_match); | 2884 b(ne, no_map_match); |
| 2896 | 2885 |
| 2897 // Use the transitioned cached map. | 2886 // Use the transitioned cached map. |
| 2898 offset = transitioned_kind * kPointerSize + | 2887 offset = transitioned_kind * kPointerSize + |
| 2899 FixedArrayBase::kHeaderSize; | 2888 FixedArrayBase::kHeaderSize; |
| 2900 ldr(map_in_out, FieldMemOperand(scratch, offset)); | 2889 ldr(map_in_out, FieldMemOperand(scratch, offset)); |
| 2901 } | 2890 } |
| 2902 | 2891 |
| 2903 | 2892 |
| 2904 void MacroAssembler::LoadInitialArrayMap( | |
| 2905 Register function_in, Register scratch, | |
| 2906 Register map_out, bool can_have_holes) { | |
| 2907 ASSERT(!function_in.is(map_out)); | |
| 2908 Label done; | |
| 2909 ldr(map_out, FieldMemOperand(function_in, | |
| 2910 JSFunction::kPrototypeOrInitialMapOffset)); | |
| 2911 if (!FLAG_smi_only_arrays) { | |
| 2912 ElementsKind kind = can_have_holes ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS; | |
| 2913 LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | |
| 2914 kind, | |
| 2915 map_out, | |
| 2916 scratch, | |
| 2917 &done); | |
| 2918 } else if (can_have_holes) { | |
| 2919 LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | |
| 2920 FAST_HOLEY_SMI_ELEMENTS, | |
| 2921 map_out, | |
| 2922 scratch, | |
| 2923 &done); | |
| 2924 } | |
| 2925 bind(&done); | |
| 2926 } | |
| 2927 | |
| 2928 | |
| 2929 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 2893 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
| 2930 // Load the global or builtins object from the current context. | 2894 // Load the global or builtins object from the current context. |
| 2931 ldr(function, | 2895 ldr(function, |
| 2932 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2896 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| 2933 // Load the native context from the global or builtins object. | 2897 // Load the native context from the global or builtins object. |
| 2934 ldr(function, FieldMemOperand(function, | 2898 ldr(function, FieldMemOperand(function, |
| 2935 GlobalObject::kNativeContextOffset)); | 2899 GlobalObject::kNativeContextOffset)); |
| 2936 // Load the function from the native context. | 2900 // Load the function from the native context. |
| 2937 ldr(function, MemOperand(function, Context::SlotOffset(index))); | 2901 ldr(function, MemOperand(function, Context::SlotOffset(index))); |
| 2938 } | 2902 } |
| 2939 | 2903 |
| 2940 | 2904 |
| 2941 void MacroAssembler::LoadArrayFunction(Register function) { | |
| 2942 // Load the global or builtins object from the current context. | |
| 2943 ldr(function, | |
| 2944 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
| 2945 // Load the global context from the global or builtins object. | |
| 2946 ldr(function, | |
| 2947 FieldMemOperand(function, GlobalObject::kGlobalContextOffset)); | |
| 2948 // Load the array function from the native context. | |
| 2949 ldr(function, | |
| 2950 MemOperand(function, Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); | |
| 2951 } | |
| 2952 | |
| 2953 | |
| 2954 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, | 2905 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, |
| 2955 Register map, | 2906 Register map, |
| 2956 Register scratch) { | 2907 Register scratch) { |
| 2957 // Load the initial map. The global functions all have initial maps. | 2908 // Load the initial map. The global functions all have initial maps. |
| 2958 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 2909 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
| 2959 if (emit_debug_code()) { | 2910 if (emit_debug_code()) { |
| 2960 Label ok, fail; | 2911 Label ok, fail; |
| 2961 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, DO_SMI_CHECK); | 2912 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, DO_SMI_CHECK); |
| 2962 b(&ok); | 2913 b(&ok); |
| 2963 bind(&fail); | 2914 bind(&fail); |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 return stack_passed_words; | 3378 return stack_passed_words; |
| 3428 } | 3379 } |
| 3429 | 3380 |
| 3430 | 3381 |
| 3431 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, | 3382 void MacroAssembler::EmitSeqStringSetCharCheck(Register string, |
| 3432 Register index, | 3383 Register index, |
| 3433 Register value, | 3384 Register value, |
| 3434 uint32_t encoding_mask) { | 3385 uint32_t encoding_mask) { |
| 3435 Label is_object; | 3386 Label is_object; |
| 3436 SmiTst(string); | 3387 SmiTst(string); |
| 3437 ThrowIf(eq, kNonObject); | 3388 Check(ne, kNonObject); |
| 3438 | 3389 |
| 3439 ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); | 3390 ldr(ip, FieldMemOperand(string, HeapObject::kMapOffset)); |
| 3440 ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); | 3391 ldrb(ip, FieldMemOperand(ip, Map::kInstanceTypeOffset)); |
| 3441 | 3392 |
| 3442 and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); | 3393 and_(ip, ip, Operand(kStringRepresentationMask | kStringEncodingMask)); |
| 3443 cmp(ip, Operand(encoding_mask)); | 3394 cmp(ip, Operand(encoding_mask)); |
| 3444 ThrowIf(ne, kUnexpectedStringType); | 3395 Check(eq, kUnexpectedStringType); |
| 3445 | 3396 |
| 3446 // The index is assumed to be untagged coming in, tag it to compare with the | 3397 // The index is assumed to be untagged coming in, tag it to compare with the |
| 3447 // string length without using a temp register, it is restored at the end of | 3398 // string length without using a temp register, it is restored at the end of |
| 3448 // this function. | 3399 // this function. |
| 3449 Label index_tag_ok, index_tag_bad; | 3400 Label index_tag_ok, index_tag_bad; |
| 3450 TrySmiTag(index, index, &index_tag_bad); | 3401 TrySmiTag(index, index, &index_tag_bad); |
| 3451 b(&index_tag_ok); | 3402 b(&index_tag_ok); |
| 3452 bind(&index_tag_bad); | 3403 bind(&index_tag_bad); |
| 3453 Throw(kIndexIsTooLarge); | 3404 Abort(kIndexIsTooLarge); |
| 3454 bind(&index_tag_ok); | 3405 bind(&index_tag_ok); |
| 3455 | 3406 |
| 3456 ldr(ip, FieldMemOperand(string, String::kLengthOffset)); | 3407 ldr(ip, FieldMemOperand(string, String::kLengthOffset)); |
| 3457 cmp(index, ip); | 3408 cmp(index, ip); |
| 3458 ThrowIf(ge, kIndexIsTooLarge); | 3409 Check(lt, kIndexIsTooLarge); |
| 3459 | 3410 |
| 3460 cmp(index, Operand(Smi::FromInt(0))); | 3411 cmp(index, Operand(Smi::FromInt(0))); |
| 3461 ThrowIf(lt, kIndexIsNegative); | 3412 Check(ge, kIndexIsNegative); |
| 3462 | 3413 |
| 3463 SmiUntag(index, index); | 3414 SmiUntag(index, index); |
| 3464 } | 3415 } |
| 3465 | 3416 |
| 3466 | 3417 |
| 3467 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, | 3418 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, |
| 3468 int num_double_arguments, | 3419 int num_double_arguments, |
| 3469 Register scratch) { | 3420 Register scratch) { |
| 3470 int frame_alignment = ActivationFrameAlignment(); | 3421 int frame_alignment = ActivationFrameAlignment(); |
| 3471 int stack_passed_arguments = CalculateStackPassedWords( | 3422 int stack_passed_arguments = CalculateStackPassedWords( |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3919 | 3870 |
| 3920 // For all objects but the receiver, check that the cache is empty. | 3871 // For all objects but the receiver, check that the cache is empty. |
| 3921 EnumLength(r3, r1); | 3872 EnumLength(r3, r1); |
| 3922 cmp(r3, Operand(Smi::FromInt(0))); | 3873 cmp(r3, Operand(Smi::FromInt(0))); |
| 3923 b(ne, call_runtime); | 3874 b(ne, call_runtime); |
| 3924 | 3875 |
| 3925 bind(&start); | 3876 bind(&start); |
| 3926 | 3877 |
| 3927 // Check that there are no elements. Register r2 contains the current JS | 3878 // Check that there are no elements. Register r2 contains the current JS |
| 3928 // object we've reached through the prototype chain. | 3879 // object we've reached through the prototype chain. |
| 3880 Label no_elements; |
| 3929 ldr(r2, FieldMemOperand(r2, JSObject::kElementsOffset)); | 3881 ldr(r2, FieldMemOperand(r2, JSObject::kElementsOffset)); |
| 3930 cmp(r2, empty_fixed_array_value); | 3882 cmp(r2, empty_fixed_array_value); |
| 3883 b(eq, &no_elements); |
| 3884 |
| 3885 // Second chance, the object may be using the empty slow element dictionary. |
| 3886 CompareRoot(r2, Heap::kEmptySlowElementDictionaryRootIndex); |
| 3931 b(ne, call_runtime); | 3887 b(ne, call_runtime); |
| 3932 | 3888 |
| 3889 bind(&no_elements); |
| 3933 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); | 3890 ldr(r2, FieldMemOperand(r1, Map::kPrototypeOffset)); |
| 3934 cmp(r2, null_value); | 3891 cmp(r2, null_value); |
| 3935 b(ne, &next); | 3892 b(ne, &next); |
| 3936 } | 3893 } |
| 3937 | 3894 |
| 3938 | 3895 |
| 3939 void MacroAssembler::TestJSArrayForAllocationMemento( | 3896 void MacroAssembler::TestJSArrayForAllocationMemento( |
| 3940 Register receiver_reg, | 3897 Register receiver_reg, |
| 3941 Register scratch_reg, | 3898 Register scratch_reg, |
| 3942 Label* no_memento_found) { | 3899 Label* no_memento_found) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4071 void CodePatcher::EmitCondition(Condition cond) { | 4028 void CodePatcher::EmitCondition(Condition cond) { |
| 4072 Instr instr = Assembler::instr_at(masm_.pc_); | 4029 Instr instr = Assembler::instr_at(masm_.pc_); |
| 4073 instr = (instr & ~kCondMask) | cond; | 4030 instr = (instr & ~kCondMask) | cond; |
| 4074 masm_.emit(instr); | 4031 masm_.emit(instr); |
| 4075 } | 4032 } |
| 4076 | 4033 |
| 4077 | 4034 |
| 4078 } } // namespace v8::internal | 4035 } } // namespace v8::internal |
| 4079 | 4036 |
| 4080 #endif // V8_TARGET_ARCH_ARM | 4037 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |