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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 418 |
419 SetReturnPosition(literal()); | 419 SetReturnPosition(literal()); |
420 __ leave(); | 420 __ leave(); |
421 | 421 |
422 int arg_count = info_->scope()->num_parameters() + 1; | 422 int arg_count = info_->scope()->num_parameters() + 1; |
423 int arguments_bytes = arg_count * kPointerSize; | 423 int arguments_bytes = arg_count * kPointerSize; |
424 __ Ret(arguments_bytes, rcx); | 424 __ Ret(arguments_bytes, rcx); |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
| 428 void FullCodeGenerator::RestoreContext() { |
| 429 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 430 } |
428 | 431 |
429 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { | 432 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
430 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 433 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
431 MemOperand operand = codegen()->VarOperand(var, result_register()); | 434 MemOperand operand = codegen()->VarOperand(var, result_register()); |
432 codegen()->PushOperand(operand); | 435 codegen()->PushOperand(operand); |
433 } | 436 } |
434 | 437 |
435 | 438 |
436 void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const { | 439 void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const { |
437 } | 440 } |
(...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3617 Label* if_false = NULL; | 3620 Label* if_false = NULL; |
3618 Label* fall_through = NULL; | 3621 Label* fall_through = NULL; |
3619 context()->PrepareTest(&materialize_true, &materialize_false, | 3622 context()->PrepareTest(&materialize_true, &materialize_false, |
3620 &if_true, &if_false, &fall_through); | 3623 &if_true, &if_false, &fall_through); |
3621 | 3624 |
3622 Token::Value op = expr->op(); | 3625 Token::Value op = expr->op(); |
3623 VisitForStackValue(expr->left()); | 3626 VisitForStackValue(expr->left()); |
3624 switch (op) { | 3627 switch (op) { |
3625 case Token::IN: | 3628 case Token::IN: |
3626 VisitForStackValue(expr->right()); | 3629 VisitForStackValue(expr->right()); |
3627 CallRuntimeWithOperands(Runtime::kHasProperty); | 3630 EmitHasProperty(); |
3628 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 3631 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
3629 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | 3632 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
3630 Split(equal, if_true, if_false, fall_through); | 3633 Split(equal, if_true, if_false, fall_through); |
3631 break; | 3634 break; |
3632 | 3635 |
3633 case Token::INSTANCEOF: { | 3636 case Token::INSTANCEOF: { |
3634 VisitForAccumulatorValue(expr->right()); | 3637 VisitForAccumulatorValue(expr->right()); |
3635 PopOperand(rdx); | 3638 PopOperand(rdx); |
3636 InstanceOfStub stub(isolate()); | 3639 InstanceOfStub stub(isolate()); |
3637 __ CallStub(&stub); | 3640 __ CallStub(&stub); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3880 DCHECK_EQ( | 3883 DCHECK_EQ( |
3881 isolate->builtins()->OnStackReplacement()->entry(), | 3884 isolate->builtins()->OnStackReplacement()->entry(), |
3882 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3885 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3883 return ON_STACK_REPLACEMENT; | 3886 return ON_STACK_REPLACEMENT; |
3884 } | 3887 } |
3885 | 3888 |
3886 } // namespace internal | 3889 } // namespace internal |
3887 } // namespace v8 | 3890 } // namespace v8 |
3888 | 3891 |
3889 #endif // V8_TARGET_ARCH_X64 | 3892 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |