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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 __ LoadSmiLiteral(r3, Smi::FromInt(0)); 1051 __ LoadSmiLiteral(r3, Smi::FromInt(0));
1052 // Push enumeration cache, enumeration cache length (as smi) and zero. 1052 // Push enumeration cache, enumeration cache length (as smi) and zero.
1053 __ Push(r5, r4, r3); 1053 __ Push(r5, r4, r3);
1054 __ b(&loop); 1054 __ b(&loop);
1055 1055
1056 __ bind(&no_descriptors); 1056 __ bind(&no_descriptors);
1057 __ Drop(1); 1057 __ Drop(1);
1058 __ b(&exit); 1058 __ b(&exit);
1059 1059
1060 // We got a fixed array in register r3. Iterate through that. 1060 // We got a fixed array in register r3. Iterate through that.
1061 Label non_proxy;
1062 __ bind(&fixed_array); 1061 __ bind(&fixed_array);
1063 1062
1064 __ EmitLoadTypeFeedbackVector(r4); 1063 __ EmitLoadTypeFeedbackVector(r4);
1065 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1064 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1066 int vector_index = SmiFromSlot(slot)->value(); 1065 int vector_index = SmiFromSlot(slot)->value();
1067 __ StoreP( 1066 __ StoreP(
1068 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); 1067 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0);
1069 1068 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check
1070 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi indicates slow check
1071 __ LoadP(r5, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1072 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
1073 __ CompareObjectType(r5, r6, r6, JS_PROXY_TYPE);
1074 __ bgt(&non_proxy);
1075 __ LoadSmiLiteral(r4, Smi::FromInt(0)); // Zero indicates proxy
1076 __ bind(&non_proxy);
1077 __ Push(r4, r3); // Smi and array 1069 __ Push(r4, r3); // Smi and array
1078 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); 1070 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset));
1079 __ LoadSmiLiteral(r3, Smi::FromInt(0)); 1071 __ LoadSmiLiteral(r3, Smi::FromInt(0));
1080 __ Push(r4, r3); // Fixed array length (as smi) and initial index. 1072 __ Push(r4, r3); // Fixed array length (as smi) and initial index.
1081 1073
1082 // Generate code for doing the condition check. 1074 // Generate code for doing the condition check.
1083 __ bind(&loop); 1075 __ bind(&loop);
1084 SetExpressionAsStatementPosition(stmt->each()); 1076 SetExpressionAsStatementPosition(stmt->each());
1085 1077
1086 // Load the current count to r3, load the length to r4. 1078 // Load the current count to r3, load the length to r4.
(...skipping 13 matching lines...) Expand all
1100 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize)); 1092 __ LoadP(r5, MemOperand(sp, 3 * kPointerSize));
1101 1093
1102 // Check if the expected map still matches that of the enumerable. 1094 // Check if the expected map still matches that of the enumerable.
1103 // If not, we may have to filter the key. 1095 // If not, we may have to filter the key.
1104 Label update_each; 1096 Label update_each;
1105 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize)); 1097 __ LoadP(r4, MemOperand(sp, 4 * kPointerSize));
1106 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset)); 1098 __ LoadP(r7, FieldMemOperand(r4, HeapObject::kMapOffset));
1107 __ cmp(r7, r5); 1099 __ cmp(r7, r5);
1108 __ beq(&update_each); 1100 __ beq(&update_each);
1109 1101
1110 // For proxies, no filtering is done.
1111 // TODO(rossberg): What if only a prototype is a proxy? Not specified yet.
1112 __ CmpSmiLiteral(r5, Smi::FromInt(0), r0);
1113 __ beq(&update_each);
1114
1115 // Convert the entry to a string or (smi) 0 if it isn't a property 1102 // Convert the entry to a string or (smi) 0 if it isn't a property
1116 // any more. If the property has been removed while iterating, we 1103 // any more. If the property has been removed while iterating, we
1117 // just skip it. 1104 // just skip it.
1118 __ Push(r4, r6); // Enumerable and current entry. 1105 __ Push(r4, r6); // Enumerable and current entry.
1119 __ CallRuntime(Runtime::kForInFilter, 2); 1106 __ CallRuntime(Runtime::kForInFilter, 2);
1120 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); 1107 PrepareForBailoutForId(stmt->FilterId(), TOS_REG);
1121 __ mr(r6, r3); 1108 __ mr(r6, r3);
1122 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 1109 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
1123 __ cmp(r3, r0); 1110 __ cmp(r3, r0);
1124 __ beq(loop_statement.continue_label()); 1111 __ beq(loop_statement.continue_label());
(...skipping 3774 matching lines...) Expand 10 before | Expand all | Expand 10 after
4899 return ON_STACK_REPLACEMENT; 4886 return ON_STACK_REPLACEMENT;
4900 } 4887 }
4901 4888
4902 DCHECK(interrupt_address == 4889 DCHECK(interrupt_address ==
4903 isolate->builtins()->OsrAfterStackCheck()->entry()); 4890 isolate->builtins()->OsrAfterStackCheck()->entry());
4904 return OSR_AFTER_STACK_CHECK; 4891 return OSR_AFTER_STACK_CHECK;
4905 } 4892 }
4906 } // namespace internal 4893 } // namespace internal
4907 } // namespace v8 4894 } // namespace v8
4908 #endif // V8_TARGET_ARCH_PPC 4895 #endif // V8_TARGET_ARCH_PPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698