| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // Checking whether the queued function is ready for install is optional, | 319 // Checking whether the queued function is ready for install is optional, |
| 320 // since we come across interrupts and stack checks elsewhere. However, | 320 // since we come across interrupts and stack checks elsewhere. However, |
| 321 // not checking may delay installing ready functions, and always checking | 321 // not checking may delay installing ready functions, and always checking |
| 322 // would be quite expensive. A good compromise is to first check against | 322 // would be quite expensive. A good compromise is to first check against |
| 323 // stack limit as a cue for an interrupt signal. | 323 // stack limit as a cue for an interrupt signal. |
| 324 Label ok; | 324 Label ok; |
| 325 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 325 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 326 __ cmp(sp, Operand(ip)); | 326 __ cmp(sp, Operand(ip)); |
| 327 __ b(hs, &ok); | 327 __ b(hs, &ok); |
| 328 | 328 |
| 329 CallRuntimePassFunction(masm, Runtime::kTryInstallOptimizedCode); | 329 CallRuntimePassFunction(masm, Runtime::kHiddenTryInstallOptimizedCode); |
| 330 GenerateTailCallToReturnedCode(masm); | 330 GenerateTailCallToReturnedCode(masm); |
| 331 | 331 |
| 332 __ bind(&ok); | 332 __ bind(&ok); |
| 333 GenerateTailCallToSharedCode(masm); | 333 GenerateTailCallToSharedCode(masm); |
| 334 } | 334 } |
| 335 | 335 |
| 336 | 336 |
| 337 static void Generate_JSConstructStubHelper(MacroAssembler* masm, | 337 static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
| 338 bool is_api_function, | 338 bool is_api_function, |
| 339 bool count_constructions, | 339 bool count_constructions, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 FieldMemOperand(r3, SharedFunctionInfo::kConstructionCountOffset); | 408 FieldMemOperand(r3, SharedFunctionInfo::kConstructionCountOffset); |
| 409 __ ldrb(r4, constructor_count); | 409 __ ldrb(r4, constructor_count); |
| 410 __ sub(r4, r4, Operand(1), SetCC); | 410 __ sub(r4, r4, Operand(1), SetCC); |
| 411 __ strb(r4, constructor_count); | 411 __ strb(r4, constructor_count); |
| 412 __ b(ne, &allocate); | 412 __ b(ne, &allocate); |
| 413 | 413 |
| 414 __ push(r1); | 414 __ push(r1); |
| 415 | 415 |
| 416 __ Push(r2, r1); // r1 = constructor | 416 __ Push(r2, r1); // r1 = constructor |
| 417 // The call will replace the stub, so the countdown is only done once. | 417 // The call will replace the stub, so the countdown is only done once. |
| 418 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); | 418 __ CallRuntime(Runtime::kHiddenFinalizeInstanceSize, 1); |
| 419 | 419 |
| 420 __ pop(r2); | 420 __ pop(r2); |
| 421 __ pop(r1); | 421 __ pop(r1); |
| 422 | 422 |
| 423 __ bind(&allocate); | 423 __ bind(&allocate); |
| 424 } | 424 } |
| 425 | 425 |
| 426 // Now allocate the JSObject on the heap. | 426 // Now allocate the JSObject on the heap. |
| 427 // r1: constructor function | 427 // r1: constructor function |
| 428 // r2: initial map | 428 // r2: initial map |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // r1: constructor function | 591 // r1: constructor function |
| 592 __ bind(&rt_call); | 592 __ bind(&rt_call); |
| 593 if (create_memento) { | 593 if (create_memento) { |
| 594 // Get the cell or allocation site. | 594 // Get the cell or allocation site. |
| 595 __ ldr(r2, MemOperand(sp, 2 * kPointerSize)); | 595 __ ldr(r2, MemOperand(sp, 2 * kPointerSize)); |
| 596 __ push(r2); | 596 __ push(r2); |
| 597 } | 597 } |
| 598 | 598 |
| 599 __ push(r1); // argument for Runtime_NewObject | 599 __ push(r1); // argument for Runtime_NewObject |
| 600 if (create_memento) { | 600 if (create_memento) { |
| 601 __ CallRuntime(Runtime::kNewObjectWithAllocationSite, 2); | 601 __ CallRuntime(Runtime::kHiddenNewObjectWithAllocationSite, 2); |
| 602 } else { | 602 } else { |
| 603 __ CallRuntime(Runtime::kNewObject, 1); | 603 __ CallRuntime(Runtime::kHiddenNewObject, 1); |
| 604 } | 604 } |
| 605 __ mov(r4, r0); | 605 __ mov(r4, r0); |
| 606 | 606 |
| 607 // If we ended up using the runtime, and we want a memento, then the | 607 // If we ended up using the runtime, and we want a memento, then the |
| 608 // runtime call made it for us, and we shouldn't do create count | 608 // runtime call made it for us, and we shouldn't do create count |
| 609 // increment. | 609 // increment. |
| 610 Label count_incremented; | 610 Label count_incremented; |
| 611 if (create_memento) { | 611 if (create_memento) { |
| 612 __ jmp(&count_incremented); | 612 __ jmp(&count_incremented); |
| 613 } | 613 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 Generate_JSEntryTrampolineHelper(masm, false); | 827 Generate_JSEntryTrampolineHelper(masm, false); |
| 828 } | 828 } |
| 829 | 829 |
| 830 | 830 |
| 831 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { | 831 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
| 832 Generate_JSEntryTrampolineHelper(masm, true); | 832 Generate_JSEntryTrampolineHelper(masm, true); |
| 833 } | 833 } |
| 834 | 834 |
| 835 | 835 |
| 836 void Builtins::Generate_CompileUnoptimized(MacroAssembler* masm) { | 836 void Builtins::Generate_CompileUnoptimized(MacroAssembler* masm) { |
| 837 CallRuntimePassFunction(masm, Runtime::kCompileUnoptimized); | 837 CallRuntimePassFunction(masm, Runtime::kHiddenCompileUnoptimized); |
| 838 GenerateTailCallToReturnedCode(masm); | 838 GenerateTailCallToReturnedCode(masm); |
| 839 } | 839 } |
| 840 | 840 |
| 841 | 841 |
| 842 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | 842 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { |
| 843 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 843 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 844 // Push a copy of the function onto the stack. | 844 // Push a copy of the function onto the stack. |
| 845 __ push(r1); | 845 __ push(r1); |
| 846 // Push function as parameter to the runtime call. | 846 // Push function as parameter to the runtime call. |
| 847 __ Push(r1); | 847 __ Push(r1); |
| 848 // Whether to compile in a background thread. | 848 // Whether to compile in a background thread. |
| 849 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); | 849 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); |
| 850 | 850 |
| 851 __ CallRuntime(Runtime::kCompileOptimized, 2); | 851 __ CallRuntime(Runtime::kHiddenCompileOptimized, 2); |
| 852 // Restore receiver. | 852 // Restore receiver. |
| 853 __ pop(r1); | 853 __ pop(r1); |
| 854 } | 854 } |
| 855 | 855 |
| 856 | 856 |
| 857 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 857 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
| 858 CallCompileOptimized(masm, false); | 858 CallCompileOptimized(masm, false); |
| 859 GenerateTailCallToReturnedCode(masm); | 859 GenerateTailCallToReturnedCode(masm); |
| 860 } | 860 } |
| 861 | 861 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm, | 936 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm, |
| 937 SaveFPRegsMode save_doubles) { | 937 SaveFPRegsMode save_doubles) { |
| 938 { | 938 { |
| 939 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 939 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 940 | 940 |
| 941 // Preserve registers across notification, this is important for compiled | 941 // Preserve registers across notification, this is important for compiled |
| 942 // stubs that tail call the runtime on deopts passing their parameters in | 942 // stubs that tail call the runtime on deopts passing their parameters in |
| 943 // registers. | 943 // registers. |
| 944 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved); | 944 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved); |
| 945 // Pass the function and deoptimization type to the runtime system. | 945 // Pass the function and deoptimization type to the runtime system. |
| 946 __ CallRuntime(Runtime::kNotifyStubFailure, 0, save_doubles); | 946 __ CallRuntime(Runtime::kHiddenNotifyStubFailure, 0, save_doubles); |
| 947 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved); | 947 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved); |
| 948 } | 948 } |
| 949 | 949 |
| 950 __ add(sp, sp, Operand(kPointerSize)); // Ignore state | 950 __ add(sp, sp, Operand(kPointerSize)); // Ignore state |
| 951 __ mov(pc, lr); // Jump to miss handler | 951 __ mov(pc, lr); // Jump to miss handler |
| 952 } | 952 } |
| 953 | 953 |
| 954 | 954 |
| 955 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { | 955 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
| 956 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); | 956 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); |
| 957 } | 957 } |
| 958 | 958 |
| 959 | 959 |
| 960 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { | 960 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
| 961 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); | 961 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
| 962 } | 962 } |
| 963 | 963 |
| 964 | 964 |
| 965 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 965 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| 966 Deoptimizer::BailoutType type) { | 966 Deoptimizer::BailoutType type) { |
| 967 { | 967 { |
| 968 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 968 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 969 // Pass the function and deoptimization type to the runtime system. | 969 // Pass the function and deoptimization type to the runtime system. |
| 970 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); | 970 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); |
| 971 __ push(r0); | 971 __ push(r0); |
| 972 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 972 __ CallRuntime(Runtime::kHiddenNotifyDeoptimized, 1); |
| 973 } | 973 } |
| 974 | 974 |
| 975 // Get the full codegen state from the stack and untag it -> r6. | 975 // Get the full codegen state from the stack and untag it -> r6. |
| 976 __ ldr(r6, MemOperand(sp, 0 * kPointerSize)); | 976 __ ldr(r6, MemOperand(sp, 0 * kPointerSize)); |
| 977 __ SmiUntag(r6); | 977 __ SmiUntag(r6); |
| 978 // Switch on the state. | 978 // Switch on the state. |
| 979 Label with_tos_register, unknown_state; | 979 Label with_tos_register, unknown_state; |
| 980 __ cmp(r6, Operand(FullCodeGenerator::NO_REGISTERS)); | 980 __ cmp(r6, Operand(FullCodeGenerator::NO_REGISTERS)); |
| 981 __ b(ne, &with_tos_register); | 981 __ b(ne, &with_tos_register); |
| 982 __ add(sp, sp, Operand(1 * kPointerSize)); // Remove state. | 982 __ add(sp, sp, Operand(1 * kPointerSize)); // Remove state. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 1053 |
| 1054 | 1054 |
| 1055 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | 1055 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
| 1056 // We check the stack limit as indicator that recompilation might be done. | 1056 // We check the stack limit as indicator that recompilation might be done. |
| 1057 Label ok; | 1057 Label ok; |
| 1058 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 1058 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 1059 __ cmp(sp, Operand(ip)); | 1059 __ cmp(sp, Operand(ip)); |
| 1060 __ b(hs, &ok); | 1060 __ b(hs, &ok); |
| 1061 { | 1061 { |
| 1062 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1062 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 1063 __ CallRuntime(Runtime::kStackGuard, 0); | 1063 __ CallRuntime(Runtime::kHiddenStackGuard, 0); |
| 1064 } | 1064 } |
| 1065 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), | 1065 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
| 1066 RelocInfo::CODE_TARGET); | 1066 RelocInfo::CODE_TARGET); |
| 1067 | 1067 |
| 1068 __ bind(&ok); | 1068 __ bind(&ok); |
| 1069 __ Ret(); | 1069 __ Ret(); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 | 1072 |
| 1073 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 1073 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 __ bind(&dont_adapt_arguments); | 1546 __ bind(&dont_adapt_arguments); |
| 1547 __ Jump(r3); | 1547 __ Jump(r3); |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 | 1550 |
| 1551 #undef __ | 1551 #undef __ |
| 1552 | 1552 |
| 1553 } } // namespace v8::internal | 1553 } } // namespace v8::internal |
| 1554 | 1554 |
| 1555 #endif // V8_TARGET_ARCH_ARM | 1555 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |