Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 912 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 912 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
| 913 } | 913 } |
| 914 | 914 |
| 915 | 915 |
| 916 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) { | 916 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) { |
| 917 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); | 917 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); |
| 918 } | 918 } |
| 919 | 919 |
| 920 | 920 |
| 921 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { | 921 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { |
| 922 ASM_UNIMPLEMENTED_BREAK("Implement Generate_NotifyOSR"); | 922 // For now, we are relying on the fact that Runtime::NotifyOSR |
| 923 // doesn't do any garbage collection which allows us to save/restore | |
| 924 // the registers without worrying about which of them contain | |
| 925 // pointers. This seems a bit fragile. | |
| 926 // | |
| 927 // TODO(jochen): Is it correct (and appropriate) to use safepoint | |
| 928 // registers here? According to the comment above, we should only need to | |
| 929 // preserve the registers with parameters. | |
| 930 __ PushXRegList(kSafepointSavedRegisters); | |
| 931 { | |
| 932 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 933 __ CallRuntime(Runtime::kNotifyOSR, 0); | |
| 934 } | |
| 935 __ PopXRegList(kSafepointSavedRegisters); | |
| 936 __ Ret(); | |
| 923 } | 937 } |
| 924 | 938 |
| 925 | 939 |
| 926 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 940 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
| 927 ASM_UNIMPLEMENTED_BREAK("Implement Generate_OnStackReplacement"); | 941 // Lookup the function in the JavaScript frame and push it as an |
| 942 // argument to the on-stack replacement function. | |
| 943 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 944 { | |
| 945 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 946 __ Push(x0); | |
| 947 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); | |
|
titzer
2014/01/24 17:04:32
This runtime call no longer returns the AST to ind
| |
| 948 } | |
| 949 | |
| 950 // If the result was -1 it means that we couldn't optimize the | |
| 951 // function. Just return and continue in the unoptimized version. | |
| 952 Label skip; | |
| 953 __ Cmp(x0, Operand(Smi::FromInt(-1))); | |
| 954 __ B(ne, &skip); | |
| 955 __ Ret(); | |
| 956 | |
| 957 __ Bind(&skip); | |
| 958 // Untag the AST id and push it on the stack. | |
| 959 __ SmiUntag(x0); | |
| 960 __ Push(x0); | |
| 961 | |
| 962 // Generate the code for doing the frame-to-frame translation using | |
| 963 // the deoptimizer infrastructure. | |
| 964 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | |
| 965 generator.Generate(); | |
| 928 } | 966 } |
| 929 | 967 |
| 930 | 968 |
| 931 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 969 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
| 932 Register receiver_type = x13; | 970 Register receiver_type = x13; |
| 933 | 971 |
| 934 ASM_LOCATION("Builtins::Generate_FunctionCall"); | 972 ASM_LOCATION("Builtins::Generate_FunctionCall"); |
| 935 // TODO(all/rames): Optimize and use named registers. | 973 // TODO(all/rames): Optimize and use named registers. |
| 936 // 1. Make sure we have at least one argument. | 974 // 1. Make sure we have at least one argument. |
| 937 // x0: actual number of arguments | 975 // x0: actual number of arguments |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1419 __ Bind(&dont_adapt_arguments); | 1457 __ Bind(&dont_adapt_arguments); |
| 1420 __ Jump(x3); | 1458 __ Jump(x3); |
| 1421 } | 1459 } |
| 1422 | 1460 |
| 1423 | 1461 |
| 1424 #undef __ | 1462 #undef __ |
| 1425 | 1463 |
| 1426 } } // namespace v8::internal | 1464 } } // namespace v8::internal |
| 1427 | 1465 |
| 1428 #endif // V8_TARGET_ARCH_ARM | 1466 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |