OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3381 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 3381 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
3382 ZoneList<Expression*>* args = expr->arguments(); | 3382 ZoneList<Expression*>* args = expr->arguments(); |
3383 int arg_count = args->length(); | 3383 int arg_count = args->length(); |
3384 | 3384 |
3385 SetCallPosition(expr); | 3385 SetCallPosition(expr); |
3386 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 3386 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
3387 __ li(a0, Operand(arg_count)); | 3387 __ li(a0, Operand(arg_count)); |
3388 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), | 3388 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
3389 RelocInfo::CODE_TARGET); | 3389 RelocInfo::CODE_TARGET); |
3390 OperandStackDepthDecrement(arg_count + 1); | 3390 OperandStackDepthDecrement(arg_count + 1); |
| 3391 |
| 3392 // Restore context register. |
| 3393 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
3391 } | 3394 } |
3392 | 3395 |
3393 | 3396 |
3394 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | |
3395 ZoneList<Expression*>* args = expr->arguments(); | |
3396 int arg_count = args->length(); | |
3397 | |
3398 if (expr->is_jsruntime()) { | |
3399 Comment cmnt(masm_, "[ CallRuntime"); | |
3400 EmitLoadJSRuntimeFunction(expr); | |
3401 | |
3402 // Push the arguments ("left-to-right"). | |
3403 for (int i = 0; i < arg_count; i++) { | |
3404 VisitForStackValue(args->at(i)); | |
3405 } | |
3406 | |
3407 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3408 EmitCallJSRuntimeFunction(expr); | |
3409 | |
3410 // Restore context register. | |
3411 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
3412 | |
3413 context()->DropAndPlug(1, v0); | |
3414 } else { | |
3415 const Runtime::Function* function = expr->function(); | |
3416 switch (function->function_id) { | |
3417 #define CALL_INTRINSIC_GENERATOR(Name) \ | |
3418 case Runtime::kInline##Name: { \ | |
3419 Comment cmnt(masm_, "[ Inline" #Name); \ | |
3420 return Emit##Name(expr); \ | |
3421 } | |
3422 FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) | |
3423 #undef CALL_INTRINSIC_GENERATOR | |
3424 default: { | |
3425 Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); | |
3426 // Push the arguments ("left-to-right"). | |
3427 for (int i = 0; i < arg_count; i++) { | |
3428 VisitForStackValue(args->at(i)); | |
3429 } | |
3430 | |
3431 // Call the C runtime function. | |
3432 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | |
3433 __ CallRuntime(expr->function(), arg_count); | |
3434 OperandStackDepthDecrement(arg_count); | |
3435 context()->Plug(v0); | |
3436 } | |
3437 } | |
3438 } | |
3439 } | |
3440 | |
3441 | |
3442 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 3397 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
3443 switch (expr->op()) { | 3398 switch (expr->op()) { |
3444 case Token::DELETE: { | 3399 case Token::DELETE: { |
3445 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 3400 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
3446 Property* property = expr->expression()->AsProperty(); | 3401 Property* property = expr->expression()->AsProperty(); |
3447 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 3402 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
3448 | 3403 |
3449 if (property != NULL) { | 3404 if (property != NULL) { |
3450 VisitForStackValue(property->obj()); | 3405 VisitForStackValue(property->obj()); |
3451 VisitForStackValue(property->key()); | 3406 VisitForStackValue(property->key()); |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4168 reinterpret_cast<uint64_t>( | 4123 reinterpret_cast<uint64_t>( |
4169 isolate->builtins()->OnStackReplacement()->entry())); | 4124 isolate->builtins()->OnStackReplacement()->entry())); |
4170 return ON_STACK_REPLACEMENT; | 4125 return ON_STACK_REPLACEMENT; |
4171 } | 4126 } |
4172 | 4127 |
4173 | 4128 |
4174 } // namespace internal | 4129 } // namespace internal |
4175 } // namespace v8 | 4130 } // namespace v8 |
4176 | 4131 |
4177 #endif // V8_TARGET_ARCH_MIPS64 | 4132 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |