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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
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 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 __ mov(r0, Operand(Smi::FromInt(0))); 1093 __ mov(r0, Operand(Smi::FromInt(0)));
1094 // Push enumeration cache, enumeration cache length (as smi) and zero. 1094 // Push enumeration cache, enumeration cache length (as smi) and zero.
1095 __ Push(r2, r1, r0); 1095 __ Push(r2, r1, r0);
1096 __ jmp(&loop); 1096 __ jmp(&loop);
1097 1097
1098 __ bind(&no_descriptors); 1098 __ bind(&no_descriptors);
1099 __ Drop(1); 1099 __ Drop(1);
1100 __ jmp(&exit); 1100 __ jmp(&exit);
1101 1101
1102 // We got a fixed array in register r0. Iterate through that. 1102 // We got a fixed array in register r0. Iterate through that.
1103 Label non_proxy;
1104 __ bind(&fixed_array); 1103 __ bind(&fixed_array);
1105 1104
1106 __ EmitLoadTypeFeedbackVector(r1); 1105 __ EmitLoadTypeFeedbackVector(r1);
1107 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1106 __ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1108 int vector_index = SmiFromSlot(slot)->value(); 1107 int vector_index = SmiFromSlot(slot)->value();
1109 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(vector_index))); 1108 __ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(vector_index)));
1110 1109 __ mov(r1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check
1111 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1112 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1113 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
1114 __ CompareObjectType(r2, r3, r3, JS_PROXY_TYPE);
1115 __ b(gt, &non_proxy);
1116 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1117 __ bind(&non_proxy);
1118 __ Push(r1, r0); // Smi and array 1110 __ Push(r1, r0); // Smi and array
1119 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); 1111 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset));
1120 __ mov(r0, Operand(Smi::FromInt(0))); 1112 __ mov(r0, Operand(Smi::FromInt(0)));
1121 __ Push(r1, r0); // Fixed array length (as smi) and initial index. 1113 __ Push(r1, r0); // Fixed array length (as smi) and initial index.
1122 1114
1123 // Generate code for doing the condition check. 1115 // Generate code for doing the condition check.
1124 __ bind(&loop); 1116 __ bind(&loop);
1125 SetExpressionAsStatementPosition(stmt->each()); 1117 SetExpressionAsStatementPosition(stmt->each());
1126 1118
1127 // Load the current count to r0, load the length to r1. 1119 // Load the current count to r0, load the length to r1.
(...skipping 11 matching lines...) Expand all
1139 __ ldr(r2, MemOperand(sp, 3 * kPointerSize)); 1131 __ ldr(r2, MemOperand(sp, 3 * kPointerSize));
1140 1132
1141 // Check if the expected map still matches that of the enumerable. 1133 // Check if the expected map still matches that of the enumerable.
1142 // If not, we may have to filter the key. 1134 // If not, we may have to filter the key.
1143 Label update_each; 1135 Label update_each;
1144 __ ldr(r1, MemOperand(sp, 4 * kPointerSize)); 1136 __ ldr(r1, MemOperand(sp, 4 * kPointerSize));
1145 __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); 1137 __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset));
1146 __ cmp(r4, Operand(r2)); 1138 __ cmp(r4, Operand(r2));
1147 __ b(eq, &update_each); 1139 __ b(eq, &update_each);
1148 1140
1149 // For proxies, no filtering is done.
1150 // TODO(rossberg): What if only a prototype is a proxy? Not specified yet.
1151 __ cmp(r2, Operand(Smi::FromInt(0)));
1152 __ b(eq, &update_each);
1153
1154 // Convert the entry to a string or (smi) 0 if it isn't a property 1141 // Convert the entry to a string or (smi) 0 if it isn't a property
1155 // any more. If the property has been removed while iterating, we 1142 // any more. If the property has been removed while iterating, we
1156 // just skip it. 1143 // just skip it.
1157 __ push(r1); // Enumerable. 1144 __ push(r1); // Enumerable.
1158 __ push(r3); // Current entry. 1145 __ push(r3); // Current entry.
1159 __ CallRuntime(Runtime::kForInFilter, 2); 1146 __ CallRuntime(Runtime::kForInFilter, 2);
1160 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); 1147 PrepareForBailoutForId(stmt->FilterId(), TOS_REG);
1161 __ mov(r3, Operand(r0)); 1148 __ mov(r3, Operand(r0));
1162 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 1149 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
1163 __ cmp(r0, ip); 1150 __ cmp(r0, ip);
(...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after
4961 DCHECK(interrupt_address == 4948 DCHECK(interrupt_address ==
4962 isolate->builtins()->OsrAfterStackCheck()->entry()); 4949 isolate->builtins()->OsrAfterStackCheck()->entry());
4963 return OSR_AFTER_STACK_CHECK; 4950 return OSR_AFTER_STACK_CHECK;
4964 } 4951 }
4965 4952
4966 4953
4967 } // namespace internal 4954 } // namespace internal
4968 } // namespace v8 4955 } // namespace v8
4969 4956
4970 #endif // V8_TARGET_ARCH_ARM 4957 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698