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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 __ jmp(done); | 1182 __ jmp(done); |
1183 } | 1183 } |
1184 } | 1184 } |
1185 } | 1185 } |
1186 | 1186 |
1187 | 1187 |
1188 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 1188 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
1189 TypeofMode typeof_mode) { | 1189 TypeofMode typeof_mode) { |
1190 #ifdef DEBUG | 1190 #ifdef DEBUG |
1191 Variable* var = proxy->var(); | 1191 Variable* var = proxy->var(); |
1192 DCHECK(var->IsUnallocatedOrGlobalSlot() || | 1192 DCHECK(var->IsUnallocated() || |
1193 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 1193 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
1194 #endif | 1194 #endif |
1195 __ mov(LoadGlobalDescriptor::SlotRegister(), | 1195 __ mov(LoadGlobalDescriptor::SlotRegister(), |
1196 Immediate(SmiFromSlot(proxy->VariableFeedbackSlot()))); | 1196 Immediate(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1197 CallLoadGlobalIC(typeof_mode); | 1197 CallLoadGlobalIC(typeof_mode); |
1198 } | 1198 } |
1199 | 1199 |
1200 | 1200 |
1201 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1201 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
1202 TypeofMode typeof_mode) { | 1202 TypeofMode typeof_mode) { |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2924 CallRuntimeWithOperands(is_strict(language_mode()) | 2924 CallRuntimeWithOperands(is_strict(language_mode()) |
2925 ? Runtime::kDeleteProperty_Strict | 2925 ? Runtime::kDeleteProperty_Strict |
2926 : Runtime::kDeleteProperty_Sloppy); | 2926 : Runtime::kDeleteProperty_Sloppy); |
2927 context()->Plug(eax); | 2927 context()->Plug(eax); |
2928 } else if (proxy != NULL) { | 2928 } else if (proxy != NULL) { |
2929 Variable* var = proxy->var(); | 2929 Variable* var = proxy->var(); |
2930 // Delete of an unqualified identifier is disallowed in strict mode but | 2930 // Delete of an unqualified identifier is disallowed in strict mode but |
2931 // "delete this" is allowed. | 2931 // "delete this" is allowed. |
2932 bool is_this = var->is_this(); | 2932 bool is_this = var->is_this(); |
2933 DCHECK(is_sloppy(language_mode()) || is_this); | 2933 DCHECK(is_sloppy(language_mode()) || is_this); |
2934 if (var->IsUnallocatedOrGlobalSlot()) { | 2934 if (var->IsUnallocated()) { |
2935 __ mov(eax, NativeContextOperand()); | 2935 __ mov(eax, NativeContextOperand()); |
2936 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); | 2936 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); |
2937 __ push(Immediate(var->name())); | 2937 __ push(Immediate(var->name())); |
2938 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2938 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); |
2939 context()->Plug(eax); | 2939 context()->Plug(eax); |
2940 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 2940 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
2941 // Result of deleting non-global variables is false. 'this' is | 2941 // Result of deleting non-global variables is false. 'this' is |
2942 // not really a variable, though we implement it as one. The | 2942 // not really a variable, though we implement it as one. The |
2943 // subexpression does not have side effects. | 2943 // subexpression does not have side effects. |
2944 context()->Plug(is_this); | 2944 context()->Plug(is_this); |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3646 isolate->builtins()->OnStackReplacement()->entry(), | 3646 isolate->builtins()->OnStackReplacement()->entry(), |
3647 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3647 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3648 return ON_STACK_REPLACEMENT; | 3648 return ON_STACK_REPLACEMENT; |
3649 } | 3649 } |
3650 | 3650 |
3651 | 3651 |
3652 } // namespace internal | 3652 } // namespace internal |
3653 } // namespace v8 | 3653 } // namespace v8 |
3654 | 3654 |
3655 #endif // V8_TARGET_ARCH_IA32 | 3655 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |