Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.cc

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP fix protoype walks with access checks Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 __ Drop(1); 1094 __ Drop(1);
1095 __ B(&exit); 1095 __ B(&exit);
1096 1096
1097 // We got a fixed array in register x0. Iterate through that. 1097 // We got a fixed array in register x0. Iterate through that.
1098 __ Bind(&fixed_array); 1098 __ Bind(&fixed_array);
1099 1099
1100 __ EmitLoadTypeFeedbackVector(x1); 1100 __ EmitLoadTypeFeedbackVector(x1);
1101 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1101 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1102 int vector_index = SmiFromSlot(slot)->value(); 1102 int vector_index = SmiFromSlot(slot)->value();
1103 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(vector_index))); 1103 __ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(vector_index)));
1104 1104 __ Mov(x1, Smi::FromInt(1)); // Smi(1) indicates slow check.
1105 __ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check.
1106 __ Peek(x10, 0); // Get enumerated object.
1107 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
1108 __ CompareObjectType(x10, x11, x12, JS_PROXY_TYPE);
1109 DCHECK(Smi::FromInt(0) == 0);
1110 __ CzeroX(x1, eq); // Zero indicates proxy.
1111 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); 1105 __ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset));
1112 // Smi and array, fixed array length (as smi) and initial index. 1106 // Smi and array, fixed array length (as smi) and initial index.
1113 __ Push(x1, x0, x2, xzr); 1107 __ Push(x1, x0, x2, xzr);
1114 1108
1115 // Generate code for doing the condition check. 1109 // Generate code for doing the condition check.
1116 __ Bind(&loop); 1110 __ Bind(&loop);
1117 SetExpressionAsStatementPosition(stmt->each()); 1111 SetExpressionAsStatementPosition(stmt->each());
1118 1112
1119 // Load the current count to x0, load the length to x1. 1113 // Load the current count to x0, load the length to x1.
1120 __ PeekPair(x0, x1, 0); 1114 __ PeekPair(x0, x1, 0);
(...skipping 10 matching lines...) Expand all
1131 __ Peek(x2, 3 * kXRegSize); 1125 __ Peek(x2, 3 * kXRegSize);
1132 1126
1133 // Check if the expected map still matches that of the enumerable. 1127 // Check if the expected map still matches that of the enumerable.
1134 // If not, we may have to filter the key. 1128 // If not, we may have to filter the key.
1135 Label update_each; 1129 Label update_each;
1136 __ Peek(x1, 4 * kXRegSize); 1130 __ Peek(x1, 4 * kXRegSize);
1137 __ Ldr(x11, FieldMemOperand(x1, HeapObject::kMapOffset)); 1131 __ Ldr(x11, FieldMemOperand(x1, HeapObject::kMapOffset));
1138 __ Cmp(x11, x2); 1132 __ Cmp(x11, x2);
1139 __ B(eq, &update_each); 1133 __ B(eq, &update_each);
1140 1134
1141 // For proxies, no filtering is done.
1142 // TODO(rossberg): What if only a prototype is a proxy? Not specified yet.
1143 STATIC_ASSERT(kSmiTag == 0);
1144 __ Cbz(x2, &update_each);
1145
1146 // Convert the entry to a string or (smi) 0 if it isn't a property 1135 // Convert the entry to a string or (smi) 0 if it isn't a property
1147 // any more. If the property has been removed while iterating, we 1136 // any more. If the property has been removed while iterating, we
1148 // just skip it. 1137 // just skip it.
1149 __ Push(x1, x3); 1138 __ Push(x1, x3);
1150 __ CallRuntime(Runtime::kForInFilter, 2); 1139 __ CallRuntime(Runtime::kForInFilter, 2);
1151 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); 1140 PrepareForBailoutForId(stmt->FilterId(), TOS_REG);
1152 __ Mov(x3, x0); 1141 __ Mov(x3, x0);
1153 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, 1142 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex,
1154 loop_statement.continue_label()); 1143 loop_statement.continue_label());
1155 1144
(...skipping 3778 matching lines...) Expand 10 before | Expand all | Expand 10 after
4934 } 4923 }
4935 4924
4936 return INTERRUPT; 4925 return INTERRUPT;
4937 } 4926 }
4938 4927
4939 4928
4940 } // namespace internal 4929 } // namespace internal
4941 } // namespace v8 4930 } // namespace v8
4942 4931
4943 #endif // V8_TARGET_ARCH_ARM64 4932 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698