| 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/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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Possibly allocate a local context. | 175 // Possibly allocate a local context. |
| 176 if (info->scope()->num_heap_slots() > 0) { | 176 if (info->scope()->num_heap_slots() > 0) { |
| 177 // Argument to NewContext is the function, which is still in r4. | 177 // Argument to NewContext is the function, which is still in r4. |
| 178 Comment cmnt(masm_, "[ Allocate context"); | 178 Comment cmnt(masm_, "[ Allocate context"); |
| 179 bool need_write_barrier = true; | 179 bool need_write_barrier = true; |
| 180 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 180 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 181 if (info->scope()->is_script_scope()) { | 181 if (info->scope()->is_script_scope()) { |
| 182 __ push(r4); | 182 __ push(r4); |
| 183 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 183 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
| 184 __ CallRuntime(Runtime::kNewScriptContext); | 184 __ CallRuntime(Runtime::kNewScriptContext); |
| 185 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG); | 185 PrepareForBailoutForId(BailoutId::ScriptContext(), |
| 186 BailoutState::TOS_REGISTER); |
| 186 // The new target value is not used, clobbering is safe. | 187 // The new target value is not used, clobbering is safe. |
| 187 DCHECK_NULL(info->scope()->new_target_var()); | 188 DCHECK_NULL(info->scope()->new_target_var()); |
| 188 } else { | 189 } else { |
| 189 if (info->scope()->new_target_var() != nullptr) { | 190 if (info->scope()->new_target_var() != nullptr) { |
| 190 __ push(r6); // Preserve new target. | 191 __ push(r6); // Preserve new target. |
| 191 } | 192 } |
| 192 if (slots <= FastNewContextStub::kMaximumSlots) { | 193 if (slots <= FastNewContextStub::kMaximumSlots) { |
| 193 FastNewContextStub stub(isolate(), slots); | 194 FastNewContextStub stub(isolate(), slots); |
| 194 __ CallStub(&stub); | 195 __ CallStub(&stub); |
| 195 // Result of FastNewContextStub is always in new space. | 196 // Result of FastNewContextStub is always in new space. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 __ Abort(kExpectedNewSpaceObject); | 232 __ Abort(kExpectedNewSpaceObject); |
| 232 __ bind(&done); | 233 __ bind(&done); |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 } | 236 } |
| 236 } | 237 } |
| 237 | 238 |
| 238 // Register holding this function and new target are both trashed in case we | 239 // Register holding this function and new target are both trashed in case we |
| 239 // bailout here. But since that can happen only when new target is not used | 240 // bailout here. But since that can happen only when new target is not used |
| 240 // and we allocate a context, the value of |function_in_register| is correct. | 241 // and we allocate a context, the value of |function_in_register| is correct. |
| 241 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS); | 242 PrepareForBailoutForId(BailoutId::FunctionContext(), |
| 243 BailoutState::NO_REGISTERS); |
| 242 | 244 |
| 243 // Possibly set up a local binding to the this function which is used in | 245 // Possibly set up a local binding to the this function which is used in |
| 244 // derived constructors with super calls. | 246 // derived constructors with super calls. |
| 245 Variable* this_function_var = scope()->this_function_var(); | 247 Variable* this_function_var = scope()->this_function_var(); |
| 246 if (this_function_var != nullptr) { | 248 if (this_function_var != nullptr) { |
| 247 Comment cmnt(masm_, "[ This function"); | 249 Comment cmnt(masm_, "[ This function"); |
| 248 if (!function_in_register_r4) { | 250 if (!function_in_register_r4) { |
| 249 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 251 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 250 // The write barrier clobbers register again, keep it marked as such. | 252 // The write barrier clobbers register again, keep it marked as such. |
| 251 } | 253 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 295 } |
| 294 | 296 |
| 295 SetVar(arguments, r3, r4, r5); | 297 SetVar(arguments, r3, r4, r5); |
| 296 } | 298 } |
| 297 | 299 |
| 298 if (FLAG_trace) { | 300 if (FLAG_trace) { |
| 299 __ CallRuntime(Runtime::kTraceEnter); | 301 __ CallRuntime(Runtime::kTraceEnter); |
| 300 } | 302 } |
| 301 | 303 |
| 302 // Visit the declarations and body. | 304 // Visit the declarations and body. |
| 303 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 305 PrepareForBailoutForId(BailoutId::FunctionEntry(), |
| 306 BailoutState::NO_REGISTERS); |
| 304 { | 307 { |
| 305 Comment cmnt(masm_, "[ Declarations"); | 308 Comment cmnt(masm_, "[ Declarations"); |
| 306 VisitDeclarations(scope()->declarations()); | 309 VisitDeclarations(scope()->declarations()); |
| 307 } | 310 } |
| 308 | 311 |
| 309 // Assert that the declarations do not use ICs. Otherwise the debugger | 312 // Assert that the declarations do not use ICs. Otherwise the debugger |
| 310 // won't be able to redirect a PC at an IC to the correct IC in newly | 313 // won't be able to redirect a PC at an IC to the correct IC in newly |
| 311 // recompiled code. | 314 // recompiled code. |
| 312 DCHECK_EQ(0, ic_total_count_); | 315 DCHECK_EQ(0, ic_total_count_); |
| 313 | 316 |
| 314 { | 317 { |
| 315 Comment cmnt(masm_, "[ Stack check"); | 318 Comment cmnt(masm_, "[ Stack check"); |
| 316 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 319 PrepareForBailoutForId(BailoutId::Declarations(), |
| 320 BailoutState::NO_REGISTERS); |
| 317 Label ok; | 321 Label ok; |
| 318 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 322 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 319 __ cmpl(sp, ip); | 323 __ cmpl(sp, ip); |
| 320 __ bc_short(ge, &ok); | 324 __ bc_short(ge, &ok); |
| 321 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 325 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
| 322 __ bind(&ok); | 326 __ bind(&ok); |
| 323 } | 327 } |
| 324 | 328 |
| 325 { | 329 { |
| 326 Comment cmnt(masm_, "[ Body"); | 330 Comment cmnt(masm_, "[ Body"); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); | 387 __ Call(isolate()->builtins()->InterruptCheck(), RelocInfo::CODE_TARGET); |
| 384 | 388 |
| 385 // Record a mapping of this PC offset to the OSR id. This is used to find | 389 // Record a mapping of this PC offset to the OSR id. This is used to find |
| 386 // the AST id from the unoptimized code in order to use it as a key into | 390 // the AST id from the unoptimized code in order to use it as a key into |
| 387 // the deoptimization input data found in the optimized code. | 391 // the deoptimization input data found in the optimized code. |
| 388 RecordBackEdge(stmt->OsrEntryId()); | 392 RecordBackEdge(stmt->OsrEntryId()); |
| 389 } | 393 } |
| 390 EmitProfilingCounterReset(); | 394 EmitProfilingCounterReset(); |
| 391 | 395 |
| 392 __ bind(&ok); | 396 __ bind(&ok); |
| 393 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 397 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
| 394 // Record a mapping of the OSR id to this PC. This is used if the OSR | 398 // Record a mapping of the OSR id to this PC. This is used if the OSR |
| 395 // entry becomes the target of a bailout. We don't expect it to be, but | 399 // entry becomes the target of a bailout. We don't expect it to be, but |
| 396 // we want it to work if it is. | 400 // we want it to work if it is. |
| 397 PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); | 401 PrepareForBailoutForId(stmt->OsrEntryId(), BailoutState::NO_REGISTERS); |
| 398 } | 402 } |
| 399 | 403 |
| 400 void FullCodeGenerator::EmitProfilingCounterHandlingForReturnSequence( | 404 void FullCodeGenerator::EmitProfilingCounterHandlingForReturnSequence( |
| 401 bool is_tail_call) { | 405 bool is_tail_call) { |
| 402 // Pretend that the exit is a backwards jump to the entry. | 406 // Pretend that the exit is a backwards jump to the entry. |
| 403 int weight = 1; | 407 int weight = 1; |
| 404 if (info_->ShouldSelfOptimize()) { | 408 if (info_->ShouldSelfOptimize()) { |
| 405 weight = FLAG_interrupt_budget / FLAG_self_opt_count; | 409 weight = FLAG_interrupt_budget / FLAG_self_opt_count; |
| 406 } else { | 410 } else { |
| 407 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; | 411 int distance = masm_->pc_offset() + kCodeSizeMultiplier / 2; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 bool should_normalize, | 690 bool should_normalize, |
| 687 Label* if_true, | 691 Label* if_true, |
| 688 Label* if_false) { | 692 Label* if_false) { |
| 689 // Only prepare for bailouts before splits if we're in a test | 693 // Only prepare for bailouts before splits if we're in a test |
| 690 // context. Otherwise, we let the Visit function deal with the | 694 // context. Otherwise, we let the Visit function deal with the |
| 691 // preparation to avoid preparing with the same AST id twice. | 695 // preparation to avoid preparing with the same AST id twice. |
| 692 if (!context()->IsTest()) return; | 696 if (!context()->IsTest()) return; |
| 693 | 697 |
| 694 Label skip; | 698 Label skip; |
| 695 if (should_normalize) __ b(&skip); | 699 if (should_normalize) __ b(&skip); |
| 696 PrepareForBailout(expr, TOS_REG); | 700 PrepareForBailout(expr, BailoutState::TOS_REGISTER); |
| 697 if (should_normalize) { | 701 if (should_normalize) { |
| 698 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 702 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 699 __ cmp(r3, ip); | 703 __ cmp(r3, ip); |
| 700 Split(eq, if_true, if_false, NULL); | 704 Split(eq, if_true, if_false, NULL); |
| 701 __ bind(&skip); | 705 __ bind(&skip); |
| 702 } | 706 } |
| 703 } | 707 } |
| 704 | 708 |
| 705 | 709 |
| 706 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { | 710 void FullCodeGenerator::EmitDebugCheckDeclarationContext(Variable* variable) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 } | 748 } |
| 745 break; | 749 break; |
| 746 | 750 |
| 747 case VariableLocation::CONTEXT: | 751 case VariableLocation::CONTEXT: |
| 748 if (hole_init) { | 752 if (hole_init) { |
| 749 Comment cmnt(masm_, "[ VariableDeclaration"); | 753 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 750 EmitDebugCheckDeclarationContext(variable); | 754 EmitDebugCheckDeclarationContext(variable); |
| 751 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 755 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 752 __ StoreP(ip, ContextMemOperand(cp, variable->index()), r0); | 756 __ StoreP(ip, ContextMemOperand(cp, variable->index()), r0); |
| 753 // No write barrier since the_hole_value is in old space. | 757 // No write barrier since the_hole_value is in old space. |
| 754 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 758 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 755 } | 759 } |
| 756 break; | 760 break; |
| 757 | 761 |
| 758 case VariableLocation::LOOKUP: { | 762 case VariableLocation::LOOKUP: { |
| 759 Comment cmnt(masm_, "[ VariableDeclaration"); | 763 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 760 __ mov(r5, Operand(variable->name())); | 764 __ mov(r5, Operand(variable->name())); |
| 761 // Declaration nodes are always introduced in one of four modes. | 765 // Declaration nodes are always introduced in one of four modes. |
| 762 DCHECK(IsDeclaredVariableMode(mode)); | 766 DCHECK(IsDeclaredVariableMode(mode)); |
| 763 // Push initial value, if any. | 767 // Push initial value, if any. |
| 764 // Note: For variables we must not push an initial value (such as | 768 // Note: For variables we must not push an initial value (such as |
| 765 // 'undefined') because we may have a (legal) redeclaration and we | 769 // 'undefined') because we may have a (legal) redeclaration and we |
| 766 // must not destroy the current value. | 770 // must not destroy the current value. |
| 767 if (hole_init) { | 771 if (hole_init) { |
| 768 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 772 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 769 } else { | 773 } else { |
| 770 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. | 774 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. |
| 771 } | 775 } |
| 772 __ Push(r5, r3); | 776 __ Push(r5, r3); |
| 773 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 777 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 774 __ CallRuntime(Runtime::kDeclareLookupSlot); | 778 __ CallRuntime(Runtime::kDeclareLookupSlot); |
| 775 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 779 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 776 break; | 780 break; |
| 777 } | 781 } |
| 778 } | 782 } |
| 779 } | 783 } |
| 780 | 784 |
| 781 | 785 |
| 782 void FullCodeGenerator::VisitFunctionDeclaration( | 786 void FullCodeGenerator::VisitFunctionDeclaration( |
| 783 FunctionDeclaration* declaration) { | 787 FunctionDeclaration* declaration) { |
| 784 VariableProxy* proxy = declaration->proxy(); | 788 VariableProxy* proxy = declaration->proxy(); |
| 785 Variable* variable = proxy->var(); | 789 Variable* variable = proxy->var(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 807 Comment cmnt(masm_, "[ FunctionDeclaration"); | 811 Comment cmnt(masm_, "[ FunctionDeclaration"); |
| 808 EmitDebugCheckDeclarationContext(variable); | 812 EmitDebugCheckDeclarationContext(variable); |
| 809 VisitForAccumulatorValue(declaration->fun()); | 813 VisitForAccumulatorValue(declaration->fun()); |
| 810 __ StoreP(result_register(), ContextMemOperand(cp, variable->index()), | 814 __ StoreP(result_register(), ContextMemOperand(cp, variable->index()), |
| 811 r0); | 815 r0); |
| 812 int offset = Context::SlotOffset(variable->index()); | 816 int offset = Context::SlotOffset(variable->index()); |
| 813 // We know that we have written a function, which is not a smi. | 817 // We know that we have written a function, which is not a smi. |
| 814 __ RecordWriteContextSlot(cp, offset, result_register(), r5, | 818 __ RecordWriteContextSlot(cp, offset, result_register(), r5, |
| 815 kLRHasBeenSaved, kDontSaveFPRegs, | 819 kLRHasBeenSaved, kDontSaveFPRegs, |
| 816 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 820 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 817 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 821 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 818 break; | 822 break; |
| 819 } | 823 } |
| 820 | 824 |
| 821 case VariableLocation::LOOKUP: { | 825 case VariableLocation::LOOKUP: { |
| 822 Comment cmnt(masm_, "[ FunctionDeclaration"); | 826 Comment cmnt(masm_, "[ FunctionDeclaration"); |
| 823 __ mov(r5, Operand(variable->name())); | 827 __ mov(r5, Operand(variable->name())); |
| 824 PushOperand(r5); | 828 PushOperand(r5); |
| 825 // Push initial value for function declaration. | 829 // Push initial value for function declaration. |
| 826 VisitForStackValue(declaration->fun()); | 830 VisitForStackValue(declaration->fun()); |
| 827 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); | 831 PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 828 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); | 832 CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); |
| 829 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 833 PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
| 830 break; | 834 break; |
| 831 } | 835 } |
| 832 } | 836 } |
| 833 } | 837 } |
| 834 | 838 |
| 835 | 839 |
| 836 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 840 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
| 837 // Call the runtime to declare the globals. | 841 // Call the runtime to declare the globals. |
| 838 __ mov(r4, Operand(pairs)); | 842 __ mov(r4, Operand(pairs)); |
| 839 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); | 843 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 851 } | 855 } |
| 852 | 856 |
| 853 | 857 |
| 854 void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { | 858 void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { |
| 855 Comment cmnt(masm_, "[ SwitchStatement"); | 859 Comment cmnt(masm_, "[ SwitchStatement"); |
| 856 Breakable nested_statement(this, stmt); | 860 Breakable nested_statement(this, stmt); |
| 857 SetStatementPosition(stmt); | 861 SetStatementPosition(stmt); |
| 858 | 862 |
| 859 // Keep the switch value on the stack until a case matches. | 863 // Keep the switch value on the stack until a case matches. |
| 860 VisitForStackValue(stmt->tag()); | 864 VisitForStackValue(stmt->tag()); |
| 861 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 865 PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
| 862 | 866 |
| 863 ZoneList<CaseClause*>* clauses = stmt->cases(); | 867 ZoneList<CaseClause*>* clauses = stmt->cases(); |
| 864 CaseClause* default_clause = NULL; // Can occur anywhere in the list. | 868 CaseClause* default_clause = NULL; // Can occur anywhere in the list. |
| 865 | 869 |
| 866 Label next_test; // Recycled for each test. | 870 Label next_test; // Recycled for each test. |
| 867 // Compile all the tests with branches to their bodies. | 871 // Compile all the tests with branches to their bodies. |
| 868 for (int i = 0; i < clauses->length(); i++) { | 872 for (int i = 0; i < clauses->length(); i++) { |
| 869 CaseClause* clause = clauses->at(i); | 873 CaseClause* clause = clauses->at(i); |
| 870 clause->body_target()->Unuse(); | 874 clause->body_target()->Unuse(); |
| 871 | 875 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 900 | 904 |
| 901 // Record position before stub call for type feedback. | 905 // Record position before stub call for type feedback. |
| 902 SetExpressionPosition(clause); | 906 SetExpressionPosition(clause); |
| 903 Handle<Code> ic = | 907 Handle<Code> ic = |
| 904 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); | 908 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); |
| 905 CallIC(ic, clause->CompareId()); | 909 CallIC(ic, clause->CompareId()); |
| 906 patch_site.EmitPatchInfo(); | 910 patch_site.EmitPatchInfo(); |
| 907 | 911 |
| 908 Label skip; | 912 Label skip; |
| 909 __ b(&skip); | 913 __ b(&skip); |
| 910 PrepareForBailout(clause, TOS_REG); | 914 PrepareForBailout(clause, BailoutState::TOS_REGISTER); |
| 911 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 915 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 912 __ cmp(r3, ip); | 916 __ cmp(r3, ip); |
| 913 __ bne(&next_test); | 917 __ bne(&next_test); |
| 914 __ Drop(1); | 918 __ Drop(1); |
| 915 __ b(clause->body_target()); | 919 __ b(clause->body_target()); |
| 916 __ bind(&skip); | 920 __ bind(&skip); |
| 917 | 921 |
| 918 __ cmpi(r3, Operand::Zero()); | 922 __ cmpi(r3, Operand::Zero()); |
| 919 __ bne(&next_test); | 923 __ bne(&next_test); |
| 920 __ Drop(1); // Switch value is no longer needed. | 924 __ Drop(1); // Switch value is no longer needed. |
| 921 __ b(clause->body_target()); | 925 __ b(clause->body_target()); |
| 922 } | 926 } |
| 923 | 927 |
| 924 // Discard the test value and jump to the default if present, otherwise to | 928 // Discard the test value and jump to the default if present, otherwise to |
| 925 // the end of the statement. | 929 // the end of the statement. |
| 926 __ bind(&next_test); | 930 __ bind(&next_test); |
| 927 DropOperands(1); // Switch value is no longer needed. | 931 DropOperands(1); // Switch value is no longer needed. |
| 928 if (default_clause == NULL) { | 932 if (default_clause == NULL) { |
| 929 __ b(nested_statement.break_label()); | 933 __ b(nested_statement.break_label()); |
| 930 } else { | 934 } else { |
| 931 __ b(default_clause->body_target()); | 935 __ b(default_clause->body_target()); |
| 932 } | 936 } |
| 933 | 937 |
| 934 // Compile all the case bodies. | 938 // Compile all the case bodies. |
| 935 for (int i = 0; i < clauses->length(); i++) { | 939 for (int i = 0; i < clauses->length(); i++) { |
| 936 Comment cmnt(masm_, "[ Case body"); | 940 Comment cmnt(masm_, "[ Case body"); |
| 937 CaseClause* clause = clauses->at(i); | 941 CaseClause* clause = clauses->at(i); |
| 938 __ bind(clause->body_target()); | 942 __ bind(clause->body_target()); |
| 939 PrepareForBailoutForId(clause->EntryId(), NO_REGISTERS); | 943 PrepareForBailoutForId(clause->EntryId(), BailoutState::NO_REGISTERS); |
| 940 VisitStatements(clause->statements()); | 944 VisitStatements(clause->statements()); |
| 941 } | 945 } |
| 942 | 946 |
| 943 __ bind(nested_statement.break_label()); | 947 __ bind(nested_statement.break_label()); |
| 944 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 948 PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
| 945 } | 949 } |
| 946 | 950 |
| 947 | 951 |
| 948 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 952 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
| 949 Comment cmnt(masm_, "[ ForInStatement"); | 953 Comment cmnt(masm_, "[ ForInStatement"); |
| 950 SetStatementPosition(stmt, SKIP_BREAK); | 954 SetStatementPosition(stmt, SKIP_BREAK); |
| 951 | 955 |
| 952 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); | 956 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
| 953 | 957 |
| 954 // Get the object to enumerate over. | 958 // Get the object to enumerate over. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 967 __ CompareObjectType(r3, r4, r4, FIRST_JS_RECEIVER_TYPE); | 971 __ CompareObjectType(r3, r4, r4, FIRST_JS_RECEIVER_TYPE); |
| 968 __ bge(&done_convert); | 972 __ bge(&done_convert); |
| 969 __ CompareRoot(r3, Heap::kNullValueRootIndex); | 973 __ CompareRoot(r3, Heap::kNullValueRootIndex); |
| 970 __ beq(&exit); | 974 __ beq(&exit); |
| 971 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 975 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); |
| 972 __ beq(&exit); | 976 __ beq(&exit); |
| 973 __ bind(&convert); | 977 __ bind(&convert); |
| 974 ToObjectStub stub(isolate()); | 978 ToObjectStub stub(isolate()); |
| 975 __ CallStub(&stub); | 979 __ CallStub(&stub); |
| 976 __ bind(&done_convert); | 980 __ bind(&done_convert); |
| 977 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 981 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
| 978 __ push(r3); | 982 __ push(r3); |
| 979 | 983 |
| 980 // Check cache validity in generated code. If we cannot guarantee cache | 984 // Check cache validity in generated code. If we cannot guarantee cache |
| 981 // validity, call the runtime system to check cache validity or get the | 985 // validity, call the runtime system to check cache validity or get the |
| 982 // property names in a fixed array. Note: Proxies never have an enum cache, | 986 // property names in a fixed array. Note: Proxies never have an enum cache, |
| 983 // so will always take the slow path. | 987 // so will always take the slow path. |
| 984 Label call_runtime; | 988 Label call_runtime; |
| 985 __ CheckEnumCache(&call_runtime); | 989 __ CheckEnumCache(&call_runtime); |
| 986 | 990 |
| 987 // The enum cache is valid. Load the map of the object being | 991 // The enum cache is valid. Load the map of the object being |
| 988 // iterated over and use the cache for the iteration. | 992 // iterated over and use the cache for the iteration. |
| 989 Label use_cache; | 993 Label use_cache; |
| 990 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 994 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
| 991 __ b(&use_cache); | 995 __ b(&use_cache); |
| 992 | 996 |
| 993 // Get the set of properties to enumerate. | 997 // Get the set of properties to enumerate. |
| 994 __ bind(&call_runtime); | 998 __ bind(&call_runtime); |
| 995 __ push(r3); // Duplicate the enumerable object on the stack. | 999 __ push(r3); // Duplicate the enumerable object on the stack. |
| 996 __ CallRuntime(Runtime::kForInEnumerate); | 1000 __ CallRuntime(Runtime::kForInEnumerate); |
| 997 PrepareForBailoutForId(stmt->EnumId(), TOS_REG); | 1001 PrepareForBailoutForId(stmt->EnumId(), BailoutState::TOS_REGISTER); |
| 998 | 1002 |
| 999 // If we got a map from the runtime call, we can do a fast | 1003 // If we got a map from the runtime call, we can do a fast |
| 1000 // modification check. Otherwise, we got a fixed array, and we have | 1004 // modification check. Otherwise, we got a fixed array, and we have |
| 1001 // to do a slow check. | 1005 // to do a slow check. |
| 1002 Label fixed_array; | 1006 Label fixed_array; |
| 1003 __ LoadP(r5, FieldMemOperand(r3, HeapObject::kMapOffset)); | 1007 __ LoadP(r5, FieldMemOperand(r3, HeapObject::kMapOffset)); |
| 1004 __ LoadRoot(ip, Heap::kMetaMapRootIndex); | 1008 __ LoadRoot(ip, Heap::kMetaMapRootIndex); |
| 1005 __ cmp(r5, ip); | 1009 __ cmp(r5, ip); |
| 1006 __ bne(&fixed_array); | 1010 __ bne(&fixed_array); |
| 1007 | 1011 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1029 __ Drop(1); | 1033 __ Drop(1); |
| 1030 __ b(&exit); | 1034 __ b(&exit); |
| 1031 | 1035 |
| 1032 // We got a fixed array in register r3. Iterate through that. | 1036 // We got a fixed array in register r3. Iterate through that. |
| 1033 __ bind(&fixed_array); | 1037 __ bind(&fixed_array); |
| 1034 | 1038 |
| 1035 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check | 1039 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check |
| 1036 __ Push(r4, r3); // Smi and array | 1040 __ Push(r4, r3); // Smi and array |
| 1037 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1041 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
| 1038 __ Push(r4); // Fixed array length (as smi). | 1042 __ Push(r4); // Fixed array length (as smi). |
| 1039 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1043 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); |
| 1040 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 1044 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
| 1041 __ Push(r3); // Initial index. | 1045 __ Push(r3); // Initial index. |
| 1042 | 1046 |
| 1043 // Generate code for doing the condition check. | 1047 // Generate code for doing the condition check. |
| 1044 __ bind(&loop); | 1048 __ bind(&loop); |
| 1045 SetExpressionAsStatementPosition(stmt->each()); | 1049 SetExpressionAsStatementPosition(stmt->each()); |
| 1046 | 1050 |
| 1047 // Load the current count to r3, load the length to r4. | 1051 // Load the current count to r3, load the length to r4. |
| 1048 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); | 1052 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); |
| 1049 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); | 1053 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1073 __ EmitLoadTypeFeedbackVector(r3); | 1077 __ EmitLoadTypeFeedbackVector(r3); |
| 1074 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1078 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1075 __ StoreP( | 1079 __ StoreP( |
| 1076 r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0); | 1080 r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0); |
| 1077 | 1081 |
| 1078 // Convert the entry to a string or (smi) 0 if it isn't a property | 1082 // Convert the entry to a string or (smi) 0 if it isn't a property |
| 1079 // any more. If the property has been removed while iterating, we | 1083 // any more. If the property has been removed while iterating, we |
| 1080 // just skip it. | 1084 // just skip it. |
| 1081 __ Push(r4, r6); // Enumerable and current entry. | 1085 __ Push(r4, r6); // Enumerable and current entry. |
| 1082 __ CallRuntime(Runtime::kForInFilter); | 1086 __ CallRuntime(Runtime::kForInFilter); |
| 1083 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1087 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); |
| 1084 __ mr(r6, r3); | 1088 __ mr(r6, r3); |
| 1085 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 1089 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 1086 __ cmp(r3, r0); | 1090 __ cmp(r3, r0); |
| 1087 __ beq(loop_statement.continue_label()); | 1091 __ beq(loop_statement.continue_label()); |
| 1088 | 1092 |
| 1089 // Update the 'each' property or variable from the possibly filtered | 1093 // Update the 'each' property or variable from the possibly filtered |
| 1090 // entry in register r6. | 1094 // entry in register r6. |
| 1091 __ bind(&update_each); | 1095 __ bind(&update_each); |
| 1092 __ mr(result_register(), r6); | 1096 __ mr(result_register(), r6); |
| 1093 // Perform the assignment as if via '='. | 1097 // Perform the assignment as if via '='. |
| 1094 { | 1098 { |
| 1095 EffectContext context(this); | 1099 EffectContext context(this); |
| 1096 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); | 1100 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
| 1097 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); | 1101 PrepareForBailoutForId(stmt->AssignmentId(), BailoutState::NO_REGISTERS); |
| 1098 } | 1102 } |
| 1099 | 1103 |
| 1100 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). | 1104 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
| 1101 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); | 1105 PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); |
| 1102 // Generate code for the body of the loop. | 1106 // Generate code for the body of the loop. |
| 1103 Visit(stmt->body()); | 1107 Visit(stmt->body()); |
| 1104 | 1108 |
| 1105 // Generate code for the going to the next element by incrementing | 1109 // Generate code for the going to the next element by incrementing |
| 1106 // the index (smi) stored on top of the stack. | 1110 // the index (smi) stored on top of the stack. |
| 1107 __ bind(loop_statement.continue_label()); | 1111 __ bind(loop_statement.continue_label()); |
| 1108 __ pop(r3); | 1112 __ pop(r3); |
| 1109 __ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); | 1113 __ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); |
| 1110 __ push(r3); | 1114 __ push(r3); |
| 1111 | 1115 |
| 1112 EmitBackEdgeBookkeeping(stmt, &loop); | 1116 EmitBackEdgeBookkeeping(stmt, &loop); |
| 1113 __ b(&loop); | 1117 __ b(&loop); |
| 1114 | 1118 |
| 1115 // Remove the pointers stored on the stack. | 1119 // Remove the pointers stored on the stack. |
| 1116 __ bind(loop_statement.break_label()); | 1120 __ bind(loop_statement.break_label()); |
| 1117 DropOperands(5); | 1121 DropOperands(5); |
| 1118 | 1122 |
| 1119 // Exit and decrement the loop depth. | 1123 // Exit and decrement the loop depth. |
| 1120 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1124 PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
| 1121 __ bind(&exit); | 1125 __ bind(&exit); |
| 1122 decrement_loop_depth(); | 1126 decrement_loop_depth(); |
| 1123 } | 1127 } |
| 1124 | 1128 |
| 1125 | 1129 |
| 1126 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1130 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
| 1127 FeedbackVectorSlot slot) { | 1131 FeedbackVectorSlot slot) { |
| 1128 DCHECK(NeedsHomeObject(initializer)); | 1132 DCHECK(NeedsHomeObject(initializer)); |
| 1129 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1133 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1130 __ mov(StoreDescriptor::NameRegister(), | 1134 __ mov(StoreDescriptor::NameRegister(), |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 __ mov(LoadDescriptor::SlotRegister(), | 1273 __ mov(LoadDescriptor::SlotRegister(), |
| 1270 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); | 1274 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
| 1271 CallLoadIC(typeof_mode); | 1275 CallLoadIC(typeof_mode); |
| 1272 } | 1276 } |
| 1273 | 1277 |
| 1274 | 1278 |
| 1275 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1279 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1276 TypeofMode typeof_mode) { | 1280 TypeofMode typeof_mode) { |
| 1277 // Record position before possible IC call. | 1281 // Record position before possible IC call. |
| 1278 SetExpressionPosition(proxy); | 1282 SetExpressionPosition(proxy); |
| 1279 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); | 1283 PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
| 1280 Variable* var = proxy->var(); | 1284 Variable* var = proxy->var(); |
| 1281 | 1285 |
| 1282 // Three cases: global variables, lookup variables, and all other types of | 1286 // Three cases: global variables, lookup variables, and all other types of |
| 1283 // variables. | 1287 // variables. |
| 1284 switch (var->location()) { | 1288 switch (var->location()) { |
| 1285 case VariableLocation::GLOBAL: | 1289 case VariableLocation::GLOBAL: |
| 1286 case VariableLocation::UNALLOCATED: { | 1290 case VariableLocation::UNALLOCATED: { |
| 1287 Comment cmnt(masm_, "[ Global variable"); | 1291 Comment cmnt(masm_, "[ Global variable"); |
| 1288 EmitGlobalVariableLoad(proxy, typeof_mode); | 1292 EmitGlobalVariableLoad(proxy, typeof_mode); |
| 1289 context()->Plug(r3); | 1293 context()->Plug(r3); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 int flags = expr->ComputeFlags(); | 1380 int flags = expr->ComputeFlags(); |
| 1377 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); | 1381 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); |
| 1378 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1382 if (MustCreateObjectLiteralWithRuntime(expr)) { |
| 1379 __ Push(r6, r5, r4, r3); | 1383 __ Push(r6, r5, r4, r3); |
| 1380 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1384 __ CallRuntime(Runtime::kCreateObjectLiteral); |
| 1381 } else { | 1385 } else { |
| 1382 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); | 1386 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
| 1383 __ CallStub(&stub); | 1387 __ CallStub(&stub); |
| 1384 RestoreContext(); | 1388 RestoreContext(); |
| 1385 } | 1389 } |
| 1386 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); | 1390 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
| 1387 | 1391 |
| 1388 // If result_saved is true the result is on top of the stack. If | 1392 // If result_saved is true the result is on top of the stack. If |
| 1389 // result_saved is false the result is in r3. | 1393 // result_saved is false the result is in r3. |
| 1390 bool result_saved = false; | 1394 bool result_saved = false; |
| 1391 | 1395 |
| 1392 AccessorTable accessor_table(zone()); | 1396 AccessorTable accessor_table(zone()); |
| 1393 int property_index = 0; | 1397 int property_index = 0; |
| 1394 for (; property_index < expr->properties()->length(); property_index++) { | 1398 for (; property_index < expr->properties()->length(); property_index++) { |
| 1395 ObjectLiteral::Property* property = expr->properties()->at(property_index); | 1399 ObjectLiteral::Property* property = expr->properties()->at(property_index); |
| 1396 if (property->is_computed_name()) break; | 1400 if (property->is_computed_name()) break; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1412 // It is safe to use [[Put]] here because the boilerplate already | 1416 // It is safe to use [[Put]] here because the boilerplate already |
| 1413 // contains computed properties with an uninitialized value. | 1417 // contains computed properties with an uninitialized value. |
| 1414 if (key->value()->IsInternalizedString()) { | 1418 if (key->value()->IsInternalizedString()) { |
| 1415 if (property->emit_store()) { | 1419 if (property->emit_store()) { |
| 1416 VisitForAccumulatorValue(value); | 1420 VisitForAccumulatorValue(value); |
| 1417 DCHECK(StoreDescriptor::ValueRegister().is(r3)); | 1421 DCHECK(StoreDescriptor::ValueRegister().is(r3)); |
| 1418 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); | 1422 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); |
| 1419 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1423 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1420 EmitLoadStoreICSlot(property->GetSlot(0)); | 1424 EmitLoadStoreICSlot(property->GetSlot(0)); |
| 1421 CallStoreIC(); | 1425 CallStoreIC(); |
| 1422 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1426 PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); |
| 1423 | 1427 |
| 1424 if (NeedsHomeObject(value)) { | 1428 if (NeedsHomeObject(value)) { |
| 1425 EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); | 1429 EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); |
| 1426 } | 1430 } |
| 1427 } else { | 1431 } else { |
| 1428 VisitForEffect(value); | 1432 VisitForEffect(value); |
| 1429 } | 1433 } |
| 1430 break; | 1434 break; |
| 1431 } | 1435 } |
| 1432 // Duplicate receiver on stack. | 1436 // Duplicate receiver on stack. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1446 } | 1450 } |
| 1447 break; | 1451 break; |
| 1448 case ObjectLiteral::Property::PROTOTYPE: | 1452 case ObjectLiteral::Property::PROTOTYPE: |
| 1449 // Duplicate receiver on stack. | 1453 // Duplicate receiver on stack. |
| 1450 __ LoadP(r3, MemOperand(sp)); | 1454 __ LoadP(r3, MemOperand(sp)); |
| 1451 PushOperand(r3); | 1455 PushOperand(r3); |
| 1452 VisitForStackValue(value); | 1456 VisitForStackValue(value); |
| 1453 DCHECK(property->emit_store()); | 1457 DCHECK(property->emit_store()); |
| 1454 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1458 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1455 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1459 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1456 NO_REGISTERS); | 1460 BailoutState::NO_REGISTERS); |
| 1457 break; | 1461 break; |
| 1458 case ObjectLiteral::Property::GETTER: | 1462 case ObjectLiteral::Property::GETTER: |
| 1459 if (property->emit_store()) { | 1463 if (property->emit_store()) { |
| 1460 accessor_table.lookup(key)->second->getter = property; | 1464 accessor_table.lookup(key)->second->getter = property; |
| 1461 } | 1465 } |
| 1462 break; | 1466 break; |
| 1463 case ObjectLiteral::Property::SETTER: | 1467 case ObjectLiteral::Property::SETTER: |
| 1464 if (property->emit_store()) { | 1468 if (property->emit_store()) { |
| 1465 accessor_table.lookup(key)->second->setter = property; | 1469 accessor_table.lookup(key)->second->setter = property; |
| 1466 } | 1470 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 | 1506 |
| 1503 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. | 1507 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. |
| 1504 PushOperand(r3); | 1508 PushOperand(r3); |
| 1505 | 1509 |
| 1506 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { | 1510 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { |
| 1507 DCHECK(!property->is_computed_name()); | 1511 DCHECK(!property->is_computed_name()); |
| 1508 VisitForStackValue(value); | 1512 VisitForStackValue(value); |
| 1509 DCHECK(property->emit_store()); | 1513 DCHECK(property->emit_store()); |
| 1510 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1514 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1511 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1515 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1512 NO_REGISTERS); | 1516 BailoutState::NO_REGISTERS); |
| 1513 } else { | 1517 } else { |
| 1514 EmitPropertyKey(property, expr->GetIdForPropertyName(property_index)); | 1518 EmitPropertyKey(property, expr->GetIdForPropertyName(property_index)); |
| 1515 VisitForStackValue(value); | 1519 VisitForStackValue(value); |
| 1516 if (NeedsHomeObject(value)) { | 1520 if (NeedsHomeObject(value)) { |
| 1517 EmitSetHomeObject(value, 2, property->GetSlot()); | 1521 EmitSetHomeObject(value, 2, property->GetSlot()); |
| 1518 } | 1522 } |
| 1519 | 1523 |
| 1520 switch (property->kind()) { | 1524 switch (property->kind()) { |
| 1521 case ObjectLiteral::Property::CONSTANT: | 1525 case ObjectLiteral::Property::CONSTANT: |
| 1522 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1526 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); | 1579 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); |
| 1576 __ mov(r4, Operand(constant_elements)); | 1580 __ mov(r4, Operand(constant_elements)); |
| 1577 if (MustCreateArrayLiteralWithRuntime(expr)) { | 1581 if (MustCreateArrayLiteralWithRuntime(expr)) { |
| 1578 __ LoadSmiLiteral(r3, Smi::FromInt(expr->ComputeFlags())); | 1582 __ LoadSmiLiteral(r3, Smi::FromInt(expr->ComputeFlags())); |
| 1579 __ Push(r6, r5, r4, r3); | 1583 __ Push(r6, r5, r4, r3); |
| 1580 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1584 __ CallRuntime(Runtime::kCreateArrayLiteral); |
| 1581 } else { | 1585 } else { |
| 1582 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); | 1586 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
| 1583 __ CallStub(&stub); | 1587 __ CallStub(&stub); |
| 1584 } | 1588 } |
| 1585 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); | 1589 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
| 1586 | 1590 |
| 1587 bool result_saved = false; // Is the result saved to the stack? | 1591 bool result_saved = false; // Is the result saved to the stack? |
| 1588 ZoneList<Expression*>* subexprs = expr->values(); | 1592 ZoneList<Expression*>* subexprs = expr->values(); |
| 1589 int length = subexprs->length(); | 1593 int length = subexprs->length(); |
| 1590 | 1594 |
| 1591 // Emit code to evaluate all the non-constant subexpressions and to store | 1595 // Emit code to evaluate all the non-constant subexpressions and to store |
| 1592 // them into the newly cloned array. | 1596 // them into the newly cloned array. |
| 1593 int array_index = 0; | 1597 int array_index = 0; |
| 1594 for (; array_index < length; array_index++) { | 1598 for (; array_index < length; array_index++) { |
| 1595 Expression* subexpr = subexprs->at(array_index); | 1599 Expression* subexpr = subexprs->at(array_index); |
| 1596 DCHECK(!subexpr->IsSpread()); | 1600 DCHECK(!subexpr->IsSpread()); |
| 1597 // If the subexpression is a literal or a simple materialized literal it | 1601 // If the subexpression is a literal or a simple materialized literal it |
| 1598 // is already set in the cloned array. | 1602 // is already set in the cloned array. |
| 1599 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1603 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 1600 | 1604 |
| 1601 if (!result_saved) { | 1605 if (!result_saved) { |
| 1602 PushOperand(r3); | 1606 PushOperand(r3); |
| 1603 result_saved = true; | 1607 result_saved = true; |
| 1604 } | 1608 } |
| 1605 VisitForAccumulatorValue(subexpr); | 1609 VisitForAccumulatorValue(subexpr); |
| 1606 | 1610 |
| 1607 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), | 1611 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), |
| 1608 Smi::FromInt(array_index)); | 1612 Smi::FromInt(array_index)); |
| 1609 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1613 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
| 1610 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1614 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1611 Handle<Code> ic = | 1615 Handle<Code> ic = |
| 1612 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 1616 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 1613 CallIC(ic); | 1617 CallIC(ic); |
| 1614 | 1618 |
| 1615 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1619 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
| 1620 BailoutState::NO_REGISTERS); |
| 1616 } | 1621 } |
| 1617 | 1622 |
| 1618 // In case the array literal contains spread expressions it has two parts. The | 1623 // In case the array literal contains spread expressions it has two parts. The |
| 1619 // first part is the "static" array which has a literal index is handled | 1624 // first part is the "static" array which has a literal index is handled |
| 1620 // above. The second part is the part after the first spread expression | 1625 // above. The second part is the part after the first spread expression |
| 1621 // (inclusive) and these elements gets appended to the array. Note that the | 1626 // (inclusive) and these elements gets appended to the array. Note that the |
| 1622 // number elements an iterable produces is unknown ahead of time. | 1627 // number elements an iterable produces is unknown ahead of time. |
| 1623 if (array_index < length && result_saved) { | 1628 if (array_index < length && result_saved) { |
| 1624 PopOperand(r3); | 1629 PopOperand(r3); |
| 1625 result_saved = false; | 1630 result_saved = false; |
| 1626 } | 1631 } |
| 1627 for (; array_index < length; array_index++) { | 1632 for (; array_index < length; array_index++) { |
| 1628 Expression* subexpr = subexprs->at(array_index); | 1633 Expression* subexpr = subexprs->at(array_index); |
| 1629 | 1634 |
| 1630 PushOperand(r3); | 1635 PushOperand(r3); |
| 1631 DCHECK(!subexpr->IsSpread()); | 1636 DCHECK(!subexpr->IsSpread()); |
| 1632 VisitForStackValue(subexpr); | 1637 VisitForStackValue(subexpr); |
| 1633 CallRuntimeWithOperands(Runtime::kAppendElement); | 1638 CallRuntimeWithOperands(Runtime::kAppendElement); |
| 1634 | 1639 |
| 1635 PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); | 1640 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
| 1641 BailoutState::NO_REGISTERS); |
| 1636 } | 1642 } |
| 1637 | 1643 |
| 1638 if (result_saved) { | 1644 if (result_saved) { |
| 1639 context()->PlugTOS(); | 1645 context()->PlugTOS(); |
| 1640 } else { | 1646 } else { |
| 1641 context()->Plug(r3); | 1647 context()->Plug(r3); |
| 1642 } | 1648 } |
| 1643 } | 1649 } |
| 1644 | 1650 |
| 1645 | 1651 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 } | 1714 } |
| 1709 | 1715 |
| 1710 // For compound assignments we need another deoptimization point after the | 1716 // For compound assignments we need another deoptimization point after the |
| 1711 // variable/property load. | 1717 // variable/property load. |
| 1712 if (expr->is_compound()) { | 1718 if (expr->is_compound()) { |
| 1713 { | 1719 { |
| 1714 AccumulatorValueContext context(this); | 1720 AccumulatorValueContext context(this); |
| 1715 switch (assign_type) { | 1721 switch (assign_type) { |
| 1716 case VARIABLE: | 1722 case VARIABLE: |
| 1717 EmitVariableLoad(expr->target()->AsVariableProxy()); | 1723 EmitVariableLoad(expr->target()->AsVariableProxy()); |
| 1718 PrepareForBailout(expr->target(), TOS_REG); | 1724 PrepareForBailout(expr->target(), BailoutState::TOS_REGISTER); |
| 1719 break; | 1725 break; |
| 1720 case NAMED_PROPERTY: | 1726 case NAMED_PROPERTY: |
| 1721 EmitNamedPropertyLoad(property); | 1727 EmitNamedPropertyLoad(property); |
| 1722 PrepareForBailoutForId(property->LoadId(), TOS_REG); | 1728 PrepareForBailoutForId(property->LoadId(), |
| 1729 BailoutState::TOS_REGISTER); |
| 1723 break; | 1730 break; |
| 1724 case NAMED_SUPER_PROPERTY: | 1731 case NAMED_SUPER_PROPERTY: |
| 1725 EmitNamedSuperPropertyLoad(property); | 1732 EmitNamedSuperPropertyLoad(property); |
| 1726 PrepareForBailoutForId(property->LoadId(), TOS_REG); | 1733 PrepareForBailoutForId(property->LoadId(), |
| 1734 BailoutState::TOS_REGISTER); |
| 1727 break; | 1735 break; |
| 1728 case KEYED_SUPER_PROPERTY: | 1736 case KEYED_SUPER_PROPERTY: |
| 1729 EmitKeyedSuperPropertyLoad(property); | 1737 EmitKeyedSuperPropertyLoad(property); |
| 1730 PrepareForBailoutForId(property->LoadId(), TOS_REG); | 1738 PrepareForBailoutForId(property->LoadId(), |
| 1739 BailoutState::TOS_REGISTER); |
| 1731 break; | 1740 break; |
| 1732 case KEYED_PROPERTY: | 1741 case KEYED_PROPERTY: |
| 1733 EmitKeyedPropertyLoad(property); | 1742 EmitKeyedPropertyLoad(property); |
| 1734 PrepareForBailoutForId(property->LoadId(), TOS_REG); | 1743 PrepareForBailoutForId(property->LoadId(), |
| 1744 BailoutState::TOS_REGISTER); |
| 1735 break; | 1745 break; |
| 1736 } | 1746 } |
| 1737 } | 1747 } |
| 1738 | 1748 |
| 1739 Token::Value op = expr->binary_op(); | 1749 Token::Value op = expr->binary_op(); |
| 1740 PushOperand(r3); // Left operand goes on the stack. | 1750 PushOperand(r3); // Left operand goes on the stack. |
| 1741 VisitForAccumulatorValue(expr->value()); | 1751 VisitForAccumulatorValue(expr->value()); |
| 1742 | 1752 |
| 1743 AccumulatorValueContext context(this); | 1753 AccumulatorValueContext context(this); |
| 1744 if (ShouldInlineSmiCase(op)) { | 1754 if (ShouldInlineSmiCase(op)) { |
| 1745 EmitInlineSmiBinaryOp(expr->binary_operation(), op, expr->target(), | 1755 EmitInlineSmiBinaryOp(expr->binary_operation(), op, expr->target(), |
| 1746 expr->value()); | 1756 expr->value()); |
| 1747 } else { | 1757 } else { |
| 1748 EmitBinaryOp(expr->binary_operation(), op); | 1758 EmitBinaryOp(expr->binary_operation(), op); |
| 1749 } | 1759 } |
| 1750 | 1760 |
| 1751 // Deoptimization point in case the binary operation may have side effects. | 1761 // Deoptimization point in case the binary operation may have side effects. |
| 1752 PrepareForBailout(expr->binary_operation(), TOS_REG); | 1762 PrepareForBailout(expr->binary_operation(), BailoutState::TOS_REGISTER); |
| 1753 } else { | 1763 } else { |
| 1754 VisitForAccumulatorValue(expr->value()); | 1764 VisitForAccumulatorValue(expr->value()); |
| 1755 } | 1765 } |
| 1756 | 1766 |
| 1757 SetExpressionPosition(expr); | 1767 SetExpressionPosition(expr); |
| 1758 | 1768 |
| 1759 // Store the value. | 1769 // Store the value. |
| 1760 switch (assign_type) { | 1770 switch (assign_type) { |
| 1761 case VARIABLE: | 1771 case VARIABLE: |
| 1762 EmitVariableAssignment(expr->target()->AsVariableProxy()->var(), | 1772 EmitVariableAssignment(expr->target()->AsVariableProxy()->var(), |
| 1763 expr->op(), expr->AssignmentSlot()); | 1773 expr->op(), expr->AssignmentSlot()); |
| 1764 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 1774 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 1765 context()->Plug(r3); | 1775 context()->Plug(r3); |
| 1766 break; | 1776 break; |
| 1767 case NAMED_PROPERTY: | 1777 case NAMED_PROPERTY: |
| 1768 EmitNamedPropertyAssignment(expr); | 1778 EmitNamedPropertyAssignment(expr); |
| 1769 break; | 1779 break; |
| 1770 case NAMED_SUPER_PROPERTY: | 1780 case NAMED_SUPER_PROPERTY: |
| 1771 EmitNamedSuperPropertyStore(property); | 1781 EmitNamedSuperPropertyStore(property); |
| 1772 context()->Plug(r3); | 1782 context()->Plug(r3); |
| 1773 break; | 1783 break; |
| 1774 case KEYED_SUPER_PROPERTY: | 1784 case KEYED_SUPER_PROPERTY: |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2266 Property* prop = expr->target()->AsProperty(); | 2276 Property* prop = expr->target()->AsProperty(); |
| 2267 DCHECK(prop != NULL); | 2277 DCHECK(prop != NULL); |
| 2268 DCHECK(prop->key()->IsLiteral()); | 2278 DCHECK(prop->key()->IsLiteral()); |
| 2269 | 2279 |
| 2270 __ mov(StoreDescriptor::NameRegister(), | 2280 __ mov(StoreDescriptor::NameRegister(), |
| 2271 Operand(prop->key()->AsLiteral()->value())); | 2281 Operand(prop->key()->AsLiteral()->value())); |
| 2272 PopOperand(StoreDescriptor::ReceiverRegister()); | 2282 PopOperand(StoreDescriptor::ReceiverRegister()); |
| 2273 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2283 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2274 CallStoreIC(); | 2284 CallStoreIC(); |
| 2275 | 2285 |
| 2276 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2286 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 2277 context()->Plug(r3); | 2287 context()->Plug(r3); |
| 2278 } | 2288 } |
| 2279 | 2289 |
| 2280 | 2290 |
| 2281 void FullCodeGenerator::EmitNamedSuperPropertyStore(Property* prop) { | 2291 void FullCodeGenerator::EmitNamedSuperPropertyStore(Property* prop) { |
| 2282 // Assignment to named property of super. | 2292 // Assignment to named property of super. |
| 2283 // r3 : value | 2293 // r3 : value |
| 2284 // stack : receiver ('this'), home_object | 2294 // stack : receiver ('this'), home_object |
| 2285 DCHECK(prop != NULL); | 2295 DCHECK(prop != NULL); |
| 2286 Literal* key = prop->key()->AsLiteral(); | 2296 Literal* key = prop->key()->AsLiteral(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2311 // Assignment to a property, using a keyed store IC. | 2321 // Assignment to a property, using a keyed store IC. |
| 2312 PopOperands(StoreDescriptor::ReceiverRegister(), | 2322 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 2313 StoreDescriptor::NameRegister()); | 2323 StoreDescriptor::NameRegister()); |
| 2314 DCHECK(StoreDescriptor::ValueRegister().is(r3)); | 2324 DCHECK(StoreDescriptor::ValueRegister().is(r3)); |
| 2315 | 2325 |
| 2316 Handle<Code> ic = | 2326 Handle<Code> ic = |
| 2317 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 2327 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 2318 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2328 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2319 CallIC(ic); | 2329 CallIC(ic); |
| 2320 | 2330 |
| 2321 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2331 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 2322 context()->Plug(r3); | 2332 context()->Plug(r3); |
| 2323 } | 2333 } |
| 2324 | 2334 |
| 2325 | 2335 |
| 2326 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { | 2336 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { |
| 2327 ic_total_count_++; | 2337 ic_total_count_++; |
| 2328 __ Call(code, RelocInfo::CODE_TARGET, ast_id); | 2338 __ Call(code, RelocInfo::CODE_TARGET, ast_id); |
| 2329 } | 2339 } |
| 2330 | 2340 |
| 2331 | 2341 |
| 2332 // Code common for calls using the IC. | 2342 // Code common for calls using the IC. |
| 2333 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { | 2343 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
| 2334 Expression* callee = expr->expression(); | 2344 Expression* callee = expr->expression(); |
| 2335 | 2345 |
| 2336 // Get the target function. | 2346 // Get the target function. |
| 2337 ConvertReceiverMode convert_mode; | 2347 ConvertReceiverMode convert_mode; |
| 2338 if (callee->IsVariableProxy()) { | 2348 if (callee->IsVariableProxy()) { |
| 2339 { | 2349 { |
| 2340 StackValueContext context(this); | 2350 StackValueContext context(this); |
| 2341 EmitVariableLoad(callee->AsVariableProxy()); | 2351 EmitVariableLoad(callee->AsVariableProxy()); |
| 2342 PrepareForBailout(callee, NO_REGISTERS); | 2352 PrepareForBailout(callee, BailoutState::NO_REGISTERS); |
| 2343 } | 2353 } |
| 2344 // Push undefined as receiver. This is patched in the method prologue if it | 2354 // Push undefined as receiver. This is patched in the method prologue if it |
| 2345 // is a sloppy mode method. | 2355 // is a sloppy mode method. |
| 2346 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 2356 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 2347 PushOperand(r0); | 2357 PushOperand(r0); |
| 2348 convert_mode = ConvertReceiverMode::kNullOrUndefined; | 2358 convert_mode = ConvertReceiverMode::kNullOrUndefined; |
| 2349 } else { | 2359 } else { |
| 2350 // Load the function from the receiver. | 2360 // Load the function from the receiver. |
| 2351 DCHECK(callee->IsProperty()); | 2361 DCHECK(callee->IsProperty()); |
| 2352 DCHECK(!callee->AsProperty()->IsSuperAccess()); | 2362 DCHECK(!callee->AsProperty()->IsSuperAccess()); |
| 2353 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 2363 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
| 2354 EmitNamedPropertyLoad(callee->AsProperty()); | 2364 EmitNamedPropertyLoad(callee->AsProperty()); |
| 2355 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); | 2365 PrepareForBailoutForId(callee->AsProperty()->LoadId(), |
| 2366 BailoutState::TOS_REGISTER); |
| 2356 // Push the target function under the receiver. | 2367 // Push the target function under the receiver. |
| 2357 __ LoadP(r0, MemOperand(sp, 0)); | 2368 __ LoadP(r0, MemOperand(sp, 0)); |
| 2358 PushOperand(r0); | 2369 PushOperand(r0); |
| 2359 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2370 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 2360 convert_mode = ConvertReceiverMode::kNotNullOrUndefined; | 2371 convert_mode = ConvertReceiverMode::kNotNullOrUndefined; |
| 2361 } | 2372 } |
| 2362 | 2373 |
| 2363 EmitCall(expr, convert_mode); | 2374 EmitCall(expr, convert_mode); |
| 2364 } | 2375 } |
| 2365 | 2376 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2382 PushOperands(scratch, r3, r3, scratch); | 2393 PushOperands(scratch, r3, r3, scratch); |
| 2383 PushOperand(key->value()); | 2394 PushOperand(key->value()); |
| 2384 | 2395 |
| 2385 // Stack here: | 2396 // Stack here: |
| 2386 // - home_object | 2397 // - home_object |
| 2387 // - this (receiver) | 2398 // - this (receiver) |
| 2388 // - this (receiver) <-- LoadFromSuper will pop here and below. | 2399 // - this (receiver) <-- LoadFromSuper will pop here and below. |
| 2389 // - home_object | 2400 // - home_object |
| 2390 // - key | 2401 // - key |
| 2391 CallRuntimeWithOperands(Runtime::kLoadFromSuper); | 2402 CallRuntimeWithOperands(Runtime::kLoadFromSuper); |
| 2392 PrepareForBailoutForId(prop->LoadId(), TOS_REG); | 2403 PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
| 2393 | 2404 |
| 2394 // Replace home_object with target function. | 2405 // Replace home_object with target function. |
| 2395 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2406 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 2396 | 2407 |
| 2397 // Stack here: | 2408 // Stack here: |
| 2398 // - target function | 2409 // - target function |
| 2399 // - this (receiver) | 2410 // - this (receiver) |
| 2400 EmitCall(expr); | 2411 EmitCall(expr); |
| 2401 } | 2412 } |
| 2402 | 2413 |
| 2403 | 2414 |
| 2404 // Code common for calls using the IC. | 2415 // Code common for calls using the IC. |
| 2405 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, Expression* key) { | 2416 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, Expression* key) { |
| 2406 // Load the key. | 2417 // Load the key. |
| 2407 VisitForAccumulatorValue(key); | 2418 VisitForAccumulatorValue(key); |
| 2408 | 2419 |
| 2409 Expression* callee = expr->expression(); | 2420 Expression* callee = expr->expression(); |
| 2410 | 2421 |
| 2411 // Load the function from the receiver. | 2422 // Load the function from the receiver. |
| 2412 DCHECK(callee->IsProperty()); | 2423 DCHECK(callee->IsProperty()); |
| 2413 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 2424 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
| 2414 __ Move(LoadDescriptor::NameRegister(), r3); | 2425 __ Move(LoadDescriptor::NameRegister(), r3); |
| 2415 EmitKeyedPropertyLoad(callee->AsProperty()); | 2426 EmitKeyedPropertyLoad(callee->AsProperty()); |
| 2416 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); | 2427 PrepareForBailoutForId(callee->AsProperty()->LoadId(), |
| 2428 BailoutState::TOS_REGISTER); |
| 2417 | 2429 |
| 2418 // Push the target function under the receiver. | 2430 // Push the target function under the receiver. |
| 2419 __ LoadP(ip, MemOperand(sp, 0)); | 2431 __ LoadP(ip, MemOperand(sp, 0)); |
| 2420 PushOperand(ip); | 2432 PushOperand(ip); |
| 2421 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2433 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 2422 | 2434 |
| 2423 EmitCall(expr, ConvertReceiverMode::kNotNullOrUndefined); | 2435 EmitCall(expr, ConvertReceiverMode::kNotNullOrUndefined); |
| 2424 } | 2436 } |
| 2425 | 2437 |
| 2426 | 2438 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2440 PushOperands(scratch, r3, r3, scratch); | 2452 PushOperands(scratch, r3, r3, scratch); |
| 2441 VisitForStackValue(prop->key()); | 2453 VisitForStackValue(prop->key()); |
| 2442 | 2454 |
| 2443 // Stack here: | 2455 // Stack here: |
| 2444 // - home_object | 2456 // - home_object |
| 2445 // - this (receiver) | 2457 // - this (receiver) |
| 2446 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. | 2458 // - this (receiver) <-- LoadKeyedFromSuper will pop here and below. |
| 2447 // - home_object | 2459 // - home_object |
| 2448 // - key | 2460 // - key |
| 2449 CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper); | 2461 CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper); |
| 2450 PrepareForBailoutForId(prop->LoadId(), TOS_REG); | 2462 PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
| 2451 | 2463 |
| 2452 // Replace home_object with target function. | 2464 // Replace home_object with target function. |
| 2453 __ StoreP(r3, MemOperand(sp, kPointerSize)); | 2465 __ StoreP(r3, MemOperand(sp, kPointerSize)); |
| 2454 | 2466 |
| 2455 // Stack here: | 2467 // Stack here: |
| 2456 // - target function | 2468 // - target function |
| 2457 // - this (receiver) | 2469 // - this (receiver) |
| 2458 EmitCall(expr); | 2470 EmitCall(expr); |
| 2459 } | 2471 } |
| 2460 | 2472 |
| 2461 | 2473 |
| 2462 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { | 2474 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
| 2463 // Load the arguments. | 2475 // Load the arguments. |
| 2464 ZoneList<Expression*>* args = expr->arguments(); | 2476 ZoneList<Expression*>* args = expr->arguments(); |
| 2465 int arg_count = args->length(); | 2477 int arg_count = args->length(); |
| 2466 for (int i = 0; i < arg_count; i++) { | 2478 for (int i = 0; i < arg_count; i++) { |
| 2467 VisitForStackValue(args->at(i)); | 2479 VisitForStackValue(args->at(i)); |
| 2468 } | 2480 } |
| 2469 | 2481 |
| 2470 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | 2482 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
| 2471 SetCallPosition(expr, expr->tail_call_mode()); | 2483 SetCallPosition(expr, expr->tail_call_mode()); |
| 2472 if (expr->tail_call_mode() == TailCallMode::kAllow) { | 2484 if (expr->tail_call_mode() == TailCallMode::kAllow) { |
| 2473 if (FLAG_trace) { | 2485 if (FLAG_trace) { |
| 2474 __ CallRuntime(Runtime::kTraceTailCall); | 2486 __ CallRuntime(Runtime::kTraceTailCall); |
| 2475 } | 2487 } |
| 2476 // Update profiling counters before the tail call since we will | 2488 // Update profiling counters before the tail call since we will |
| 2477 // not return to this function. | 2489 // not return to this function. |
| 2478 EmitProfilingCounterHandlingForReturnSequence(true); | 2490 EmitProfilingCounterHandlingForReturnSequence(true); |
| 2479 } | 2491 } |
| 2480 Handle<Code> ic = | 2492 Handle<Code> ic = |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2529 // Generate code for loading from variables potentially shadowed by | 2541 // Generate code for loading from variables potentially shadowed by |
| 2530 // eval-introduced variables. | 2542 // eval-introduced variables. |
| 2531 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); | 2543 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); |
| 2532 | 2544 |
| 2533 __ bind(&slow); | 2545 __ bind(&slow); |
| 2534 // Call the runtime to find the function to call (returned in r3) and | 2546 // Call the runtime to find the function to call (returned in r3) and |
| 2535 // the object holding it (returned in r4). | 2547 // the object holding it (returned in r4). |
| 2536 __ Push(callee->name()); | 2548 __ Push(callee->name()); |
| 2537 __ CallRuntime(Runtime::kLoadLookupSlotForCall); | 2549 __ CallRuntime(Runtime::kLoadLookupSlotForCall); |
| 2538 PushOperands(r3, r4); // Function, receiver. | 2550 PushOperands(r3, r4); // Function, receiver. |
| 2539 PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); | 2551 PrepareForBailoutForId(expr->LookupId(), BailoutState::NO_REGISTERS); |
| 2540 | 2552 |
| 2541 // If fast case code has been generated, emit code to push the function | 2553 // If fast case code has been generated, emit code to push the function |
| 2542 // and receiver and have the slow path jump around this code. | 2554 // and receiver and have the slow path jump around this code. |
| 2543 if (done.is_linked()) { | 2555 if (done.is_linked()) { |
| 2544 Label call; | 2556 Label call; |
| 2545 __ b(&call); | 2557 __ b(&call); |
| 2546 __ bind(&done); | 2558 __ bind(&done); |
| 2547 // Push function. | 2559 // Push function. |
| 2548 __ push(r3); | 2560 __ push(r3); |
| 2549 // Pass undefined as the receiver, which is the WithBaseObject of a | 2561 // Pass undefined as the receiver, which is the WithBaseObject of a |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2578 | 2590 |
| 2579 // Push a copy of the function (found below the arguments) and | 2591 // Push a copy of the function (found below the arguments) and |
| 2580 // resolve eval. | 2592 // resolve eval. |
| 2581 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2593 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
| 2582 __ push(r4); | 2594 __ push(r4); |
| 2583 EmitResolvePossiblyDirectEval(expr); | 2595 EmitResolvePossiblyDirectEval(expr); |
| 2584 | 2596 |
| 2585 // Touch up the stack with the resolved function. | 2597 // Touch up the stack with the resolved function. |
| 2586 __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2598 __ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
| 2587 | 2599 |
| 2588 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); | 2600 PrepareForBailoutForId(expr->EvalId(), BailoutState::NO_REGISTERS); |
| 2589 | 2601 |
| 2590 // Record source position for debugger. | 2602 // Record source position for debugger. |
| 2591 SetCallPosition(expr); | 2603 SetCallPosition(expr); |
| 2592 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); | 2604 __ LoadP(r4, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
| 2593 __ mov(r3, Operand(arg_count)); | 2605 __ mov(r3, Operand(arg_count)); |
| 2594 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kAny, | 2606 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kAny, |
| 2595 expr->tail_call_mode()), | 2607 expr->tail_call_mode()), |
| 2596 RelocInfo::CODE_TARGET); | 2608 RelocInfo::CODE_TARGET); |
| 2597 OperandStackDepthDecrement(arg_count + 1); | 2609 OperandStackDepthDecrement(arg_count + 1); |
| 2598 RecordJSReturnSite(expr); | 2610 RecordJSReturnSite(expr); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2628 __ mov(r3, Operand(arg_count)); | 2640 __ mov(r3, Operand(arg_count)); |
| 2629 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); | 2641 __ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0); |
| 2630 | 2642 |
| 2631 // Record call targets in unoptimized code. | 2643 // Record call targets in unoptimized code. |
| 2632 __ EmitLoadTypeFeedbackVector(r5); | 2644 __ EmitLoadTypeFeedbackVector(r5); |
| 2633 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); | 2645 __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); |
| 2634 | 2646 |
| 2635 CallConstructStub stub(isolate()); | 2647 CallConstructStub stub(isolate()); |
| 2636 __ Call(stub.GetCode(), RelocInfo::CODE_TARGET); | 2648 __ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 2637 OperandStackDepthDecrement(arg_count + 1); | 2649 OperandStackDepthDecrement(arg_count + 1); |
| 2638 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2650 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
| 2639 RestoreContext(); | 2651 RestoreContext(); |
| 2640 context()->Plug(r3); | 2652 context()->Plug(r3); |
| 2641 } | 2653 } |
| 2642 | 2654 |
| 2643 | 2655 |
| 2644 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 2656 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
| 2645 SuperCallReference* super_call_ref = | 2657 SuperCallReference* super_call_ref = |
| 2646 expr->expression()->AsSuperCallReference(); | 2658 expr->expression()->AsSuperCallReference(); |
| 2647 DCHECK_NOT_NULL(super_call_ref); | 2659 DCHECK_NOT_NULL(super_call_ref); |
| 2648 | 2660 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3050 } | 3062 } |
| 3051 | 3063 |
| 3052 | 3064 |
| 3053 void FullCodeGenerator::EmitCall(CallRuntime* expr) { | 3065 void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
| 3054 ZoneList<Expression*>* args = expr->arguments(); | 3066 ZoneList<Expression*>* args = expr->arguments(); |
| 3055 DCHECK_LE(2, args->length()); | 3067 DCHECK_LE(2, args->length()); |
| 3056 // Push target, receiver and arguments onto the stack. | 3068 // Push target, receiver and arguments onto the stack. |
| 3057 for (Expression* const arg : *args) { | 3069 for (Expression* const arg : *args) { |
| 3058 VisitForStackValue(arg); | 3070 VisitForStackValue(arg); |
| 3059 } | 3071 } |
| 3060 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | 3072 PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
| 3061 // Move target to r4. | 3073 // Move target to r4. |
| 3062 int const argc = args->length() - 2; | 3074 int const argc = args->length() - 2; |
| 3063 __ LoadP(r4, MemOperand(sp, (argc + 1) * kPointerSize)); | 3075 __ LoadP(r4, MemOperand(sp, (argc + 1) * kPointerSize)); |
| 3064 // Call the target. | 3076 // Call the target. |
| 3065 __ mov(r3, Operand(argc)); | 3077 __ mov(r3, Operand(argc)); |
| 3066 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 3078 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 3067 OperandStackDepthDecrement(argc + 1); | 3079 OperandStackDepthDecrement(argc + 1); |
| 3068 RestoreContext(); | 3080 RestoreContext(); |
| 3069 // Discard the function left on TOS. | 3081 // Discard the function left on TOS. |
| 3070 context()->DropAndPlug(1, r3); | 3082 context()->DropAndPlug(1, r3); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 // We handle value contexts explicitly rather than simply visiting | 3263 // We handle value contexts explicitly rather than simply visiting |
| 3252 // for control and plugging the control flow into the context, | 3264 // for control and plugging the control flow into the context, |
| 3253 // because we need to prepare a pair of extra administrative AST ids | 3265 // because we need to prepare a pair of extra administrative AST ids |
| 3254 // for the optimizing compiler. | 3266 // for the optimizing compiler. |
| 3255 DCHECK(context()->IsAccumulatorValue() || context()->IsStackValue()); | 3267 DCHECK(context()->IsAccumulatorValue() || context()->IsStackValue()); |
| 3256 Label materialize_true, materialize_false, done; | 3268 Label materialize_true, materialize_false, done; |
| 3257 VisitForControl(expr->expression(), &materialize_false, | 3269 VisitForControl(expr->expression(), &materialize_false, |
| 3258 &materialize_true, &materialize_true); | 3270 &materialize_true, &materialize_true); |
| 3259 if (!context()->IsAccumulatorValue()) OperandStackDepthIncrement(1); | 3271 if (!context()->IsAccumulatorValue()) OperandStackDepthIncrement(1); |
| 3260 __ bind(&materialize_true); | 3272 __ bind(&materialize_true); |
| 3261 PrepareForBailoutForId(expr->MaterializeTrueId(), NO_REGISTERS); | 3273 PrepareForBailoutForId(expr->MaterializeTrueId(), |
| 3274 BailoutState::NO_REGISTERS); |
| 3262 __ LoadRoot(r3, Heap::kTrueValueRootIndex); | 3275 __ LoadRoot(r3, Heap::kTrueValueRootIndex); |
| 3263 if (context()->IsStackValue()) __ push(r3); | 3276 if (context()->IsStackValue()) __ push(r3); |
| 3264 __ b(&done); | 3277 __ b(&done); |
| 3265 __ bind(&materialize_false); | 3278 __ bind(&materialize_false); |
| 3266 PrepareForBailoutForId(expr->MaterializeFalseId(), NO_REGISTERS); | 3279 PrepareForBailoutForId(expr->MaterializeFalseId(), |
| 3280 BailoutState::NO_REGISTERS); |
| 3267 __ LoadRoot(r3, Heap::kFalseValueRootIndex); | 3281 __ LoadRoot(r3, Heap::kFalseValueRootIndex); |
| 3268 if (context()->IsStackValue()) __ push(r3); | 3282 if (context()->IsStackValue()) __ push(r3); |
| 3269 __ bind(&done); | 3283 __ bind(&done); |
| 3270 } | 3284 } |
| 3271 break; | 3285 break; |
| 3272 } | 3286 } |
| 3273 | 3287 |
| 3274 case Token::TYPEOF: { | 3288 case Token::TYPEOF: { |
| 3275 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 3289 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 3276 { | 3290 { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3356 } | 3370 } |
| 3357 | 3371 |
| 3358 case VARIABLE: | 3372 case VARIABLE: |
| 3359 UNREACHABLE(); | 3373 UNREACHABLE(); |
| 3360 } | 3374 } |
| 3361 } | 3375 } |
| 3362 | 3376 |
| 3363 // We need a second deoptimization point after loading the value | 3377 // We need a second deoptimization point after loading the value |
| 3364 // in case evaluating the property load my have a side effect. | 3378 // in case evaluating the property load my have a side effect. |
| 3365 if (assign_type == VARIABLE) { | 3379 if (assign_type == VARIABLE) { |
| 3366 PrepareForBailout(expr->expression(), TOS_REG); | 3380 PrepareForBailout(expr->expression(), BailoutState::TOS_REGISTER); |
| 3367 } else { | 3381 } else { |
| 3368 PrepareForBailoutForId(prop->LoadId(), TOS_REG); | 3382 PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
| 3369 } | 3383 } |
| 3370 | 3384 |
| 3371 // Inline smi case if we are in a loop. | 3385 // Inline smi case if we are in a loop. |
| 3372 Label stub_call, done; | 3386 Label stub_call, done; |
| 3373 JumpPatchSite patch_site(masm_); | 3387 JumpPatchSite patch_site(masm_); |
| 3374 | 3388 |
| 3375 int count_value = expr->op() == Token::INC ? 1 : -1; | 3389 int count_value = expr->op() == Token::INC ? 1 : -1; |
| 3376 if (ShouldInlineSmiCase(expr->op())) { | 3390 if (ShouldInlineSmiCase(expr->op())) { |
| 3377 Label slow; | 3391 Label slow; |
| 3378 patch_site.EmitJumpIfNotSmi(r3, &slow); | 3392 patch_site.EmitJumpIfNotSmi(r3, &slow); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3410 __ BranchOnNoOverflow(&done); | 3424 __ BranchOnNoOverflow(&done); |
| 3411 // Call stub. Undo operation first. | 3425 // Call stub. Undo operation first. |
| 3412 __ sub(r3, r3, scratch1); | 3426 __ sub(r3, r3, scratch1); |
| 3413 __ b(&stub_call); | 3427 __ b(&stub_call); |
| 3414 __ bind(&slow); | 3428 __ bind(&slow); |
| 3415 } | 3429 } |
| 3416 | 3430 |
| 3417 // Convert old value into a number. | 3431 // Convert old value into a number. |
| 3418 ToNumberStub convert_stub(isolate()); | 3432 ToNumberStub convert_stub(isolate()); |
| 3419 __ CallStub(&convert_stub); | 3433 __ CallStub(&convert_stub); |
| 3420 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3434 PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER); |
| 3421 | 3435 |
| 3422 // Save result for postfix expressions. | 3436 // Save result for postfix expressions. |
| 3423 if (expr->is_postfix()) { | 3437 if (expr->is_postfix()) { |
| 3424 if (!context()->IsEffect()) { | 3438 if (!context()->IsEffect()) { |
| 3425 // Save the result on the stack. If we have a named or keyed property | 3439 // Save the result on the stack. If we have a named or keyed property |
| 3426 // we store the result under the receiver that is currently on top | 3440 // we store the result under the receiver that is currently on top |
| 3427 // of the stack. | 3441 // of the stack. |
| 3428 switch (assign_type) { | 3442 switch (assign_type) { |
| 3429 case VARIABLE: | 3443 case VARIABLE: |
| 3430 PushOperand(r3); | 3444 PushOperand(r3); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3457 __ bind(&done); | 3471 __ bind(&done); |
| 3458 | 3472 |
| 3459 // Store the value returned in r3. | 3473 // Store the value returned in r3. |
| 3460 switch (assign_type) { | 3474 switch (assign_type) { |
| 3461 case VARIABLE: | 3475 case VARIABLE: |
| 3462 if (expr->is_postfix()) { | 3476 if (expr->is_postfix()) { |
| 3463 { | 3477 { |
| 3464 EffectContext context(this); | 3478 EffectContext context(this); |
| 3465 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3479 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3466 Token::ASSIGN, expr->CountSlot()); | 3480 Token::ASSIGN, expr->CountSlot()); |
| 3467 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3481 PrepareForBailoutForId(expr->AssignmentId(), |
| 3482 BailoutState::TOS_REGISTER); |
| 3468 context.Plug(r3); | 3483 context.Plug(r3); |
| 3469 } | 3484 } |
| 3470 // For all contexts except EffectConstant We have the result on | 3485 // For all contexts except EffectConstant We have the result on |
| 3471 // top of the stack. | 3486 // top of the stack. |
| 3472 if (!context()->IsEffect()) { | 3487 if (!context()->IsEffect()) { |
| 3473 context()->PlugTOS(); | 3488 context()->PlugTOS(); |
| 3474 } | 3489 } |
| 3475 } else { | 3490 } else { |
| 3476 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3491 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3477 Token::ASSIGN, expr->CountSlot()); | 3492 Token::ASSIGN, expr->CountSlot()); |
| 3478 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3493 PrepareForBailoutForId(expr->AssignmentId(), |
| 3494 BailoutState::TOS_REGISTER); |
| 3479 context()->Plug(r3); | 3495 context()->Plug(r3); |
| 3480 } | 3496 } |
| 3481 break; | 3497 break; |
| 3482 case NAMED_PROPERTY: { | 3498 case NAMED_PROPERTY: { |
| 3483 __ mov(StoreDescriptor::NameRegister(), | 3499 __ mov(StoreDescriptor::NameRegister(), |
| 3484 Operand(prop->key()->AsLiteral()->value())); | 3500 Operand(prop->key()->AsLiteral()->value())); |
| 3485 PopOperand(StoreDescriptor::ReceiverRegister()); | 3501 PopOperand(StoreDescriptor::ReceiverRegister()); |
| 3486 EmitLoadStoreICSlot(expr->CountSlot()); | 3502 EmitLoadStoreICSlot(expr->CountSlot()); |
| 3487 CallStoreIC(); | 3503 CallStoreIC(); |
| 3488 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3504 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 3489 if (expr->is_postfix()) { | 3505 if (expr->is_postfix()) { |
| 3490 if (!context()->IsEffect()) { | 3506 if (!context()->IsEffect()) { |
| 3491 context()->PlugTOS(); | 3507 context()->PlugTOS(); |
| 3492 } | 3508 } |
| 3493 } else { | 3509 } else { |
| 3494 context()->Plug(r3); | 3510 context()->Plug(r3); |
| 3495 } | 3511 } |
| 3496 break; | 3512 break; |
| 3497 } | 3513 } |
| 3498 case NAMED_SUPER_PROPERTY: { | 3514 case NAMED_SUPER_PROPERTY: { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3517 } | 3533 } |
| 3518 break; | 3534 break; |
| 3519 } | 3535 } |
| 3520 case KEYED_PROPERTY: { | 3536 case KEYED_PROPERTY: { |
| 3521 PopOperands(StoreDescriptor::ReceiverRegister(), | 3537 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 3522 StoreDescriptor::NameRegister()); | 3538 StoreDescriptor::NameRegister()); |
| 3523 Handle<Code> ic = | 3539 Handle<Code> ic = |
| 3524 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | 3540 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 3525 EmitLoadStoreICSlot(expr->CountSlot()); | 3541 EmitLoadStoreICSlot(expr->CountSlot()); |
| 3526 CallIC(ic); | 3542 CallIC(ic); |
| 3527 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3543 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 3528 if (expr->is_postfix()) { | 3544 if (expr->is_postfix()) { |
| 3529 if (!context()->IsEffect()) { | 3545 if (!context()->IsEffect()) { |
| 3530 context()->PlugTOS(); | 3546 context()->PlugTOS(); |
| 3531 } | 3547 } |
| 3532 } else { | 3548 } else { |
| 3533 context()->Plug(r3); | 3549 context()->Plug(r3); |
| 3534 } | 3550 } |
| 3535 break; | 3551 break; |
| 3536 } | 3552 } |
| 3537 } | 3553 } |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3894 | 3910 |
| 3895 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3911 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3896 | 3912 |
| 3897 DCHECK(interrupt_address == | 3913 DCHECK(interrupt_address == |
| 3898 isolate->builtins()->OnStackReplacement()->entry()); | 3914 isolate->builtins()->OnStackReplacement()->entry()); |
| 3899 return ON_STACK_REPLACEMENT; | 3915 return ON_STACK_REPLACEMENT; |
| 3900 } | 3916 } |
| 3901 } // namespace internal | 3917 } // namespace internal |
| 3902 } // namespace v8 | 3918 } // namespace v8 |
| 3903 #endif // V8_TARGET_ARCH_PPC | 3919 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |