| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 | 1526 |
| 1527 case Variable::LOOKUP: { | 1527 case Variable::LOOKUP: { |
| 1528 Comment cmnt(masm_, "[ Lookup slot"); | 1528 Comment cmnt(masm_, "[ Lookup slot"); |
| 1529 Label done, slow; | 1529 Label done, slow; |
| 1530 // Generate code for loading from variables potentially shadowed | 1530 // Generate code for loading from variables potentially shadowed |
| 1531 // by eval-introduced variables. | 1531 // by eval-introduced variables. |
| 1532 EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done); | 1532 EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done); |
| 1533 __ bind(&slow); | 1533 __ bind(&slow); |
| 1534 __ Push(rsi); // Context. | 1534 __ Push(rsi); // Context. |
| 1535 __ Push(var->name()); | 1535 __ Push(var->name()); |
| 1536 __ CallRuntime(Runtime::kLoadContextSlot, 2); | 1536 __ CallRuntime(Runtime::kLoadLookupSlot, 2); |
| 1537 __ bind(&done); | 1537 __ bind(&done); |
| 1538 context()->Plug(rax); | 1538 context()->Plug(rax); |
| 1539 break; | 1539 break; |
| 1540 } | 1540 } |
| 1541 } | 1541 } |
| 1542 } | 1542 } |
| 1543 | 1543 |
| 1544 | 1544 |
| 1545 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { | 1545 void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
| 1546 Comment cmnt(masm_, "[ RegExpLiteral"); | 1546 Comment cmnt(masm_, "[ RegExpLiteral"); |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 { PreservePositionScope scope(masm()->positions_recorder()); | 2676 { PreservePositionScope scope(masm()->positions_recorder()); |
| 2677 // Generate code for loading from variables potentially shadowed by | 2677 // Generate code for loading from variables potentially shadowed by |
| 2678 // eval-introduced variables. | 2678 // eval-introduced variables. |
| 2679 EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow, &done); | 2679 EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow, &done); |
| 2680 } | 2680 } |
| 2681 __ bind(&slow); | 2681 __ bind(&slow); |
| 2682 // Call the runtime to find the function to call (returned in rax) and | 2682 // Call the runtime to find the function to call (returned in rax) and |
| 2683 // the object holding it (returned in rdx). | 2683 // the object holding it (returned in rdx). |
| 2684 __ Push(context_register()); | 2684 __ Push(context_register()); |
| 2685 __ Push(proxy->name()); | 2685 __ Push(proxy->name()); |
| 2686 __ CallRuntime(Runtime::kLoadContextSlot, 2); | 2686 __ CallRuntime(Runtime::kLoadLookupSlot, 2); |
| 2687 __ Push(rax); // Function. | 2687 __ Push(rax); // Function. |
| 2688 __ Push(rdx); // Receiver. | 2688 __ Push(rdx); // Receiver. |
| 2689 | 2689 |
| 2690 // If fast case code has been generated, emit code to push the function | 2690 // If fast case code has been generated, emit code to push the function |
| 2691 // and receiver and have the slow path jump around this code. | 2691 // and receiver and have the slow path jump around this code. |
| 2692 if (done.is_linked()) { | 2692 if (done.is_linked()) { |
| 2693 Label call; | 2693 Label call; |
| 2694 __ jmp(&call, Label::kNear); | 2694 __ jmp(&call, Label::kNear); |
| 2695 __ bind(&done); | 2695 __ bind(&done); |
| 2696 // Push function. | 2696 // Push function. |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4097 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 4097 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
| 4098 // Result of deleting non-global variables is false. 'this' is | 4098 // Result of deleting non-global variables is false. 'this' is |
| 4099 // not really a variable, though we implement it as one. The | 4099 // not really a variable, though we implement it as one. The |
| 4100 // subexpression does not have side effects. | 4100 // subexpression does not have side effects. |
| 4101 context()->Plug(var->is_this()); | 4101 context()->Plug(var->is_this()); |
| 4102 } else { | 4102 } else { |
| 4103 // Non-global variable. Call the runtime to try to delete from the | 4103 // Non-global variable. Call the runtime to try to delete from the |
| 4104 // context where the variable was introduced. | 4104 // context where the variable was introduced. |
| 4105 __ Push(context_register()); | 4105 __ Push(context_register()); |
| 4106 __ Push(var->name()); | 4106 __ Push(var->name()); |
| 4107 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | 4107 __ CallRuntime(Runtime::kDeleteLookupSlot, 2); |
| 4108 context()->Plug(rax); | 4108 context()->Plug(rax); |
| 4109 } | 4109 } |
| 4110 } else { | 4110 } else { |
| 4111 // Result of deleting non-property, non-variable reference is true. | 4111 // Result of deleting non-property, non-variable reference is true. |
| 4112 // The subexpression may have side effects. | 4112 // The subexpression may have side effects. |
| 4113 VisitForEffect(expr->expression()); | 4113 VisitForEffect(expr->expression()); |
| 4114 context()->Plug(true); | 4114 context()->Plug(true); |
| 4115 } | 4115 } |
| 4116 break; | 4116 break; |
| 4117 } | 4117 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4386 Comment cmnt(masm_, "[ Lookup slot"); | 4386 Comment cmnt(masm_, "[ Lookup slot"); |
| 4387 Label done, slow; | 4387 Label done, slow; |
| 4388 | 4388 |
| 4389 // Generate code for loading from variables potentially shadowed | 4389 // Generate code for loading from variables potentially shadowed |
| 4390 // by eval-introduced variables. | 4390 // by eval-introduced variables. |
| 4391 EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done); | 4391 EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done); |
| 4392 | 4392 |
| 4393 __ bind(&slow); | 4393 __ bind(&slow); |
| 4394 __ Push(rsi); | 4394 __ Push(rsi); |
| 4395 __ Push(proxy->name()); | 4395 __ Push(proxy->name()); |
| 4396 __ CallRuntime(Runtime::kLoadContextSlotNoReferenceError, 2); | 4396 __ CallRuntime(Runtime::kLoadLookupSlotNoReferenceError, 2); |
| 4397 PrepareForBailout(expr, TOS_REG); | 4397 PrepareForBailout(expr, TOS_REG); |
| 4398 __ bind(&done); | 4398 __ bind(&done); |
| 4399 | 4399 |
| 4400 context()->Plug(rax); | 4400 context()->Plug(rax); |
| 4401 } else { | 4401 } else { |
| 4402 // This expression cannot throw a reference error at the top level. | 4402 // This expression cannot throw a reference error at the top level. |
| 4403 VisitInDuplicateContext(expr); | 4403 VisitInDuplicateContext(expr); |
| 4404 } | 4404 } |
| 4405 } | 4405 } |
| 4406 | 4406 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4806 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4806 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4807 Assembler::target_address_at(call_target_address, | 4807 Assembler::target_address_at(call_target_address, |
| 4808 unoptimized_code)); | 4808 unoptimized_code)); |
| 4809 return OSR_AFTER_STACK_CHECK; | 4809 return OSR_AFTER_STACK_CHECK; |
| 4810 } | 4810 } |
| 4811 | 4811 |
| 4812 | 4812 |
| 4813 } } // namespace v8::internal | 4813 } } // namespace v8::internal |
| 4814 | 4814 |
| 4815 #endif // V8_TARGET_ARCH_X64 | 4815 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |