| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 __ cmp(eax, isolate()->factory()->true_value()); | 706 __ cmp(eax, isolate()->factory()->true_value()); |
| 707 Split(equal, if_true, if_false, NULL); | 707 Split(equal, if_true, if_false, NULL); |
| 708 __ bind(&skip); | 708 __ bind(&skip); |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 | 711 |
| 712 | 712 |
| 713 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { | 713 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { |
| 714 // The variable in the declaration always resides in the current context. | 714 // The variable in the declaration always resides in the current context. |
| 715 DCHECK_EQ(0, scope()->ContextChainLength(variable->scope())); | 715 DCHECK_EQ(0, scope()->ContextChainLength(variable->scope())); |
| 716 if (generate_debug_code_) { | 716 if (FLAG_debug_code) { |
| 717 // Check that we're not inside a with or catch context. | 717 // Check that we're not inside a with or catch context. |
| 718 __ mov(ebx, FieldOperand(esi, HeapObject::kMapOffset)); | 718 __ mov(ebx, FieldOperand(esi, HeapObject::kMapOffset)); |
| 719 __ cmp(ebx, isolate()->factory()->with_context_map()); | 719 __ cmp(ebx, isolate()->factory()->with_context_map()); |
| 720 __ Check(not_equal, kDeclarationInWithContext); | 720 __ Check(not_equal, kDeclarationInWithContext); |
| 721 __ cmp(ebx, isolate()->factory()->catch_context_map()); | 721 __ cmp(ebx, isolate()->factory()->catch_context_map()); |
| 722 __ Check(not_equal, kDeclarationInCatchContext); | 722 __ Check(not_equal, kDeclarationInCatchContext); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 | 726 |
| (...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2339 __ Push(Immediate(var->name())); | 2339 __ Push(Immediate(var->name())); |
| 2340 __ Push(eax); | 2340 __ Push(eax); |
| 2341 __ CallRuntime(is_strict(language_mode()) | 2341 __ CallRuntime(is_strict(language_mode()) |
| 2342 ? Runtime::kStoreLookupSlot_Strict | 2342 ? Runtime::kStoreLookupSlot_Strict |
| 2343 : Runtime::kStoreLookupSlot_Sloppy); | 2343 : Runtime::kStoreLookupSlot_Sloppy); |
| 2344 } else { | 2344 } else { |
| 2345 // Assignment to var or initializing assignment to let/const in harmony | 2345 // Assignment to var or initializing assignment to let/const in harmony |
| 2346 // mode. | 2346 // mode. |
| 2347 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2347 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2348 MemOperand location = VarOperand(var, ecx); | 2348 MemOperand location = VarOperand(var, ecx); |
| 2349 if (generate_debug_code_ && var->mode() == LET && op == Token::INIT) { | 2349 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { |
| 2350 // Check for an uninitialized let binding. | 2350 // Check for an uninitialized let binding. |
| 2351 __ mov(edx, location); | 2351 __ mov(edx, location); |
| 2352 __ cmp(edx, isolate()->factory()->the_hole_value()); | 2352 __ cmp(edx, isolate()->factory()->the_hole_value()); |
| 2353 __ Check(equal, kLetBindingReInitialization); | 2353 __ Check(equal, kLetBindingReInitialization); |
| 2354 } | 2354 } |
| 2355 EmitStoreToStackLocalOrContextSlot(var, location); | 2355 EmitStoreToStackLocalOrContextSlot(var, location); |
| 2356 } | 2356 } |
| 2357 | 2357 |
| 2358 } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { | 2358 } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { |
| 2359 // Const initializers need a write barrier. | 2359 // Const initializers need a write barrier. |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4150 Assembler::target_address_at(call_target_address, | 4150 Assembler::target_address_at(call_target_address, |
| 4151 unoptimized_code)); | 4151 unoptimized_code)); |
| 4152 return OSR_AFTER_STACK_CHECK; | 4152 return OSR_AFTER_STACK_CHECK; |
| 4153 } | 4153 } |
| 4154 | 4154 |
| 4155 | 4155 |
| 4156 } // namespace internal | 4156 } // namespace internal |
| 4157 } // namespace v8 | 4157 } // namespace v8 |
| 4158 | 4158 |
| 4159 #endif // V8_TARGET_ARCH_X87 | 4159 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |