OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 VisitStatements(clause->statements()); | 1081 VisitStatements(clause->statements()); |
1082 } | 1082 } |
1083 | 1083 |
1084 __ bind(nested_statement.break_label()); | 1084 __ bind(nested_statement.break_label()); |
1085 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1085 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1086 } | 1086 } |
1087 | 1087 |
1088 | 1088 |
1089 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 1089 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
1090 Comment cmnt(masm_, "[ ForInStatement"); | 1090 Comment cmnt(masm_, "[ ForInStatement"); |
1091 int slot = stmt->ForInFeedbackSlot(); | 1091 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
1092 SetStatementPosition(stmt); | 1092 SetStatementPosition(stmt); |
1093 | 1093 |
1094 Label loop, exit; | 1094 Label loop, exit; |
1095 ForIn loop_statement(this, stmt); | 1095 ForIn loop_statement(this, stmt); |
1096 increment_loop_depth(); | 1096 increment_loop_depth(); |
1097 | 1097 |
1098 // Get the object to enumerate over. If the object is null or undefined, skip | 1098 // Get the object to enumerate over. If the object is null or undefined, skip |
1099 // over the loop. See ECMA-262 version 5, section 12.6.4. | 1099 // over the loop. See ECMA-262 version 5, section 12.6.4. |
1100 VisitForAccumulatorValue(stmt->enumerable()); | 1100 VisitForAccumulatorValue(stmt->enumerable()); |
1101 __ mov(a0, result_register()); // Result as param to InvokeBuiltin below. | 1101 __ mov(a0, result_register()); // Result as param to InvokeBuiltin below. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 __ bind(&no_descriptors); | 1169 __ bind(&no_descriptors); |
1170 __ Drop(1); | 1170 __ Drop(1); |
1171 __ jmp(&exit); | 1171 __ jmp(&exit); |
1172 | 1172 |
1173 // We got a fixed array in register v0. Iterate through that. | 1173 // We got a fixed array in register v0. Iterate through that. |
1174 Label non_proxy; | 1174 Label non_proxy; |
1175 __ bind(&fixed_array); | 1175 __ bind(&fixed_array); |
1176 | 1176 |
1177 __ li(a1, FeedbackVector()); | 1177 __ li(a1, FeedbackVector()); |
1178 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1178 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1179 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot))); | 1179 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot.ToInt()))); |
1180 | 1180 |
1181 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1181 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
1182 __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1182 __ ld(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
1183 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1183 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1184 __ GetObjectType(a2, a3, a3); | 1184 __ GetObjectType(a2, a3, a3); |
1185 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); | 1185 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); |
1186 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1186 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1187 __ bind(&non_proxy); | 1187 __ bind(&non_proxy); |
1188 __ Push(a1, v0); // Smi and array | 1188 __ Push(a1, v0); // Smi and array |
1189 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1189 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 Comment cnmt(masm_, "[ SuperReference "); | 1341 Comment cnmt(masm_, "[ SuperReference "); |
1342 | 1342 |
1343 __ ld(LoadDescriptor::ReceiverRegister(), | 1343 __ ld(LoadDescriptor::ReceiverRegister(), |
1344 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1344 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1345 | 1345 |
1346 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); | 1346 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
1347 __ li(LoadDescriptor::NameRegister(), home_object_symbol); | 1347 __ li(LoadDescriptor::NameRegister(), home_object_symbol); |
1348 | 1348 |
1349 if (FLAG_vector_ics) { | 1349 if (FLAG_vector_ics) { |
1350 __ li(VectorLoadICDescriptor::SlotRegister(), | 1350 __ li(VectorLoadICDescriptor::SlotRegister(), |
1351 Operand(Smi::FromInt(expr->HomeObjectFeedbackSlot()))); | 1351 Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot()))); |
1352 CallLoadIC(NOT_CONTEXTUAL); | 1352 CallLoadIC(NOT_CONTEXTUAL); |
1353 } else { | 1353 } else { |
1354 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); | 1354 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); |
1355 } | 1355 } |
1356 | 1356 |
1357 Label done; | 1357 Label done; |
1358 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); | 1358 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); |
1359 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1359 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
1360 __ bind(&done); | 1360 __ bind(&done); |
1361 } | 1361 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 // Load next context in chain. | 1403 // Load next context in chain. |
1404 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX)); | 1404 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX)); |
1405 __ Branch(&loop); | 1405 __ Branch(&loop); |
1406 __ bind(&fast); | 1406 __ bind(&fast); |
1407 } | 1407 } |
1408 | 1408 |
1409 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1409 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1410 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); | 1410 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); |
1411 if (FLAG_vector_ics) { | 1411 if (FLAG_vector_ics) { |
1412 __ li(VectorLoadICDescriptor::SlotRegister(), | 1412 __ li(VectorLoadICDescriptor::SlotRegister(), |
1413 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1413 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1414 } | 1414 } |
1415 | 1415 |
1416 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) | 1416 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
1417 ? NOT_CONTEXTUAL | 1417 ? NOT_CONTEXTUAL |
1418 : CONTEXTUAL; | 1418 : CONTEXTUAL; |
1419 CallLoadIC(mode); | 1419 CallLoadIC(mode); |
1420 } | 1420 } |
1421 | 1421 |
1422 | 1422 |
1423 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1423 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Use inline caching. Variable name is passed in a2 and the global | 1498 // Use inline caching. Variable name is passed in a2 and the global |
1499 // object (receiver) in a0. | 1499 // object (receiver) in a0. |
1500 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1500 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1501 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); | 1501 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); |
1502 if (FLAG_vector_ics) { | 1502 if (FLAG_vector_ics) { |
1503 __ li(VectorLoadICDescriptor::SlotRegister(), | 1503 __ li(VectorLoadICDescriptor::SlotRegister(), |
1504 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1504 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
1505 } | 1505 } |
1506 CallLoadIC(CONTEXTUAL); | 1506 CallLoadIC(CONTEXTUAL); |
1507 context()->Plug(v0); | 1507 context()->Plug(v0); |
1508 break; | 1508 break; |
1509 } | 1509 } |
1510 | 1510 |
1511 case Variable::PARAMETER: | 1511 case Variable::PARAMETER: |
1512 case Variable::LOCAL: | 1512 case Variable::LOCAL: |
1513 case Variable::CONTEXT: { | 1513 case Variable::CONTEXT: { |
1514 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" | 1514 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2128 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
2129 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2129 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2130 __ Push(load_name, a3, a0); // "next", iter, received | 2130 __ Push(load_name, a3, a0); // "next", iter, received |
2131 | 2131 |
2132 // result = receiver[f](arg); | 2132 // result = receiver[f](arg); |
2133 __ bind(&l_call); | 2133 __ bind(&l_call); |
2134 __ ld(load_receiver, MemOperand(sp, kPointerSize)); | 2134 __ ld(load_receiver, MemOperand(sp, kPointerSize)); |
2135 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); | 2135 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); |
2136 if (FLAG_vector_ics) { | 2136 if (FLAG_vector_ics) { |
2137 __ li(VectorLoadICDescriptor::SlotRegister(), | 2137 __ li(VectorLoadICDescriptor::SlotRegister(), |
2138 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); | 2138 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
2139 } | 2139 } |
2140 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2140 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2141 CallIC(ic, TypeFeedbackId::None()); | 2141 CallIC(ic, TypeFeedbackId::None()); |
2142 __ mov(a0, v0); | 2142 __ mov(a0, v0); |
2143 __ mov(a1, a0); | 2143 __ mov(a1, a0); |
2144 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); | 2144 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); |
2145 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2145 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
2146 __ CallStub(&stub); | 2146 __ CallStub(&stub); |
2147 | 2147 |
2148 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2148 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2149 __ Drop(1); // The function is still on the stack; drop it. | 2149 __ Drop(1); // The function is still on the stack; drop it. |
2150 | 2150 |
2151 // if (!result.done) goto l_try; | 2151 // if (!result.done) goto l_try; |
2152 __ Move(load_receiver, v0); | 2152 __ Move(load_receiver, v0); |
2153 | 2153 |
2154 __ push(load_receiver); // save result | 2154 __ push(load_receiver); // save result |
2155 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 2155 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
2156 if (FLAG_vector_ics) { | 2156 if (FLAG_vector_ics) { |
2157 __ li(VectorLoadICDescriptor::SlotRegister(), | 2157 __ li(VectorLoadICDescriptor::SlotRegister(), |
2158 Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); | 2158 Operand(SmiFromSlot(expr->DoneFeedbackSlot()))); |
2159 } | 2159 } |
2160 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done | 2160 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done |
2161 __ mov(a0, v0); | 2161 __ mov(a0, v0); |
2162 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2162 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
2163 CallIC(bool_ic); | 2163 CallIC(bool_ic); |
2164 __ Branch(&l_try, eq, v0, Operand(zero_reg)); | 2164 __ Branch(&l_try, eq, v0, Operand(zero_reg)); |
2165 | 2165 |
2166 // result.value | 2166 // result.value |
2167 __ pop(load_receiver); // result | 2167 __ pop(load_receiver); // result |
2168 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 2168 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
2169 if (FLAG_vector_ics) { | 2169 if (FLAG_vector_ics) { |
2170 __ li(VectorLoadICDescriptor::SlotRegister(), | 2170 __ li(VectorLoadICDescriptor::SlotRegister(), |
2171 Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); | 2171 Operand(SmiFromSlot(expr->ValueFeedbackSlot()))); |
2172 } | 2172 } |
2173 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value | 2173 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value |
2174 context()->DropAndPlug(2, v0); // drop iter and g | 2174 context()->DropAndPlug(2, v0); // drop iter and g |
2175 break; | 2175 break; |
2176 } | 2176 } |
2177 } | 2177 } |
2178 } | 2178 } |
2179 | 2179 |
2180 | 2180 |
2181 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, | 2181 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2332 | 2332 |
2333 | 2333 |
2334 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2334 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2335 SetSourcePosition(prop->position()); | 2335 SetSourcePosition(prop->position()); |
2336 Literal* key = prop->key()->AsLiteral(); | 2336 Literal* key = prop->key()->AsLiteral(); |
2337 DCHECK(!prop->IsSuperAccess()); | 2337 DCHECK(!prop->IsSuperAccess()); |
2338 | 2338 |
2339 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2339 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
2340 if (FLAG_vector_ics) { | 2340 if (FLAG_vector_ics) { |
2341 __ li(VectorLoadICDescriptor::SlotRegister(), | 2341 __ li(VectorLoadICDescriptor::SlotRegister(), |
2342 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2342 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2343 CallLoadIC(NOT_CONTEXTUAL); | 2343 CallLoadIC(NOT_CONTEXTUAL); |
2344 } else { | 2344 } else { |
2345 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2345 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
2346 } | 2346 } |
2347 } | 2347 } |
2348 | 2348 |
2349 | 2349 |
2350 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2350 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
2351 // Stack: receiver, home_object. | 2351 // Stack: receiver, home_object. |
2352 SetSourcePosition(prop->position()); | 2352 SetSourcePosition(prop->position()); |
2353 Literal* key = prop->key()->AsLiteral(); | 2353 Literal* key = prop->key()->AsLiteral(); |
2354 DCHECK(!key->value()->IsSmi()); | 2354 DCHECK(!key->value()->IsSmi()); |
2355 DCHECK(prop->IsSuperAccess()); | 2355 DCHECK(prop->IsSuperAccess()); |
2356 | 2356 |
2357 __ Push(key->value()); | 2357 __ Push(key->value()); |
2358 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2358 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
2359 } | 2359 } |
2360 | 2360 |
2361 | 2361 |
2362 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2362 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2363 SetSourcePosition(prop->position()); | 2363 SetSourcePosition(prop->position()); |
2364 // Call keyed load IC. It has register arguments receiver and key. | 2364 // Call keyed load IC. It has register arguments receiver and key. |
2365 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2365 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
2366 if (FLAG_vector_ics) { | 2366 if (FLAG_vector_ics) { |
2367 __ li(VectorLoadICDescriptor::SlotRegister(), | 2367 __ li(VectorLoadICDescriptor::SlotRegister(), |
2368 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2368 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
2369 CallIC(ic); | 2369 CallIC(ic); |
2370 } else { | 2370 } else { |
2371 CallIC(ic, prop->PropertyFeedbackId()); | 2371 CallIC(ic, prop->PropertyFeedbackId()); |
2372 } | 2372 } |
2373 } | 2373 } |
2374 | 2374 |
2375 | 2375 |
2376 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2376 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
2377 // Stack: receiver, home_object, key. | 2377 // Stack: receiver, home_object, key. |
2378 SetSourcePosition(prop->position()); | 2378 SetSourcePosition(prop->position()); |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2864 { PreservePositionScope scope(masm()->positions_recorder()); | 2864 { PreservePositionScope scope(masm()->positions_recorder()); |
2865 for (int i = 0; i < arg_count; i++) { | 2865 for (int i = 0; i < arg_count; i++) { |
2866 VisitForStackValue(args->at(i)); | 2866 VisitForStackValue(args->at(i)); |
2867 } | 2867 } |
2868 } | 2868 } |
2869 | 2869 |
2870 // Record source position of the IC call. | 2870 // Record source position of the IC call. |
2871 SetSourcePosition(expr->position()); | 2871 SetSourcePosition(expr->position()); |
2872 Handle<Code> ic = CallIC::initialize_stub( | 2872 Handle<Code> ic = CallIC::initialize_stub( |
2873 isolate(), arg_count, call_type); | 2873 isolate(), arg_count, call_type); |
2874 __ li(a3, Operand(Smi::FromInt(expr->CallFeedbackSlot()))); | 2874 __ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot()))); |
2875 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2875 __ ld(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
2876 // Don't assign a type feedback id to the IC, since type feedback is provided | 2876 // Don't assign a type feedback id to the IC, since type feedback is provided |
2877 // by the vector above. | 2877 // by the vector above. |
2878 CallIC(ic); | 2878 CallIC(ic); |
2879 RecordJSReturnSite(expr); | 2879 RecordJSReturnSite(expr); |
2880 // Restore context register. | 2880 // Restore context register. |
2881 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2881 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2882 context()->DropAndPlug(1, v0); | 2882 context()->DropAndPlug(1, v0); |
2883 } | 2883 } |
2884 | 2884 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3060 // constructor invocation. | 3060 // constructor invocation. |
3061 SetSourcePosition(expr->position()); | 3061 SetSourcePosition(expr->position()); |
3062 | 3062 |
3063 // Load function and argument count into a1 and a0. | 3063 // Load function and argument count into a1 and a0. |
3064 __ li(a0, Operand(arg_count)); | 3064 __ li(a0, Operand(arg_count)); |
3065 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); | 3065 __ ld(a1, MemOperand(sp, arg_count * kPointerSize)); |
3066 | 3066 |
3067 // Record call targets in unoptimized code. | 3067 // Record call targets in unoptimized code. |
3068 if (FLAG_pretenuring_call_new) { | 3068 if (FLAG_pretenuring_call_new) { |
3069 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | 3069 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); |
3070 DCHECK(expr->AllocationSiteFeedbackSlot() == | 3070 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == |
3071 expr->CallNewFeedbackSlot() + 1); | 3071 expr->CallNewFeedbackSlot().ToInt() + 1); |
3072 } | 3072 } |
3073 | 3073 |
3074 __ li(a2, FeedbackVector()); | 3074 __ li(a2, FeedbackVector()); |
3075 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 3075 __ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3076 | 3076 |
3077 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3077 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3078 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3078 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3079 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3079 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3080 context()->Plug(v0); | 3080 context()->Plug(v0); |
3081 } | 3081 } |
3082 | 3082 |
3083 | 3083 |
3084 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3084 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
3085 ZoneList<Expression*>* args = expr->arguments(); | 3085 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4299 // Push the builtins object as the receiver. | 4299 // Push the builtins object as the receiver. |
4300 Register receiver = LoadDescriptor::ReceiverRegister(); | 4300 Register receiver = LoadDescriptor::ReceiverRegister(); |
4301 __ ld(receiver, GlobalObjectOperand()); | 4301 __ ld(receiver, GlobalObjectOperand()); |
4302 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); | 4302 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); |
4303 __ push(receiver); | 4303 __ push(receiver); |
4304 | 4304 |
4305 // Load the function from the receiver. | 4305 // Load the function from the receiver. |
4306 __ li(LoadDescriptor::NameRegister(), Operand(expr->name())); | 4306 __ li(LoadDescriptor::NameRegister(), Operand(expr->name())); |
4307 if (FLAG_vector_ics) { | 4307 if (FLAG_vector_ics) { |
4308 __ li(VectorLoadICDescriptor::SlotRegister(), | 4308 __ li(VectorLoadICDescriptor::SlotRegister(), |
4309 Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); | 4309 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); |
4310 CallLoadIC(NOT_CONTEXTUAL); | 4310 CallLoadIC(NOT_CONTEXTUAL); |
4311 } else { | 4311 } else { |
4312 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 4312 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
4313 } | 4313 } |
4314 | 4314 |
4315 // Push the target function under the receiver. | 4315 // Push the target function under the receiver. |
4316 __ ld(at, MemOperand(sp, 0)); | 4316 __ ld(at, MemOperand(sp, 0)); |
4317 __ push(at); | 4317 __ push(at); |
4318 __ sd(v0, MemOperand(sp, kPointerSize)); | 4318 __ sd(v0, MemOperand(sp, kPointerSize)); |
4319 | 4319 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4705 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4705 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
4706 DCHECK(!context()->IsEffect()); | 4706 DCHECK(!context()->IsEffect()); |
4707 DCHECK(!context()->IsTest()); | 4707 DCHECK(!context()->IsTest()); |
4708 VariableProxy* proxy = expr->AsVariableProxy(); | 4708 VariableProxy* proxy = expr->AsVariableProxy(); |
4709 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4709 if (proxy != NULL && proxy->var()->IsUnallocated()) { |
4710 Comment cmnt(masm_, "[ Global variable"); | 4710 Comment cmnt(masm_, "[ Global variable"); |
4711 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 4711 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
4712 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); | 4712 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
4713 if (FLAG_vector_ics) { | 4713 if (FLAG_vector_ics) { |
4714 __ li(VectorLoadICDescriptor::SlotRegister(), | 4714 __ li(VectorLoadICDescriptor::SlotRegister(), |
4715 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 4715 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
4716 } | 4716 } |
4717 // Use a regular load, not a contextual load, to avoid a reference | 4717 // Use a regular load, not a contextual load, to avoid a reference |
4718 // error. | 4718 // error. |
4719 CallLoadIC(NOT_CONTEXTUAL); | 4719 CallLoadIC(NOT_CONTEXTUAL); |
4720 PrepareForBailout(expr, TOS_REG); | 4720 PrepareForBailout(expr, TOS_REG); |
4721 context()->Plug(v0); | 4721 context()->Plug(v0); |
4722 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 4722 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
4723 Comment cmnt(masm_, "[ Lookup slot"); | 4723 Comment cmnt(masm_, "[ Lookup slot"); |
4724 Label done, slow; | 4724 Label done, slow; |
4725 | 4725 |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5141 Assembler::target_address_at(pc_immediate_load_address)) == | 5141 Assembler::target_address_at(pc_immediate_load_address)) == |
5142 reinterpret_cast<uint64_t>( | 5142 reinterpret_cast<uint64_t>( |
5143 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5143 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5144 return OSR_AFTER_STACK_CHECK; | 5144 return OSR_AFTER_STACK_CHECK; |
5145 } | 5145 } |
5146 | 5146 |
5147 | 5147 |
5148 } } // namespace v8::internal | 5148 } } // namespace v8::internal |
5149 | 5149 |
5150 #endif // V8_TARGET_ARCH_MIPS64 | 5150 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |