OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3187 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 3187 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
3188 ZoneList<Expression*>* args = expr->arguments(); | 3188 ZoneList<Expression*>* args = expr->arguments(); |
3189 int arg_count = args->length(); | 3189 int arg_count = args->length(); |
3190 | 3190 |
3191 SetCallPosition(expr); | 3191 SetCallPosition(expr); |
3192 __ Peek(x1, (arg_count + 1) * kPointerSize); | 3192 __ Peek(x1, (arg_count + 1) * kPointerSize); |
3193 __ Mov(x0, arg_count); | 3193 __ Mov(x0, arg_count); |
3194 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), | 3194 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
3195 RelocInfo::CODE_TARGET); | 3195 RelocInfo::CODE_TARGET); |
3196 OperandStackDepthDecrement(arg_count + 1); | 3196 OperandStackDepthDecrement(arg_count + 1); |
| 3197 |
| 3198 // Restore context register. |
| 3199 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3197 } | 3200 } |
3198 | 3201 |
3199 | 3202 |
3200 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | |
3201 ZoneList<Expression*>* args = expr->arguments(); | |
3202 int arg_count = args->length(); | |
3203 | |
3204 if (expr->is_jsruntime()) { | |
3205 Comment cmnt(masm_, "[ CallRunTime"); | |
3206 EmitLoadJSRuntimeFunction(expr); | |
3207 | |
3208 for (int i = 0; i < arg_count; i++) { | |
3209 VisitForStackValue(args->at(i)); | |
3210 } | |
3211 | |
3212 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3213 EmitCallJSRuntimeFunction(expr); | |
3214 | |
3215 // Restore context register. | |
3216 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
3217 | |
3218 context()->DropAndPlug(1, x0); | |
3219 | |
3220 } else { | |
3221 const Runtime::Function* function = expr->function(); | |
3222 switch (function->function_id) { | |
3223 #define CALL_INTRINSIC_GENERATOR(Name) \ | |
3224 case Runtime::kInline##Name: { \ | |
3225 Comment cmnt(masm_, "[ Inline" #Name); \ | |
3226 return Emit##Name(expr); \ | |
3227 } | |
3228 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) | |
3229 #undef CALL_INTRINSIC_GENERATOR | |
3230 default: { | |
3231 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); | |
3232 // Push the arguments ("left-to-right"). | |
3233 for (int i = 0; i < arg_count; i++) { | |
3234 VisitForStackValue(args->at(i)); | |
3235 } | |
3236 | |
3237 // Call the C runtime function. | |
3238 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3239 __ CallRuntime(expr->function(), arg_count); | |
3240 OperandStackDepthDecrement(arg_count); | |
3241 context()->Plug(x0); | |
3242 } | |
3243 } | |
3244 } | |
3245 } | |
3246 | |
3247 | |
3248 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 3203 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
3249 switch (expr->op()) { | 3204 switch (expr->op()) { |
3250 case Token::DELETE: { | 3205 case Token::DELETE: { |
3251 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 3206 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
3252 Property* property = expr->expression()->AsProperty(); | 3207 Property* property = expr->expression()->AsProperty(); |
3253 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 3208 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
3254 | 3209 |
3255 if (property != NULL) { | 3210 if (property != NULL) { |
3256 VisitForStackValue(property->obj()); | 3211 VisitForStackValue(property->obj()); |
3257 VisitForStackValue(property->key()); | 3212 VisitForStackValue(property->key()); |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4213 } | 4168 } |
4214 | 4169 |
4215 return INTERRUPT; | 4170 return INTERRUPT; |
4216 } | 4171 } |
4217 | 4172 |
4218 | 4173 |
4219 } // namespace internal | 4174 } // namespace internal |
4220 } // namespace v8 | 4175 } // namespace v8 |
4221 | 4176 |
4222 #endif // V8_TARGET_ARCH_ARM64 | 4177 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |