| 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | 719 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
| 720 Split(equal, if_true, if_false, NULL); | 720 Split(equal, if_true, if_false, NULL); |
| 721 __ bind(&skip); | 721 __ bind(&skip); |
| 722 } | 722 } |
| 723 } | 723 } |
| 724 | 724 |
| 725 | 725 |
| 726 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { | 726 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { |
| 727 // The variable in the declaration always resides in the current context. | 727 // The variable in the declaration always resides in the current context. |
| 728 DCHECK_EQ(0, scope()->ContextChainLength(variable->scope())); | 728 DCHECK_EQ(0, scope()->ContextChainLength(variable->scope())); |
| 729 if (generate_debug_code_) { | 729 if (FLAG_debug_code) { |
| 730 // Check that we're not inside a with or catch context. | 730 // Check that we're not inside a with or catch context. |
| 731 __ movp(rbx, FieldOperand(rsi, HeapObject::kMapOffset)); | 731 __ movp(rbx, FieldOperand(rsi, HeapObject::kMapOffset)); |
| 732 __ CompareRoot(rbx, Heap::kWithContextMapRootIndex); | 732 __ CompareRoot(rbx, Heap::kWithContextMapRootIndex); |
| 733 __ Check(not_equal, kDeclarationInWithContext); | 733 __ Check(not_equal, kDeclarationInWithContext); |
| 734 __ CompareRoot(rbx, Heap::kCatchContextMapRootIndex); | 734 __ CompareRoot(rbx, Heap::kCatchContextMapRootIndex); |
| 735 __ Check(not_equal, kDeclarationInCatchContext); | 735 __ Check(not_equal, kDeclarationInCatchContext); |
| 736 } | 736 } |
| 737 } | 737 } |
| 738 | 738 |
| 739 | 739 |
| (...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 __ Push(var->name()); | 2332 __ Push(var->name()); |
| 2333 __ Push(rax); | 2333 __ Push(rax); |
| 2334 __ CallRuntime(is_strict(language_mode()) | 2334 __ CallRuntime(is_strict(language_mode()) |
| 2335 ? Runtime::kStoreLookupSlot_Strict | 2335 ? Runtime::kStoreLookupSlot_Strict |
| 2336 : Runtime::kStoreLookupSlot_Sloppy); | 2336 : Runtime::kStoreLookupSlot_Sloppy); |
| 2337 } else { | 2337 } else { |
| 2338 // Assignment to var or initializing assignment to let/const in harmony | 2338 // Assignment to var or initializing assignment to let/const in harmony |
| 2339 // mode. | 2339 // mode. |
| 2340 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2340 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2341 MemOperand location = VarOperand(var, rcx); | 2341 MemOperand location = VarOperand(var, rcx); |
| 2342 if (generate_debug_code_ && var->mode() == LET && op == Token::INIT) { | 2342 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { |
| 2343 // Check for an uninitialized let binding. | 2343 // Check for an uninitialized let binding. |
| 2344 __ movp(rdx, location); | 2344 __ movp(rdx, location); |
| 2345 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); | 2345 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); |
| 2346 __ Check(equal, kLetBindingReInitialization); | 2346 __ Check(equal, kLetBindingReInitialization); |
| 2347 } | 2347 } |
| 2348 EmitStoreToStackLocalOrContextSlot(var, location); | 2348 EmitStoreToStackLocalOrContextSlot(var, location); |
| 2349 } | 2349 } |
| 2350 | 2350 |
| 2351 } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { | 2351 } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { |
| 2352 // Const initializers need a write barrier. | 2352 // Const initializers need a write barrier. |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4138 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4138 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4139 Assembler::target_address_at(call_target_address, | 4139 Assembler::target_address_at(call_target_address, |
| 4140 unoptimized_code)); | 4140 unoptimized_code)); |
| 4141 return OSR_AFTER_STACK_CHECK; | 4141 return OSR_AFTER_STACK_CHECK; |
| 4142 } | 4142 } |
| 4143 | 4143 |
| 4144 } // namespace internal | 4144 } // namespace internal |
| 4145 } // namespace v8 | 4145 } // namespace v8 |
| 4146 | 4146 |
| 4147 #endif // V8_TARGET_ARCH_X64 | 4147 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |