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

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

Issue 1486563002: Remove {FIRST,LAST}_SPEC_OBJECT_TYPE. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 __ stop("stop-at"); 123 __ stop("stop-at");
124 } 124 }
125 #endif 125 #endif
126 126
127 if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) { 127 if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) {
128 int receiver_offset = info->scope()->num_parameters() * kPointerSize; 128 int receiver_offset = info->scope()->num_parameters() * kPointerSize;
129 __ lw(a2, MemOperand(sp, receiver_offset)); 129 __ lw(a2, MemOperand(sp, receiver_offset));
130 __ AssertNotSmi(a2); 130 __ AssertNotSmi(a2);
131 __ GetObjectType(a2, a2, a2); 131 __ GetObjectType(a2, a2, a2);
132 __ Check(ge, kSloppyFunctionExpectsJSReceiverReceiver, a2, 132 __ Check(ge, kSloppyFunctionExpectsJSReceiverReceiver, a2,
133 Operand(FIRST_SPEC_OBJECT_TYPE)); 133 Operand(FIRST_JS_RECEIVER_TYPE));
134 } 134 }
135 135
136 // Open a frame scope to indicate that there is a frame on the stack. The 136 // Open a frame scope to indicate that there is a frame on the stack. The
137 // MANUAL indicates that the scope shouldn't actually generate code to set up 137 // MANUAL indicates that the scope shouldn't actually generate code to set up
138 // the frame (that is done below). 138 // the frame (that is done below).
139 FrameScope frame_scope(masm_, StackFrame::MANUAL); 139 FrameScope frame_scope(masm_, StackFrame::MANUAL);
140 140
141 info->set_prologue_offset(masm_->pc_offset()); 141 info->set_prologue_offset(masm_->pc_offset());
142 __ Prologue(info->IsCodePreAgingActive()); 142 __ Prologue(info->IsCodePreAgingActive());
143 143
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 __ Branch(&exit, eq, a0, Operand(at)); 1037 __ Branch(&exit, eq, a0, Operand(at));
1038 Register null_value = t1; 1038 Register null_value = t1;
1039 __ LoadRoot(null_value, Heap::kNullValueRootIndex); 1039 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
1040 __ Branch(&exit, eq, a0, Operand(null_value)); 1040 __ Branch(&exit, eq, a0, Operand(null_value));
1041 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); 1041 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
1042 __ mov(a0, v0); 1042 __ mov(a0, v0);
1043 // Convert the object to a JS object. 1043 // Convert the object to a JS object.
1044 Label convert, done_convert; 1044 Label convert, done_convert;
1045 __ JumpIfSmi(a0, &convert); 1045 __ JumpIfSmi(a0, &convert);
1046 __ GetObjectType(a0, a1, a1); 1046 __ GetObjectType(a0, a1, a1);
1047 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 1047 __ Branch(&done_convert, ge, a1, Operand(FIRST_JS_RECEIVER_TYPE));
1048 __ bind(&convert); 1048 __ bind(&convert);
1049 ToObjectStub stub(isolate()); 1049 ToObjectStub stub(isolate());
1050 __ CallStub(&stub); 1050 __ CallStub(&stub);
1051 __ mov(a0, v0); 1051 __ mov(a0, v0);
1052 __ bind(&done_convert); 1052 __ bind(&done_convert);
1053 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); 1053 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG);
1054 __ push(a0); 1054 __ push(a0);
1055 1055
1056 // Check for proxies. 1056 // Check for proxies.
1057 Label call_runtime; 1057 Label call_runtime;
1058 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1058 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
1059 __ GetObjectType(a0, a1, a1); 1059 __ GetObjectType(a0, a1, a1);
1060 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); 1060 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE));
1061 1061
1062 // Check cache validity in generated code. This is a fast case for 1062 // Check cache validity in generated code. This is a fast case for
1063 // the JSObject::IsSimpleEnum cache validity checks. If we cannot 1063 // the JSObject::IsSimpleEnum cache validity checks. If we cannot
1064 // guarantee cache validity, call the runtime system to check cache 1064 // guarantee cache validity, call the runtime system to check cache
1065 // validity or get the property names in a fixed array. 1065 // validity or get the property names in a fixed array.
1066 __ CheckEnumCache(null_value, &call_runtime); 1066 __ CheckEnumCache(null_value, &call_runtime);
1067 1067
1068 // The enum cache is valid. Load the map of the object being 1068 // The enum cache is valid. Load the map of the object being
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 Label non_proxy; 1110 Label non_proxy;
1111 __ bind(&fixed_array); 1111 __ bind(&fixed_array);
1112 1112
1113 __ EmitLoadTypeFeedbackVector(a1); 1113 __ EmitLoadTypeFeedbackVector(a1);
1114 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1114 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1115 int vector_index = SmiFromSlot(slot)->value(); 1115 int vector_index = SmiFromSlot(slot)->value();
1116 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); 1116 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index)));
1117 1117
1118 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check 1118 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1119 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object 1119 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1120 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1120 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
1121 __ GetObjectType(a2, a3, a3); 1121 __ GetObjectType(a2, a3, a3);
1122 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); 1122 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE));
1123 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy 1123 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1124 __ bind(&non_proxy); 1124 __ bind(&non_proxy);
1125 __ Push(a1, v0); // Smi and array 1125 __ Push(a1, v0); // Smi and array
1126 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); 1126 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset));
1127 __ li(a0, Operand(Smi::FromInt(0))); 1127 __ li(a0, Operand(Smi::FromInt(0)));
1128 __ Push(a1, a0); // Fixed array length (as smi) and initial index. 1128 __ Push(a1, a0); // Fixed array length (as smi) and initial index.
1129 1129
1130 // Generate code for doing the condition check. 1130 // Generate code for doing the condition check.
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 Label materialize_true, materialize_false; 3094 Label materialize_true, materialize_false;
3095 Label* if_true = NULL; 3095 Label* if_true = NULL;
3096 Label* if_false = NULL; 3096 Label* if_false = NULL;
3097 Label* fall_through = NULL; 3097 Label* fall_through = NULL;
3098 context()->PrepareTest(&materialize_true, &materialize_false, 3098 context()->PrepareTest(&materialize_true, &materialize_false,
3099 &if_true, &if_false, &fall_through); 3099 &if_true, &if_false, &fall_through);
3100 3100
3101 __ JumpIfSmi(v0, if_false); 3101 __ JumpIfSmi(v0, if_false);
3102 __ GetObjectType(v0, a1, a1); 3102 __ GetObjectType(v0, a1, a1);
3103 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 3103 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3104 Split(ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE), 3104 Split(ge, a1, Operand(FIRST_JS_RECEIVER_TYPE),
3105 if_true, if_false, fall_through); 3105 if_true, if_false, fall_through);
3106 3106
3107 context()->Plug(if_true, if_false); 3107 context()->Plug(if_true, if_false);
3108 } 3108 }
3109 3109
3110 3110
3111 void FullCodeGenerator::EmitIsSimdValue(CallRuntime* expr) { 3111 void FullCodeGenerator::EmitIsSimdValue(CallRuntime* expr) {
3112 ZoneList<Expression*>* args = expr->arguments(); 3112 ZoneList<Expression*>* args = expr->arguments();
3113 DCHECK(args->length() == 1); 3113 DCHECK(args->length() == 1);
3114 3114
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
3375 3375
3376 // If the object is a smi, we return null. 3376 // If the object is a smi, we return null.
3377 __ JumpIfSmi(v0, &null); 3377 __ JumpIfSmi(v0, &null);
3378 3378
3379 // Check that the object is a JS object but take special care of JS 3379 // Check that the object is a JS object but take special care of JS
3380 // functions to make sure they have 'Function' as their class. 3380 // functions to make sure they have 'Function' as their class.
3381 // Assume that there are only two callable types, and one of them is at 3381 // Assume that there are only two callable types, and one of them is at
3382 // either end of the type range for JS object types. Saves extra comparisons. 3382 // either end of the type range for JS object types. Saves extra comparisons.
3383 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 3383 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
3384 __ GetObjectType(v0, v0, a1); // Map is now in v0. 3384 __ GetObjectType(v0, v0, a1); // Map is now in v0.
3385 __ Branch(&null, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 3385 __ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE));
3386 3386
3387 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == 3387 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
3388 FIRST_SPEC_OBJECT_TYPE + 1); 3388 FIRST_JS_RECEIVER_TYPE + 1);
3389 __ Branch(&function, eq, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 3389 __ Branch(&function, eq, a1, Operand(FIRST_JS_RECEIVER_TYPE));
3390 3390
3391 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == 3391 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
3392 LAST_SPEC_OBJECT_TYPE - 1); 3392 LAST_JS_RECEIVER_TYPE - 1);
3393 __ Branch(&function, eq, a1, Operand(LAST_SPEC_OBJECT_TYPE)); 3393 __ Branch(&function, eq, a1, Operand(LAST_JS_RECEIVER_TYPE));
3394 // Assume that there is no larger type. 3394 // Assume that there is no larger type.
3395 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1); 3395 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1);
3396 3396
3397 // Check if the constructor in the map is a JS function. 3397 // Check if the constructor in the map is a JS function.
3398 Register instance_type = a2; 3398 Register instance_type = a2;
3399 __ GetMapConstructor(v0, v0, a1, instance_type); 3399 __ GetMapConstructor(v0, v0, a1, instance_type);
3400 __ Branch(&non_function_constructor, ne, instance_type, 3400 __ Branch(&non_function_constructor, ne, instance_type,
3401 Operand(JS_FUNCTION_TYPE)); 3401 Operand(JS_FUNCTION_TYPE));
3402 3402
3403 // v0 now contains the constructor function. Grab the 3403 // v0 now contains the constructor function. Grab the
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
4647 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4647 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4648 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4648 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4649 __ And(a1, a1, 4649 __ And(a1, a1,
4650 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); 4650 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
4651 Split(eq, a1, Operand(1 << Map::kIsCallable), if_true, if_false, 4651 Split(eq, a1, Operand(1 << Map::kIsCallable), if_true, if_false,
4652 fall_through); 4652 fall_through);
4653 } else if (String::Equals(check, factory->object_string())) { 4653 } else if (String::Equals(check, factory->object_string())) {
4654 __ JumpIfSmi(v0, if_false); 4654 __ JumpIfSmi(v0, if_false);
4655 __ LoadRoot(at, Heap::kNullValueRootIndex); 4655 __ LoadRoot(at, Heap::kNullValueRootIndex);
4656 __ Branch(if_true, eq, v0, Operand(at)); 4656 __ Branch(if_true, eq, v0, Operand(at));
4657 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 4657 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE);
4658 __ GetObjectType(v0, v0, a1); 4658 __ GetObjectType(v0, v0, a1);
4659 __ Branch(if_false, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 4659 __ Branch(if_false, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE));
4660 // Check for callable or undetectable objects => false. 4660 // Check for callable or undetectable objects => false.
4661 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4661 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4662 __ And(a1, a1, 4662 __ And(a1, a1,
4663 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); 4663 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
4664 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); 4664 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through);
4665 // clang-format off 4665 // clang-format off
4666 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 4666 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
4667 } else if (String::Equals(check, factory->type##_string())) { \ 4667 } else if (String::Equals(check, factory->type##_string())) { \
4668 __ JumpIfSmi(v0, if_false); \ 4668 __ JumpIfSmi(v0, if_false); \
4669 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \ 4669 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
4969 reinterpret_cast<uint32_t>( 4969 reinterpret_cast<uint32_t>(
4970 isolate->builtins()->OsrAfterStackCheck()->entry())); 4970 isolate->builtins()->OsrAfterStackCheck()->entry()));
4971 return OSR_AFTER_STACK_CHECK; 4971 return OSR_AFTER_STACK_CHECK;
4972 } 4972 }
4973 4973
4974 4974
4975 } // namespace internal 4975 } // namespace internal
4976 } // namespace v8 4976 } // namespace v8
4977 4977
4978 #endif // V8_TARGET_ARCH_MIPS 4978 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698