| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 __ Check(ne, kDeclarationInCatchContext); | 720 __ Check(ne, kDeclarationInCatchContext); |
| 721 } | 721 } |
| 722 } | 722 } |
| 723 | 723 |
| 724 | 724 |
| 725 void FullCodeGenerator::VisitVariableDeclaration( | 725 void FullCodeGenerator::VisitVariableDeclaration( |
| 726 VariableDeclaration* declaration) { | 726 VariableDeclaration* declaration) { |
| 727 VariableProxy* proxy = declaration->proxy(); | 727 VariableProxy* proxy = declaration->proxy(); |
| 728 Variable* variable = proxy->var(); | 728 Variable* variable = proxy->var(); |
| 729 switch (variable->location()) { | 729 switch (variable->location()) { |
| 730 case VariableLocation::GLOBAL: | |
| 731 case VariableLocation::UNALLOCATED: { | 730 case VariableLocation::UNALLOCATED: { |
| 732 DCHECK(!variable->binding_needs_init()); | 731 DCHECK(!variable->binding_needs_init()); |
| 733 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 732 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 734 DCHECK(!slot.IsInvalid()); | 733 DCHECK(!slot.IsInvalid()); |
| 735 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 734 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 736 globals_->Add(isolate()->factory()->undefined_value(), zone()); | 735 globals_->Add(isolate()->factory()->undefined_value(), zone()); |
| 737 break; | 736 break; |
| 738 } | 737 } |
| 739 case VariableLocation::PARAMETER: | 738 case VariableLocation::PARAMETER: |
| 740 case VariableLocation::LOCAL: | 739 case VariableLocation::LOCAL: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 771 UNREACHABLE(); | 770 UNREACHABLE(); |
| 772 } | 771 } |
| 773 } | 772 } |
| 774 | 773 |
| 775 | 774 |
| 776 void FullCodeGenerator::VisitFunctionDeclaration( | 775 void FullCodeGenerator::VisitFunctionDeclaration( |
| 777 FunctionDeclaration* declaration) { | 776 FunctionDeclaration* declaration) { |
| 778 VariableProxy* proxy = declaration->proxy(); | 777 VariableProxy* proxy = declaration->proxy(); |
| 779 Variable* variable = proxy->var(); | 778 Variable* variable = proxy->var(); |
| 780 switch (variable->location()) { | 779 switch (variable->location()) { |
| 781 case VariableLocation::GLOBAL: | |
| 782 case VariableLocation::UNALLOCATED: { | 780 case VariableLocation::UNALLOCATED: { |
| 783 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); | 781 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
| 784 DCHECK(!slot.IsInvalid()); | 782 DCHECK(!slot.IsInvalid()); |
| 785 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); | 783 globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone()); |
| 786 Handle<SharedFunctionInfo> function = | 784 Handle<SharedFunctionInfo> function = |
| 787 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); | 785 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); |
| 788 // Check for stack-overflow exception. | 786 // Check for stack-overflow exception. |
| 789 if (function.is_null()) return SetStackOverflow(); | 787 if (function.is_null()) return SetStackOverflow(); |
| 790 globals_->Add(function, zone()); | 788 globals_->Add(function, zone()); |
| 791 break; | 789 break; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1242 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1245 TypeofMode typeof_mode) { | 1243 TypeofMode typeof_mode) { |
| 1246 // Record position before possible IC call. | 1244 // Record position before possible IC call. |
| 1247 SetExpressionPosition(proxy); | 1245 SetExpressionPosition(proxy); |
| 1248 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); | 1246 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
| 1249 Variable* var = proxy->var(); | 1247 Variable* var = proxy->var(); |
| 1250 | 1248 |
| 1251 // Three cases: global variables, lookup variables, and all other types of | 1249 // Three cases: global variables, lookup variables, and all other types of |
| 1252 // variables. | 1250 // variables. |
| 1253 switch (var->location()) { | 1251 switch (var->location()) { |
| 1254 case VariableLocation::GLOBAL: | |
| 1255 case VariableLocation::UNALLOCATED: { | 1252 case VariableLocation::UNALLOCATED: { |
| 1256 Comment cmnt(masm_, "[ Global variable"); | 1253 Comment cmnt(masm_, "[ Global variable"); |
| 1257 EmitGlobalVariableLoad(proxy, typeof_mode); | 1254 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1258 context()->Plug(r3); | 1255 context()->Plug(r3); |
| 1259 break; | 1256 break; |
| 1260 } | 1257 } |
| 1261 | 1258 |
| 1262 case VariableLocation::PARAMETER: | 1259 case VariableLocation::PARAMETER: |
| 1263 case VariableLocation::LOCAL: | 1260 case VariableLocation::LOCAL: |
| 1264 case VariableLocation::CONTEXT: { | 1261 case VariableLocation::CONTEXT: { |
| (...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3734 | 3731 |
| 3735 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3732 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3736 | 3733 |
| 3737 DCHECK(interrupt_address == | 3734 DCHECK(interrupt_address == |
| 3738 isolate->builtins()->OnStackReplacement()->entry()); | 3735 isolate->builtins()->OnStackReplacement()->entry()); |
| 3739 return ON_STACK_REPLACEMENT; | 3736 return ON_STACK_REPLACEMENT; |
| 3740 } | 3737 } |
| 3741 } // namespace internal | 3738 } // namespace internal |
| 3742 } // namespace v8 | 3739 } // namespace v8 |
| 3743 #endif // V8_TARGET_ARCH_PPC | 3740 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |