| 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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 VisitStatements(clause->statements()); | 1086 VisitStatements(clause->statements()); |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 __ bind(nested_statement.break_label()); | 1089 __ bind(nested_statement.break_label()); |
| 1090 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1090 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 | 1093 |
| 1094 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 1094 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
| 1095 Comment cmnt(masm_, "[ ForInStatement"); | 1095 Comment cmnt(masm_, "[ ForInStatement"); |
| 1096 int slot = stmt->ForInFeedbackSlot(); | 1096 FeedbackVectorSlot slot = stmt->ForInFeedbackSlot(); |
| 1097 SetStatementPosition(stmt); | 1097 SetStatementPosition(stmt); |
| 1098 | 1098 |
| 1099 Label loop, exit; | 1099 Label loop, exit; |
| 1100 ForIn loop_statement(this, stmt); | 1100 ForIn loop_statement(this, stmt); |
| 1101 increment_loop_depth(); | 1101 increment_loop_depth(); |
| 1102 | 1102 |
| 1103 // Get the object to enumerate over. If the object is null or undefined, skip | 1103 // Get the object to enumerate over. If the object is null or undefined, skip |
| 1104 // over the loop. See ECMA-262 version 5, section 12.6.4. | 1104 // over the loop. See ECMA-262 version 5, section 12.6.4. |
| 1105 VisitForAccumulatorValue(stmt->enumerable()); | 1105 VisitForAccumulatorValue(stmt->enumerable()); |
| 1106 __ mov(a0, result_register()); // Result as param to InvokeBuiltin below. | 1106 __ mov(a0, result_register()); // Result as param to InvokeBuiltin below. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 __ bind(&no_descriptors); | 1174 __ bind(&no_descriptors); |
| 1175 __ Drop(1); | 1175 __ Drop(1); |
| 1176 __ jmp(&exit); | 1176 __ jmp(&exit); |
| 1177 | 1177 |
| 1178 // We got a fixed array in register v0. Iterate through that. | 1178 // We got a fixed array in register v0. Iterate through that. |
| 1179 Label non_proxy; | 1179 Label non_proxy; |
| 1180 __ bind(&fixed_array); | 1180 __ bind(&fixed_array); |
| 1181 | 1181 |
| 1182 __ li(a1, FeedbackVector()); | 1182 __ li(a1, FeedbackVector()); |
| 1183 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1183 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1184 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot))); | 1184 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(slot.ToInt()))); |
| 1185 | 1185 |
| 1186 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1186 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check |
| 1187 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1187 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
| 1188 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1188 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
| 1189 __ GetObjectType(a2, a3, a3); | 1189 __ GetObjectType(a2, a3, a3); |
| 1190 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); | 1190 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); |
| 1191 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1191 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
| 1192 __ bind(&non_proxy); | 1192 __ bind(&non_proxy); |
| 1193 __ Push(a1, v0); // Smi and array | 1193 __ Push(a1, v0); // Smi and array |
| 1194 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1194 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 Comment cnmt(masm_, "[ SuperReference "); | 1346 Comment cnmt(masm_, "[ SuperReference "); |
| 1347 | 1347 |
| 1348 __ lw(LoadDescriptor::ReceiverRegister(), | 1348 __ lw(LoadDescriptor::ReceiverRegister(), |
| 1349 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1349 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1350 | 1350 |
| 1351 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); | 1351 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); |
| 1352 __ li(LoadDescriptor::NameRegister(), home_object_symbol); | 1352 __ li(LoadDescriptor::NameRegister(), home_object_symbol); |
| 1353 | 1353 |
| 1354 if (FLAG_vector_ics) { | 1354 if (FLAG_vector_ics) { |
| 1355 __ li(VectorLoadICDescriptor::SlotRegister(), | 1355 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 1356 Operand(Smi::FromInt(expr->HomeObjectFeedbackSlot()))); | 1356 Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot()))); |
| 1357 CallLoadIC(NOT_CONTEXTUAL); | 1357 CallLoadIC(NOT_CONTEXTUAL); |
| 1358 } else { | 1358 } else { |
| 1359 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); | 1359 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 Label done; | 1362 Label done; |
| 1363 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); | 1363 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); |
| 1364 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1364 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
| 1365 __ bind(&done); | 1365 __ bind(&done); |
| 1366 } | 1366 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 // Load next context in chain. | 1408 // Load next context in chain. |
| 1409 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); | 1409 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); |
| 1410 __ Branch(&loop); | 1410 __ Branch(&loop); |
| 1411 __ bind(&fast); | 1411 __ bind(&fast); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1414 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 1415 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); | 1415 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); |
| 1416 if (FLAG_vector_ics) { | 1416 if (FLAG_vector_ics) { |
| 1417 __ li(VectorLoadICDescriptor::SlotRegister(), | 1417 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 1418 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1418 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) | 1421 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
| 1422 ? NOT_CONTEXTUAL | 1422 ? NOT_CONTEXTUAL |
| 1423 : CONTEXTUAL; | 1423 : CONTEXTUAL; |
| 1424 CallLoadIC(mode); | 1424 CallLoadIC(mode); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 | 1427 |
| 1428 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, | 1428 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 | 1497 |
| 1498 // Three cases: global variables, lookup variables, and all other types of | 1498 // Three cases: global variables, lookup variables, and all other types of |
| 1499 // variables. | 1499 // variables. |
| 1500 switch (var->location()) { | 1500 switch (var->location()) { |
| 1501 case Variable::UNALLOCATED: { | 1501 case Variable::UNALLOCATED: { |
| 1502 Comment cmnt(masm_, "[ Global variable"); | 1502 Comment cmnt(masm_, "[ Global variable"); |
| 1503 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 1503 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
| 1504 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); | 1504 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); |
| 1505 if (FLAG_vector_ics) { | 1505 if (FLAG_vector_ics) { |
| 1506 __ li(VectorLoadICDescriptor::SlotRegister(), | 1506 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 1507 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1507 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); |
| 1508 } | 1508 } |
| 1509 CallLoadIC(CONTEXTUAL); | 1509 CallLoadIC(CONTEXTUAL); |
| 1510 context()->Plug(v0); | 1510 context()->Plug(v0); |
| 1511 break; | 1511 break; |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 case Variable::PARAMETER: | 1514 case Variable::PARAMETER: |
| 1515 case Variable::LOCAL: | 1515 case Variable::LOCAL: |
| 1516 case Variable::CONTEXT: { | 1516 case Variable::CONTEXT: { |
| 1517 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" | 1517 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2133 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2133 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
| 2134 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2134 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
| 2135 __ Push(load_name, a3, a0); // "next", iter, received | 2135 __ Push(load_name, a3, a0); // "next", iter, received |
| 2136 | 2136 |
| 2137 // result = receiver[f](arg); | 2137 // result = receiver[f](arg); |
| 2138 __ bind(&l_call); | 2138 __ bind(&l_call); |
| 2139 __ lw(load_receiver, MemOperand(sp, kPointerSize)); | 2139 __ lw(load_receiver, MemOperand(sp, kPointerSize)); |
| 2140 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); | 2140 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); |
| 2141 if (FLAG_vector_ics) { | 2141 if (FLAG_vector_ics) { |
| 2142 __ li(VectorLoadICDescriptor::SlotRegister(), | 2142 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 2143 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); | 2143 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
| 2144 } | 2144 } |
| 2145 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2145 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2146 CallIC(ic, TypeFeedbackId::None()); | 2146 CallIC(ic, TypeFeedbackId::None()); |
| 2147 __ mov(a0, v0); | 2147 __ mov(a0, v0); |
| 2148 __ mov(a1, a0); | 2148 __ mov(a1, a0); |
| 2149 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); | 2149 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); |
| 2150 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2150 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
| 2151 __ CallStub(&stub); | 2151 __ CallStub(&stub); |
| 2152 | 2152 |
| 2153 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2153 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2154 __ Drop(1); // The function is still on the stack; drop it. | 2154 __ Drop(1); // The function is still on the stack; drop it. |
| 2155 | 2155 |
| 2156 // if (!result.done) goto l_try; | 2156 // if (!result.done) goto l_try; |
| 2157 __ Move(load_receiver, v0); | 2157 __ Move(load_receiver, v0); |
| 2158 | 2158 |
| 2159 __ push(load_receiver); // save result | 2159 __ push(load_receiver); // save result |
| 2160 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 2160 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
| 2161 if (FLAG_vector_ics) { | 2161 if (FLAG_vector_ics) { |
| 2162 __ li(VectorLoadICDescriptor::SlotRegister(), | 2162 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 2163 Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); | 2163 Operand(SmiFromSlot(expr->DoneFeedbackSlot()))); |
| 2164 } | 2164 } |
| 2165 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done | 2165 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done |
| 2166 __ mov(a0, v0); | 2166 __ mov(a0, v0); |
| 2167 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2167 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
| 2168 CallIC(bool_ic); | 2168 CallIC(bool_ic); |
| 2169 __ Branch(&l_try, eq, v0, Operand(zero_reg)); | 2169 __ Branch(&l_try, eq, v0, Operand(zero_reg)); |
| 2170 | 2170 |
| 2171 // result.value | 2171 // result.value |
| 2172 __ pop(load_receiver); // result | 2172 __ pop(load_receiver); // result |
| 2173 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 2173 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
| 2174 if (FLAG_vector_ics) { | 2174 if (FLAG_vector_ics) { |
| 2175 __ li(VectorLoadICDescriptor::SlotRegister(), | 2175 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 2176 Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); | 2176 Operand(SmiFromSlot(expr->ValueFeedbackSlot()))); |
| 2177 } | 2177 } |
| 2178 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value | 2178 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value |
| 2179 context()->DropAndPlug(2, v0); // drop iter and g | 2179 context()->DropAndPlug(2, v0); // drop iter and g |
| 2180 break; | 2180 break; |
| 2181 } | 2181 } |
| 2182 } | 2182 } |
| 2183 } | 2183 } |
| 2184 | 2184 |
| 2185 | 2185 |
| 2186 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, | 2186 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2335 | 2335 |
| 2336 | 2336 |
| 2337 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2337 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
| 2338 SetSourcePosition(prop->position()); | 2338 SetSourcePosition(prop->position()); |
| 2339 Literal* key = prop->key()->AsLiteral(); | 2339 Literal* key = prop->key()->AsLiteral(); |
| 2340 DCHECK(!prop->IsSuperAccess()); | 2340 DCHECK(!prop->IsSuperAccess()); |
| 2341 | 2341 |
| 2342 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); | 2342 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
| 2343 if (FLAG_vector_ics) { | 2343 if (FLAG_vector_ics) { |
| 2344 __ li(VectorLoadICDescriptor::SlotRegister(), | 2344 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 2345 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2345 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2346 CallLoadIC(NOT_CONTEXTUAL); | 2346 CallLoadIC(NOT_CONTEXTUAL); |
| 2347 } else { | 2347 } else { |
| 2348 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2348 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
| 2349 } | 2349 } |
| 2350 } | 2350 } |
| 2351 | 2351 |
| 2352 | 2352 |
| 2353 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { | 2353 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
| 2354 // Stack: receiver, home_object. | 2354 // Stack: receiver, home_object. |
| 2355 SetSourcePosition(prop->position()); | 2355 SetSourcePosition(prop->position()); |
| 2356 Literal* key = prop->key()->AsLiteral(); | 2356 Literal* key = prop->key()->AsLiteral(); |
| 2357 DCHECK(!key->value()->IsSmi()); | 2357 DCHECK(!key->value()->IsSmi()); |
| 2358 DCHECK(prop->IsSuperAccess()); | 2358 DCHECK(prop->IsSuperAccess()); |
| 2359 | 2359 |
| 2360 __ Push(key->value()); | 2360 __ Push(key->value()); |
| 2361 __ CallRuntime(Runtime::kLoadFromSuper, 3); | 2361 __ CallRuntime(Runtime::kLoadFromSuper, 3); |
| 2362 } | 2362 } |
| 2363 | 2363 |
| 2364 | 2364 |
| 2365 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2365 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
| 2366 SetSourcePosition(prop->position()); | 2366 SetSourcePosition(prop->position()); |
| 2367 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); | 2367 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
| 2368 if (FLAG_vector_ics) { | 2368 if (FLAG_vector_ics) { |
| 2369 __ li(VectorLoadICDescriptor::SlotRegister(), | 2369 __ li(VectorLoadICDescriptor::SlotRegister(), |
| 2370 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2370 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); |
| 2371 CallIC(ic); | 2371 CallIC(ic); |
| 2372 } else { | 2372 } else { |
| 2373 CallIC(ic, prop->PropertyFeedbackId()); | 2373 CallIC(ic, prop->PropertyFeedbackId()); |
| 2374 } | 2374 } |
| 2375 } | 2375 } |
| 2376 | 2376 |
| 2377 | 2377 |
| 2378 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { | 2378 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { |
| 2379 // Stack: receiver, home_object, key. | 2379 // Stack: receiver, home_object, key. |
| 2380 SetSourcePosition(prop->position()); | 2380 SetSourcePosition(prop->position()); |
| (...skipping 483 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 __ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize)); | 2875 __ lw(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 | 2879 |
| 2880 RecordJSReturnSite(expr); | 2880 RecordJSReturnSite(expr); |
| 2881 // Restore context register. | 2881 // Restore context register. |
| 2882 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2882 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2883 context()->DropAndPlug(1, v0); | 2883 context()->DropAndPlug(1, v0); |
| 2884 } | 2884 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 // constructor invocation. | 3062 // constructor invocation. |
| 3063 SetSourcePosition(expr->position()); | 3063 SetSourcePosition(expr->position()); |
| 3064 | 3064 |
| 3065 // Load function and argument count into a1 and a0. | 3065 // Load function and argument count into a1 and a0. |
| 3066 __ li(a0, Operand(arg_count)); | 3066 __ li(a0, Operand(arg_count)); |
| 3067 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); | 3067 __ lw(a1, MemOperand(sp, arg_count * kPointerSize)); |
| 3068 | 3068 |
| 3069 // Record call targets in unoptimized code. | 3069 // Record call targets in unoptimized code. |
| 3070 if (FLAG_pretenuring_call_new) { | 3070 if (FLAG_pretenuring_call_new) { |
| 3071 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | 3071 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); |
| 3072 DCHECK(expr->AllocationSiteFeedbackSlot() == | 3072 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == |
| 3073 expr->CallNewFeedbackSlot() + 1); | 3073 expr->CallNewFeedbackSlot().ToInt() + 1); |
| 3074 } | 3074 } |
| 3075 | 3075 |
| 3076 __ li(a2, FeedbackVector()); | 3076 __ li(a2, FeedbackVector()); |
| 3077 __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); | 3077 __ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
| 3078 | 3078 |
| 3079 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3079 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
| 3080 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3080 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
| 3081 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3081 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
| 3082 context()->Plug(v0); | 3082 context()->Plug(v0); |
| 3083 } | 3083 } |
| 3084 | 3084 |
| 3085 | 3085 |
| 3086 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3086 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 3087 ZoneList<Expression*>* args = expr->arguments(); | 3087 ZoneList<Expression*>* args = expr->arguments(); |
| (...skipping 1211 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 __ lw(receiver, GlobalObjectOperand()); | 4301 __ lw(receiver, GlobalObjectOperand()); |
| 4302 __ lw(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); | 4302 __ lw(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 __ lw(at, MemOperand(sp, 0)); | 4316 __ lw(at, MemOperand(sp, 0)); |
| 4317 __ push(at); | 4317 __ push(at); |
| 4318 __ sw(v0, MemOperand(sp, kPointerSize)); | 4318 __ sw(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 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 4711 __ lw(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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5137 Assembler::target_address_at(pc_immediate_load_address)) == | 5137 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5138 reinterpret_cast<uint32_t>( | 5138 reinterpret_cast<uint32_t>( |
| 5139 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5139 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5140 return OSR_AFTER_STACK_CHECK; | 5140 return OSR_AFTER_STACK_CHECK; |
| 5141 } | 5141 } |
| 5142 | 5142 |
| 5143 | 5143 |
| 5144 } } // namespace v8::internal | 5144 } } // namespace v8::internal |
| 5145 | 5145 |
| 5146 #endif // V8_TARGET_ARCH_MIPS | 5146 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |