OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 } | 1090 } |
1091 | 1091 |
1092 __ Bind(nested_statement.break_label()); | 1092 __ Bind(nested_statement.break_label()); |
1093 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1093 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1094 } | 1094 } |
1095 | 1095 |
1096 | 1096 |
1097 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 1097 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
1098 ASM_LOCATION("FullCodeGenerator::VisitForInStatement"); | 1098 ASM_LOCATION("FullCodeGenerator::VisitForInStatement"); |
1099 Comment cmnt(masm_, "[ ForInStatement"); | 1099 Comment cmnt(masm_, "[ ForInStatement"); |
1100 int slot = stmt->ForInFeedbackSlot(); | 1100 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
1101 // TODO(all): This visitor probably needs better comments and a revisit. | 1101 // TODO(all): This visitor probably needs better comments and a revisit. |
1102 SetStatementPosition(stmt); | 1102 SetStatementPosition(stmt); |
1103 | 1103 |
1104 Label loop, exit; | 1104 Label loop, exit; |
1105 ForIn loop_statement(this, stmt); | 1105 ForIn loop_statement(this, stmt); |
1106 increment_loop_depth(); | 1106 increment_loop_depth(); |
1107 | 1107 |
1108 // Get the object to enumerate over. If the object is null or undefined, skip | 1108 // Get the object to enumerate over. If the object is null or undefined, skip |
1109 // over the loop. See ECMA-262 version 5, section 12.6.4. | 1109 // over the loop. See ECMA-262 version 5, section 12.6.4. |
1110 VisitForAccumulatorValue(stmt->enumerable()); | 1110 VisitForAccumulatorValue(stmt->enumerable()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 | 1174 |
1175 __ Bind(&no_descriptors); | 1175 __ Bind(&no_descriptors); |
1176 __ Drop(1); | 1176 __ Drop(1); |
1177 __ B(&exit); | 1177 __ B(&exit); |
1178 | 1178 |
1179 // We got a fixed array in register x0. Iterate through that. | 1179 // We got a fixed array in register x0. Iterate through that. |
1180 __ Bind(&fixed_array); | 1180 __ Bind(&fixed_array); |
1181 | 1181 |
1182 __ LoadObject(x1, FeedbackVector()); | 1182 __ LoadObject(x1, FeedbackVector()); |
1183 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1183 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1184 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot))); | 1184 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(slot.ToInt()))); |
1185 | 1185 |
1186 __ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check. | 1186 __ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check. |
1187 __ Peek(x10, 0); // Get enumerated object. | 1187 __ Peek(x10, 0); // Get enumerated object. |
1188 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1188 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1189 // TODO(all): similar check was done already. Can we avoid it here? | 1189 // TODO(all): similar check was done already. Can we avoid it here? |
1190 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE); | 1190 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE); |
1191 DCHECK(Smi::FromInt(0) == 0); | 1191 DCHECK(Smi::FromInt(0) == 0); |
1192 __ CzeroX(x1, le); // Zero indicates proxy. | 1192 __ CzeroX(x1, le); // Zero indicates proxy. |
1193 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); | 1193 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); |
1194 // Smi and array, fixed array length (as smi) and initial index. | 1194 // Smi and array, fixed array length (as smi) and initial index. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 Comment cnmt(masm_, "[ SuperReference "); | 1345 Comment cnmt(masm_, "[ SuperReference "); |
1346 | 1346 |
1347 __ ldr(LoadDescriptor::ReceiverRegister(), | 1347 __ ldr(LoadDescriptor::ReceiverRegister(), |
1348 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1348 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1349 | 1349 |
1350 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); | 1350 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
1351 __ Mov(LoadDescriptor::NameRegister(), Operand(home_object_symbol)); | 1351 __ Mov(LoadDescriptor::NameRegister(), Operand(home_object_symbol)); |
1352 | 1352 |
1353 if (FLAG_vector_ics) { | 1353 if (FLAG_vector_ics) { |
1354 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 1354 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
1355 Smi::FromInt(expr->HomeObjectFeedbackSlot())); | 1355 SmiFromSlot(expr->HomeObjectFeedbackSlot())); |
1356 CallLoadIC(NOT_CONTEXTUAL); | 1356 CallLoadIC(NOT_CONTEXTUAL); |
1357 } else { | 1357 } else { |
1358 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); | 1358 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); |
1359 } | 1359 } |
1360 | 1360 |
1361 __ Mov(x10, Operand(isolate()->factory()->undefined_value())); | 1361 __ Mov(x10, Operand(isolate()->factory()->undefined_value())); |
1362 __ cmp(x0, x10); | 1362 __ cmp(x0, x10); |
1363 Label done; | 1363 Label done; |
1364 __ b(&done, ne); | 1364 __ b(&done, ne); |
1365 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1365 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 // Load next context in chain. | 1407 // Load next context in chain. |
1408 __ Ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); | 1408 __ Ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX)); |
1409 __ B(&loop); | 1409 __ B(&loop); |
1410 __ Bind(&fast); | 1410 __ Bind(&fast); |
1411 } | 1411 } |
1412 | 1412 |
1413 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 1413 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
1414 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); | 1414 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); |
1415 if (FLAG_vector_ics) { | 1415 if (FLAG_vector_ics) { |
1416 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 1416 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
1417 Smi::FromInt(proxy->VariableFeedbackSlot())); | 1417 SmiFromSlot(proxy->VariableFeedbackSlot())); |
1418 } | 1418 } |
1419 | 1419 |
1420 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) ? NOT_CONTEXTUAL | 1420 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) ? NOT_CONTEXTUAL |
1421 : CONTEXTUAL; | 1421 : CONTEXTUAL; |
1422 CallLoadIC(mode); | 1422 CallLoadIC(mode); |
1423 } | 1423 } |
1424 | 1424 |
1425 | 1425 |
1426 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1426 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
1427 Label* slow) { | 1427 Label* slow) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 | 1492 |
1493 // Three cases: global variables, lookup variables, and all other types of | 1493 // Three cases: global variables, lookup variables, and all other types of |
1494 // variables. | 1494 // variables. |
1495 switch (var->location()) { | 1495 switch (var->location()) { |
1496 case Variable::UNALLOCATED: { | 1496 case Variable::UNALLOCATED: { |
1497 Comment cmnt(masm_, "Global variable"); | 1497 Comment cmnt(masm_, "Global variable"); |
1498 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 1498 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
1499 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); | 1499 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
1500 if (FLAG_vector_ics) { | 1500 if (FLAG_vector_ics) { |
1501 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 1501 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
1502 Smi::FromInt(proxy->VariableFeedbackSlot())); | 1502 SmiFromSlot(proxy->VariableFeedbackSlot())); |
1503 } | 1503 } |
1504 CallLoadIC(CONTEXTUAL); | 1504 CallLoadIC(CONTEXTUAL); |
1505 context()->Plug(x0); | 1505 context()->Plug(x0); |
1506 break; | 1506 break; |
1507 } | 1507 } |
1508 | 1508 |
1509 case Variable::PARAMETER: | 1509 case Variable::PARAMETER: |
1510 case Variable::LOCAL: | 1510 case Variable::LOCAL: |
1511 case Variable::CONTEXT: { | 1511 case Variable::CONTEXT: { |
1512 Comment cmnt(masm_, var->IsContextSlot() | 1512 Comment cmnt(masm_, var->IsContextSlot() |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 | 2005 |
2006 | 2006 |
2007 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2007 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2008 SetSourcePosition(prop->position()); | 2008 SetSourcePosition(prop->position()); |
2009 Literal* key = prop->key()->AsLiteral(); | 2009 Literal* key = prop->key()->AsLiteral(); |
2010 DCHECK(!prop->IsSuperAccess()); | 2010 DCHECK(!prop->IsSuperAccess()); |
2011 | 2011 |
2012 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); | 2012 __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); |
2013 if (FLAG_vector_ics) { | 2013 if (FLAG_vector_ics) { |
2014 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 2014 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
2015 Smi::FromInt(prop->PropertyFeedbackSlot())); | 2015 SmiFromSlot(prop->PropertyFeedbackSlot())); |
2016 CallLoadIC(NOT_CONTEXTUAL); | 2016 CallLoadIC(NOT_CONTEXTUAL); |
2017 } else { | 2017 } else { |
2018 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2018 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
2019 } | 2019 } |
2020 } | 2020 } |
2021 | 2021 |
2022 | 2022 |
2023 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2023 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2024 // Stack: receiver, home_object. | 2024 // Stack: receiver, home_object. |
2025 SetSourcePosition(prop->position()); | 2025 SetSourcePosition(prop->position()); |
2026 Literal* key = prop->key()->AsLiteral(); | 2026 Literal* key = prop->key()->AsLiteral(); |
2027 DCHECK(!key->value()->IsSmi()); | 2027 DCHECK(!key->value()->IsSmi()); |
2028 DCHECK(prop->IsSuperAccess()); | 2028 DCHECK(prop->IsSuperAccess()); |
2029 | 2029 |
2030 __ Push(key->value()); | 2030 __ Push(key->value()); |
2031 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2031 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
2032 } | 2032 } |
2033 | 2033 |
2034 | 2034 |
2035 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2035 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2036 SetSourcePosition(prop->position()); | 2036 SetSourcePosition(prop->position()); |
2037 // Call keyed load IC. It has arguments key and receiver in r0 and r1. | 2037 // Call keyed load IC. It has arguments key and receiver in r0 and r1. |
2038 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2038 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2039 if (FLAG_vector_ics) { | 2039 if (FLAG_vector_ics) { |
2040 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 2040 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
2041 Smi::FromInt(prop->PropertyFeedbackSlot())); | 2041 SmiFromSlot(prop->PropertyFeedbackSlot())); |
2042 CallIC(ic); | 2042 CallIC(ic); |
2043 } else { | 2043 } else { |
2044 CallIC(ic, prop->PropertyFeedbackId()); | 2044 CallIC(ic, prop->PropertyFeedbackId()); |
2045 } | 2045 } |
2046 } | 2046 } |
2047 | 2047 |
2048 | 2048 |
2049 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2049 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2050 // Stack: receiver, home_object, key. | 2050 // Stack: receiver, home_object, key. |
2051 SetSourcePosition(prop->position()); | 2051 SetSourcePosition(prop->position()); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 { PreservePositionScope scope(masm()->positions_recorder()); | 2550 { PreservePositionScope scope(masm()->positions_recorder()); |
2551 for (int i = 0; i < arg_count; i++) { | 2551 for (int i = 0; i < arg_count; i++) { |
2552 VisitForStackValue(args->at(i)); | 2552 VisitForStackValue(args->at(i)); |
2553 } | 2553 } |
2554 } | 2554 } |
2555 // Record source position of the IC call. | 2555 // Record source position of the IC call. |
2556 SetSourcePosition(expr->position()); | 2556 SetSourcePosition(expr->position()); |
2557 | 2557 |
2558 Handle<Code> ic = CallIC::initialize_stub( | 2558 Handle<Code> ic = CallIC::initialize_stub( |
2559 isolate(), arg_count, call_type); | 2559 isolate(), arg_count, call_type); |
2560 __ Mov(x3, Smi::FromInt(expr->CallFeedbackSlot())); | 2560 __ Mov(x3, SmiFromSlot(expr->CallFeedbackSlot())); |
2561 __ Peek(x1, (arg_count + 1) * kXRegSize); | 2561 __ Peek(x1, (arg_count + 1) * kXRegSize); |
2562 // Don't assign a type feedback id to the IC, since type feedback is provided | 2562 // Don't assign a type feedback id to the IC, since type feedback is provided |
2563 // by the vector above. | 2563 // by the vector above. |
2564 CallIC(ic); | 2564 CallIC(ic); |
2565 | 2565 |
2566 RecordJSReturnSite(expr); | 2566 RecordJSReturnSite(expr); |
2567 // Restore context register. | 2567 // Restore context register. |
2568 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2568 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2569 context()->DropAndPlug(1, x0); | 2569 context()->DropAndPlug(1, x0); |
2570 } | 2570 } |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 // constructor invocation. | 2754 // constructor invocation. |
2755 SetSourcePosition(expr->position()); | 2755 SetSourcePosition(expr->position()); |
2756 | 2756 |
2757 // Load function and argument count into x1 and x0. | 2757 // Load function and argument count into x1 and x0. |
2758 __ Mov(x0, arg_count); | 2758 __ Mov(x0, arg_count); |
2759 __ Peek(x1, arg_count * kXRegSize); | 2759 __ Peek(x1, arg_count * kXRegSize); |
2760 | 2760 |
2761 // Record call targets in unoptimized code. | 2761 // Record call targets in unoptimized code. |
2762 if (FLAG_pretenuring_call_new) { | 2762 if (FLAG_pretenuring_call_new) { |
2763 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | 2763 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); |
2764 DCHECK(expr->AllocationSiteFeedbackSlot() == | 2764 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == |
2765 expr->CallNewFeedbackSlot() + 1); | 2765 expr->CallNewFeedbackSlot().ToInt() + 1); |
2766 } | 2766 } |
2767 | 2767 |
2768 __ LoadObject(x2, FeedbackVector()); | 2768 __ LoadObject(x2, FeedbackVector()); |
2769 __ Mov(x3, Smi::FromInt(expr->CallNewFeedbackSlot())); | 2769 __ Mov(x3, SmiFromSlot(expr->CallNewFeedbackSlot())); |
2770 | 2770 |
2771 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 2771 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
2772 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 2772 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
2773 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 2773 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
2774 context()->Plug(x0); | 2774 context()->Plug(x0); |
2775 } | 2775 } |
2776 | 2776 |
2777 | 2777 |
2778 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2778 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
2779 ZoneList<Expression*>* args = expr->arguments(); | 2779 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3961 __ Ldr(x10, GlobalObjectMemOperand()); | 3961 __ Ldr(x10, GlobalObjectMemOperand()); |
3962 __ Ldr(LoadDescriptor::ReceiverRegister(), | 3962 __ Ldr(LoadDescriptor::ReceiverRegister(), |
3963 FieldMemOperand(x10, GlobalObject::kBuiltinsOffset)); | 3963 FieldMemOperand(x10, GlobalObject::kBuiltinsOffset)); |
3964 __ Push(LoadDescriptor::ReceiverRegister()); | 3964 __ Push(LoadDescriptor::ReceiverRegister()); |
3965 | 3965 |
3966 // Load the function from the receiver. | 3966 // Load the function from the receiver. |
3967 Handle<String> name = expr->name(); | 3967 Handle<String> name = expr->name(); |
3968 __ Mov(LoadDescriptor::NameRegister(), Operand(name)); | 3968 __ Mov(LoadDescriptor::NameRegister(), Operand(name)); |
3969 if (FLAG_vector_ics) { | 3969 if (FLAG_vector_ics) { |
3970 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 3970 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
3971 Smi::FromInt(expr->CallRuntimeFeedbackSlot())); | 3971 SmiFromSlot(expr->CallRuntimeFeedbackSlot())); |
3972 CallLoadIC(NOT_CONTEXTUAL); | 3972 CallLoadIC(NOT_CONTEXTUAL); |
3973 } else { | 3973 } else { |
3974 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 3974 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
3975 } | 3975 } |
3976 | 3976 |
3977 // Push the target function under the receiver. | 3977 // Push the target function under the receiver. |
3978 __ Pop(x10); | 3978 __ Pop(x10); |
3979 __ Push(x0, x10); | 3979 __ Push(x0, x10); |
3980 | 3980 |
3981 int arg_count = args->length(); | 3981 int arg_count = args->length(); |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4361 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4361 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
4362 DCHECK(!context()->IsEffect()); | 4362 DCHECK(!context()->IsEffect()); |
4363 DCHECK(!context()->IsTest()); | 4363 DCHECK(!context()->IsTest()); |
4364 VariableProxy* proxy = expr->AsVariableProxy(); | 4364 VariableProxy* proxy = expr->AsVariableProxy(); |
4365 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4365 if (proxy != NULL && proxy->var()->IsUnallocated()) { |
4366 Comment cmnt(masm_, "Global variable"); | 4366 Comment cmnt(masm_, "Global variable"); |
4367 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 4367 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
4368 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); | 4368 __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
4369 if (FLAG_vector_ics) { | 4369 if (FLAG_vector_ics) { |
4370 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 4370 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
4371 Smi::FromInt(proxy->VariableFeedbackSlot())); | 4371 SmiFromSlot(proxy->VariableFeedbackSlot())); |
4372 } | 4372 } |
4373 // Use a regular load, not a contextual load, to avoid a reference | 4373 // Use a regular load, not a contextual load, to avoid a reference |
4374 // error. | 4374 // error. |
4375 CallLoadIC(NOT_CONTEXTUAL); | 4375 CallLoadIC(NOT_CONTEXTUAL); |
4376 PrepareForBailout(expr, TOS_REG); | 4376 PrepareForBailout(expr, TOS_REG); |
4377 context()->Plug(x0); | 4377 context()->Plug(x0); |
4378 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 4378 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
4379 Label done, slow; | 4379 Label done, slow; |
4380 | 4380 |
4381 // Generate code for loading from variables potentially shadowed | 4381 // Generate code for loading from variables potentially shadowed |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4717 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 4717 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
4718 __ Peek(x3, 1 * kPointerSize); // iter | 4718 __ Peek(x3, 1 * kPointerSize); // iter |
4719 __ Push(load_name, x3, x0); // "next", iter, received | 4719 __ Push(load_name, x3, x0); // "next", iter, received |
4720 | 4720 |
4721 // result = receiver[f](arg); | 4721 // result = receiver[f](arg); |
4722 __ Bind(&l_call); | 4722 __ Bind(&l_call); |
4723 __ Peek(load_receiver, 1 * kPointerSize); | 4723 __ Peek(load_receiver, 1 * kPointerSize); |
4724 __ Peek(load_name, 2 * kPointerSize); | 4724 __ Peek(load_name, 2 * kPointerSize); |
4725 if (FLAG_vector_ics) { | 4725 if (FLAG_vector_ics) { |
4726 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 4726 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
4727 Smi::FromInt(expr->KeyedLoadFeedbackSlot())); | 4727 SmiFromSlot(expr->KeyedLoadFeedbackSlot())); |
4728 } | 4728 } |
4729 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 4729 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
4730 CallIC(ic, TypeFeedbackId::None()); | 4730 CallIC(ic, TypeFeedbackId::None()); |
4731 __ Mov(x1, x0); | 4731 __ Mov(x1, x0); |
4732 __ Poke(x1, 2 * kPointerSize); | 4732 __ Poke(x1, 2 * kPointerSize); |
4733 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 4733 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
4734 __ CallStub(&stub); | 4734 __ CallStub(&stub); |
4735 | 4735 |
4736 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 4736 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
4737 __ Drop(1); // The function is still on the stack; drop it. | 4737 __ Drop(1); // The function is still on the stack; drop it. |
4738 | 4738 |
4739 // if (!result.done) goto l_try; | 4739 // if (!result.done) goto l_try; |
4740 __ Bind(&l_loop); | 4740 __ Bind(&l_loop); |
4741 __ Move(load_receiver, x0); | 4741 __ Move(load_receiver, x0); |
4742 | 4742 |
4743 __ Push(load_receiver); // save result | 4743 __ Push(load_receiver); // save result |
4744 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 4744 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
4745 if (FLAG_vector_ics) { | 4745 if (FLAG_vector_ics) { |
4746 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 4746 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
4747 Smi::FromInt(expr->DoneFeedbackSlot())); | 4747 SmiFromSlot(expr->DoneFeedbackSlot())); |
4748 } | 4748 } |
4749 CallLoadIC(NOT_CONTEXTUAL); // x0=result.done | 4749 CallLoadIC(NOT_CONTEXTUAL); // x0=result.done |
4750 // The ToBooleanStub argument (result.done) is in x0. | 4750 // The ToBooleanStub argument (result.done) is in x0. |
4751 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 4751 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
4752 CallIC(bool_ic); | 4752 CallIC(bool_ic); |
4753 __ Cbz(x0, &l_try); | 4753 __ Cbz(x0, &l_try); |
4754 | 4754 |
4755 // result.value | 4755 // result.value |
4756 __ Pop(load_receiver); // result | 4756 __ Pop(load_receiver); // result |
4757 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 4757 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
4758 if (FLAG_vector_ics) { | 4758 if (FLAG_vector_ics) { |
4759 __ Mov(VectorLoadICDescriptor::SlotRegister(), | 4759 __ Mov(VectorLoadICDescriptor::SlotRegister(), |
4760 Smi::FromInt(expr->ValueFeedbackSlot())); | 4760 SmiFromSlot(expr->ValueFeedbackSlot())); |
4761 } | 4761 } |
4762 CallLoadIC(NOT_CONTEXTUAL); // x0=result.value | 4762 CallLoadIC(NOT_CONTEXTUAL); // x0=result.value |
4763 context()->DropAndPlug(2, x0); // drop iter and g | 4763 context()->DropAndPlug(2, x0); // drop iter and g |
4764 break; | 4764 break; |
4765 } | 4765 } |
4766 } | 4766 } |
4767 } | 4767 } |
4768 | 4768 |
4769 | 4769 |
4770 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, | 4770 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5181 return previous_; | 5181 return previous_; |
5182 } | 5182 } |
5183 | 5183 |
5184 | 5184 |
5185 #undef __ | 5185 #undef __ |
5186 | 5186 |
5187 | 5187 |
5188 } } // namespace v8::internal | 5188 } } // namespace v8::internal |
5189 | 5189 |
5190 #endif // V8_TARGET_ARCH_ARM64 | 5190 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |