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 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3130 // 0 (literal string): The type of logging (corresponds to the flags). | 3130 // 0 (literal string): The type of logging (corresponds to the flags). |
3131 // This is used to determine whether or not to generate the log call. | 3131 // This is used to determine whether or not to generate the log call. |
3132 // 1 (string): Format string. Access the string at argument index 2 | 3132 // 1 (string): Format string. Access the string at argument index 2 |
3133 // with '%2s' (see Logger::LogRuntime for all the formats). | 3133 // with '%2s' (see Logger::LogRuntime for all the formats). |
3134 // 2 (array): Arguments to the format string. | 3134 // 2 (array): Arguments to the format string. |
3135 ZoneList<Expression*>* args = expr->arguments(); | 3135 ZoneList<Expression*>* args = expr->arguments(); |
3136 ASSERT_EQ(args->length(), 3); | 3136 ASSERT_EQ(args->length(), 3); |
3137 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | 3137 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { |
3138 VisitForStackValue(args->at(1)); | 3138 VisitForStackValue(args->at(1)); |
3139 VisitForStackValue(args->at(2)); | 3139 VisitForStackValue(args->at(2)); |
3140 __ CallRuntime(Runtime::kLog, 2); | 3140 __ CallRuntime(Runtime::kLogInternal, 2); |
3141 } | 3141 } |
3142 | 3142 |
3143 // Finally, we're expected to leave a value on the top of the stack. | 3143 // Finally, we're expected to leave a value on the top of the stack. |
3144 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | 3144 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
3145 context()->Plug(x0); | 3145 context()->Plug(x0); |
3146 } | 3146 } |
3147 | 3147 |
3148 | 3148 |
3149 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3149 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3150 // Load the arguments on the stack and call the stub. | 3150 // Load the arguments on the stack and call the stub. |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3591 | 3591 |
3592 // Load the key and data from the cache. | 3592 // Load the key and data from the cache. |
3593 __ Ldp(x2, x3, MemOperand(x3)); | 3593 __ Ldp(x2, x3, MemOperand(x3)); |
3594 | 3594 |
3595 __ Cmp(key, x2); | 3595 __ Cmp(key, x2); |
3596 __ CmovX(x0, x3, eq); | 3596 __ CmovX(x0, x3, eq); |
3597 __ B(eq, &done); | 3597 __ B(eq, &done); |
3598 | 3598 |
3599 // Call runtime to perform the lookup. | 3599 // Call runtime to perform the lookup. |
3600 __ Push(cache, key); | 3600 __ Push(cache, key); |
3601 __ CallRuntime(Runtime::kGetFromCache, 2); | 3601 __ CallRuntime(Runtime::kGetFromCacheInternal, 2); |
3602 | 3602 |
3603 __ Bind(&done); | 3603 __ Bind(&done); |
3604 context()->Plug(x0); | 3604 context()->Plug(x0); |
3605 } | 3605 } |
3606 | 3606 |
3607 | 3607 |
3608 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3608 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3609 ZoneList<Expression*>* args = expr->arguments(); | 3609 ZoneList<Expression*>* args = expr->arguments(); |
3610 VisitForAccumulatorValue(args->at(0)); | 3610 VisitForAccumulatorValue(args->at(0)); |
3611 | 3611 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3849 | 3849 |
3850 __ Bind(&bailout); | 3850 __ Bind(&bailout); |
3851 // Returning undefined will force slower code to handle it. | 3851 // Returning undefined will force slower code to handle it. |
3852 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 3852 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
3853 __ Bind(&done); | 3853 __ Bind(&done); |
3854 context()->Plug(result); | 3854 context()->Plug(result); |
3855 } | 3855 } |
3856 | 3856 |
3857 | 3857 |
3858 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3858 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
3859 Handle<String> name = expr->name(); | 3859 if (expr->function() != NULL && |
3860 if (name->length() > 0 && name->Get(0) == '_') { | 3860 expr->function()->intrinsic_type == Runtime::INLINE ) { |
3861 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3861 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
3862 EmitInlineRuntimeCall(expr); | 3862 EmitInlineRuntimeCall(expr); |
3863 return; | 3863 return; |
3864 } | 3864 } |
3865 | 3865 |
3866 Comment cmnt(masm_, "[ CallRunTime"); | 3866 Comment cmnt(masm_, "[ CallRunTime"); |
3867 ZoneList<Expression*>* args = expr->arguments(); | 3867 ZoneList<Expression*>* args = expr->arguments(); |
3868 int arg_count = args->length(); | 3868 int arg_count = args->length(); |
3869 | 3869 |
3870 if (expr->is_jsruntime()) { | 3870 if (expr->is_jsruntime()) { |
3871 // Push the builtins object as the receiver. | 3871 // Push the builtins object as the receiver. |
3872 __ Ldr(x10, GlobalObjectMemOperand()); | 3872 __ Ldr(x10, GlobalObjectMemOperand()); |
3873 __ Ldr(x0, FieldMemOperand(x10, GlobalObject::kBuiltinsOffset)); | 3873 __ Ldr(x0, FieldMemOperand(x10, GlobalObject::kBuiltinsOffset)); |
3874 __ Push(x0); | 3874 __ Push(x0); |
3875 | 3875 |
3876 // Load the function from the receiver. | 3876 // Load the function from the receiver. |
| 3877 Handle<String> name = expr->name(); |
3877 __ Mov(x2, Operand(name)); | 3878 __ Mov(x2, Operand(name)); |
3878 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 3879 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
3879 | 3880 |
3880 // Push the target function under the receiver. | 3881 // Push the target function under the receiver. |
3881 __ Pop(x10); | 3882 __ Pop(x10); |
3882 __ Push(x0, x10); | 3883 __ Push(x0, x10); |
3883 | 3884 |
3884 int arg_count = args->length(); | 3885 int arg_count = args->length(); |
3885 for (int i = 0; i < arg_count; i++) { | 3886 for (int i = 0; i < arg_count; i++) { |
3886 VisitForStackValue(args->at(i)); | 3887 VisitForStackValue(args->at(i)); |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5005 return previous_; | 5006 return previous_; |
5006 } | 5007 } |
5007 | 5008 |
5008 | 5009 |
5009 #undef __ | 5010 #undef __ |
5010 | 5011 |
5011 | 5012 |
5012 } } // namespace v8::internal | 5013 } } // namespace v8::internal |
5013 | 5014 |
5014 #endif // V8_TARGET_ARCH_ARM64 | 5015 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |