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

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

Issue 1129853002: Removing FLAG_vector_ics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment response. Created 5 years, 7 months 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
« no previous file with comments | « src/mips64/debug-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 1311
1312 void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) { 1312 void FullCodeGenerator::EmitLoadHomeObject(SuperReference* expr) {
1313 Comment cnmt(masm_, "[ SuperReference "); 1313 Comment cnmt(masm_, "[ SuperReference ");
1314 1314
1315 __ ld(LoadDescriptor::ReceiverRegister(), 1315 __ ld(LoadDescriptor::ReceiverRegister(),
1316 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1316 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1317 1317
1318 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol()); 1318 Handle<Symbol> home_object_symbol(isolate()->heap()->home_object_symbol());
1319 __ li(LoadDescriptor::NameRegister(), home_object_symbol); 1319 __ li(LoadDescriptor::NameRegister(), home_object_symbol);
1320 1320
1321 if (FLAG_vector_ics) { 1321 __ li(VectorLoadICDescriptor::SlotRegister(),
1322 __ li(VectorLoadICDescriptor::SlotRegister(), 1322 Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot())));
1323 Operand(SmiFromSlot(expr->HomeObjectFeedbackSlot()))); 1323 CallLoadIC(NOT_CONTEXTUAL);
1324 CallLoadIC(NOT_CONTEXTUAL);
1325 } else {
1326 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId());
1327 }
1328 1324
1329 Label done; 1325 Label done;
1330 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); 1326 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value()));
1331 __ CallRuntime(Runtime::kThrowNonMethodError, 0); 1327 __ CallRuntime(Runtime::kThrowNonMethodError, 0);
1332 __ bind(&done); 1328 __ bind(&done);
1333 } 1329 }
1334 1330
1335 1331
1336 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, 1332 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer,
1337 int offset) { 1333 int offset) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX)); 1382 __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX));
1387 __ Branch(slow, ne, temp, Operand(zero_reg)); 1383 __ Branch(slow, ne, temp, Operand(zero_reg));
1388 // Load next context in chain. 1384 // Load next context in chain.
1389 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX)); 1385 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX));
1390 __ Branch(&loop); 1386 __ Branch(&loop);
1391 __ bind(&fast); 1387 __ bind(&fast);
1392 } 1388 }
1393 1389
1394 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1390 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1395 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); 1391 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name()));
1396 if (FLAG_vector_ics) { 1392 __ li(VectorLoadICDescriptor::SlotRegister(),
1397 __ li(VectorLoadICDescriptor::SlotRegister(), 1393 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1398 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1399 }
1400 1394
1401 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) 1395 ContextualMode mode = (typeof_state == INSIDE_TYPEOF)
1402 ? NOT_CONTEXTUAL 1396 ? NOT_CONTEXTUAL
1403 : CONTEXTUAL; 1397 : CONTEXTUAL;
1404 CallLoadIC(mode); 1398 CallLoadIC(mode);
1405 } 1399 }
1406 1400
1407 1401
1408 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1402 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1409 Label* slow) { 1403 Label* slow) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 1472
1479 // Three cases: global variables, lookup variables, and all other types of 1473 // Three cases: global variables, lookup variables, and all other types of
1480 // variables. 1474 // variables.
1481 switch (var->location()) { 1475 switch (var->location()) {
1482 case Variable::UNALLOCATED: { 1476 case Variable::UNALLOCATED: {
1483 Comment cmnt(masm_, "[ Global variable"); 1477 Comment cmnt(masm_, "[ Global variable");
1484 // Use inline caching. Variable name is passed in a2 and the global 1478 // Use inline caching. Variable name is passed in a2 and the global
1485 // object (receiver) in a0. 1479 // object (receiver) in a0.
1486 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1480 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1487 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); 1481 __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
1488 if (FLAG_vector_ics) { 1482 __ li(VectorLoadICDescriptor::SlotRegister(),
1489 __ li(VectorLoadICDescriptor::SlotRegister(), 1483 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1490 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1491 }
1492 CallGlobalLoadIC(var->name()); 1484 CallGlobalLoadIC(var->name());
1493 context()->Plug(v0); 1485 context()->Plug(v0);
1494 break; 1486 break;
1495 } 1487 }
1496 1488
1497 case Variable::PARAMETER: 1489 case Variable::PARAMETER:
1498 case Variable::LOCAL: 1490 case Variable::LOCAL:
1499 case Variable::CONTEXT: { 1491 case Variable::CONTEXT: {
1500 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" 1492 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable"
1501 : "[ Stack variable"); 1493 : "[ Stack variable");
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2176 // receiver = iter; f = 'next'; arg = received; 2168 // receiver = iter; f = 'next'; arg = received;
2177 __ bind(&l_next); 2169 __ bind(&l_next);
2178 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" 2170 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
2179 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter 2171 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
2180 __ Push(load_name, a3, a0); // "next", iter, received 2172 __ Push(load_name, a3, a0); // "next", iter, received
2181 2173
2182 // result = receiver[f](arg); 2174 // result = receiver[f](arg);
2183 __ bind(&l_call); 2175 __ bind(&l_call);
2184 __ ld(load_receiver, MemOperand(sp, kPointerSize)); 2176 __ ld(load_receiver, MemOperand(sp, kPointerSize));
2185 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); 2177 __ ld(load_name, MemOperand(sp, 2 * kPointerSize));
2186 if (FLAG_vector_ics) { 2178 __ li(VectorLoadICDescriptor::SlotRegister(),
2187 __ li(VectorLoadICDescriptor::SlotRegister(), 2179 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2188 Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
2189 }
2190 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2180 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2191 CallIC(ic, TypeFeedbackId::None()); 2181 CallIC(ic, TypeFeedbackId::None());
2192 __ mov(a0, v0); 2182 __ mov(a0, v0);
2193 __ mov(a1, a0); 2183 __ mov(a1, a0);
2194 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); 2184 __ sd(a1, MemOperand(sp, 2 * kPointerSize));
2195 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2185 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2196 __ CallStub(&stub); 2186 __ CallStub(&stub);
2197 2187
2198 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2188 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2199 __ Drop(1); // The function is still on the stack; drop it. 2189 __ Drop(1); // The function is still on the stack; drop it.
2200 2190
2201 // if (!result.done) goto l_try; 2191 // if (!result.done) goto l_try;
2202 __ Move(load_receiver, v0); 2192 __ Move(load_receiver, v0);
2203 2193
2204 __ push(load_receiver); // save result 2194 __ push(load_receiver); // save result
2205 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" 2195 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
2206 if (FLAG_vector_ics) { 2196 __ li(VectorLoadICDescriptor::SlotRegister(),
2207 __ li(VectorLoadICDescriptor::SlotRegister(), 2197 Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
2208 Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
2209 }
2210 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done 2198 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done
2211 __ mov(a0, v0); 2199 __ mov(a0, v0);
2212 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); 2200 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
2213 CallIC(bool_ic); 2201 CallIC(bool_ic);
2214 __ Branch(&l_try, eq, v0, Operand(zero_reg)); 2202 __ Branch(&l_try, eq, v0, Operand(zero_reg));
2215 2203
2216 // result.value 2204 // result.value
2217 __ pop(load_receiver); // result 2205 __ pop(load_receiver); // result
2218 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" 2206 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
2219 if (FLAG_vector_ics) { 2207 __ li(VectorLoadICDescriptor::SlotRegister(),
2220 __ li(VectorLoadICDescriptor::SlotRegister(), 2208 Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
2221 Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
2222 }
2223 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value 2209 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value
2224 context()->DropAndPlug(2, v0); // drop iter and g 2210 context()->DropAndPlug(2, v0); // drop iter and g
2225 break; 2211 break;
2226 } 2212 }
2227 } 2213 }
2228 } 2214 }
2229 2215
2230 2216
2231 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, 2217 void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
2232 Expression *value, 2218 Expression *value,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); 2341 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs);
2356 } 2342 }
2357 2343
2358 2344
2359 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2345 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2360 SetSourcePosition(prop->position()); 2346 SetSourcePosition(prop->position());
2361 Literal* key = prop->key()->AsLiteral(); 2347 Literal* key = prop->key()->AsLiteral();
2362 DCHECK(!prop->IsSuperAccess()); 2348 DCHECK(!prop->IsSuperAccess());
2363 2349
2364 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); 2350 __ li(LoadDescriptor::NameRegister(), Operand(key->value()));
2365 if (FLAG_vector_ics) { 2351 __ li(VectorLoadICDescriptor::SlotRegister(),
2366 __ li(VectorLoadICDescriptor::SlotRegister(), 2352 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2367 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2353 CallLoadIC(NOT_CONTEXTUAL);
2368 CallLoadIC(NOT_CONTEXTUAL);
2369 } else {
2370 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
2371 }
2372 } 2354 }
2373 2355
2374 2356
2375 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { 2357 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2376 // Stack: receiver, home_object. 2358 // Stack: receiver, home_object.
2377 SetSourcePosition(prop->position()); 2359 SetSourcePosition(prop->position());
2378 Literal* key = prop->key()->AsLiteral(); 2360 Literal* key = prop->key()->AsLiteral();
2379 DCHECK(!key->value()->IsSmi()); 2361 DCHECK(!key->value()->IsSmi());
2380 DCHECK(prop->IsSuperAccess()); 2362 DCHECK(prop->IsSuperAccess());
2381 2363
2382 __ Push(key->value()); 2364 __ Push(key->value());
2383 __ CallRuntime(Runtime::kLoadFromSuper, 3); 2365 __ CallRuntime(Runtime::kLoadFromSuper, 3);
2384 } 2366 }
2385 2367
2386 2368
2387 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2369 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2388 SetSourcePosition(prop->position()); 2370 SetSourcePosition(prop->position());
2389 // Call keyed load IC. It has register arguments receiver and key. 2371 // Call keyed load IC. It has register arguments receiver and key.
2390 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); 2372 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2391 if (FLAG_vector_ics) { 2373 __ li(VectorLoadICDescriptor::SlotRegister(),
2392 __ li(VectorLoadICDescriptor::SlotRegister(), 2374 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2393 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2375 CallIC(ic);
2394 CallIC(ic);
2395 } else {
2396 CallIC(ic, prop->PropertyFeedbackId());
2397 }
2398 } 2376 }
2399 2377
2400 2378
2401 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) { 2379 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2402 // Stack: receiver, home_object, key. 2380 // Stack: receiver, home_object, key.
2403 SetSourcePosition(prop->position()); 2381 SetSourcePosition(prop->position());
2404 2382
2405 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3); 2383 __ CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
2406 } 2384 }
2407 2385
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
4631 4609
4632 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { 4610 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
4633 // Push the builtins object as the receiver. 4611 // Push the builtins object as the receiver.
4634 Register receiver = LoadDescriptor::ReceiverRegister(); 4612 Register receiver = LoadDescriptor::ReceiverRegister();
4635 __ ld(receiver, GlobalObjectOperand()); 4613 __ ld(receiver, GlobalObjectOperand());
4636 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); 4614 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset));
4637 __ push(receiver); 4615 __ push(receiver);
4638 4616
4639 // Load the function from the receiver. 4617 // Load the function from the receiver.
4640 __ li(LoadDescriptor::NameRegister(), Operand(expr->name())); 4618 __ li(LoadDescriptor::NameRegister(), Operand(expr->name()));
4641 if (FLAG_vector_ics) { 4619 __ li(VectorLoadICDescriptor::SlotRegister(),
4642 __ li(VectorLoadICDescriptor::SlotRegister(), 4620 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot())));
4643 Operand(SmiFromSlot(expr->CallRuntimeFeedbackSlot()))); 4621 CallLoadIC(NOT_CONTEXTUAL);
4644 CallLoadIC(NOT_CONTEXTUAL);
4645 } else {
4646 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
4647 }
4648 } 4622 }
4649 4623
4650 4624
4651 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 4625 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
4652 ZoneList<Expression*>* args = expr->arguments(); 4626 ZoneList<Expression*>* args = expr->arguments();
4653 int arg_count = args->length(); 4627 int arg_count = args->length();
4654 4628
4655 // Record source position of the IC call. 4629 // Record source position of the IC call.
4656 SetSourcePosition(expr->position()); 4630 SetSourcePosition(expr->position());
4657 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 4631 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
5071 5045
5072 5046
5073 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { 5047 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
5074 DCHECK(!context()->IsEffect()); 5048 DCHECK(!context()->IsEffect());
5075 DCHECK(!context()->IsTest()); 5049 DCHECK(!context()->IsTest());
5076 VariableProxy* proxy = expr->AsVariableProxy(); 5050 VariableProxy* proxy = expr->AsVariableProxy();
5077 if (proxy != NULL && proxy->var()->IsUnallocated()) { 5051 if (proxy != NULL && proxy->var()->IsUnallocated()) {
5078 Comment cmnt(masm_, "[ Global variable"); 5052 Comment cmnt(masm_, "[ Global variable");
5079 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 5053 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
5080 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); 5054 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name()));
5081 if (FLAG_vector_ics) { 5055 __ li(VectorLoadICDescriptor::SlotRegister(),
5082 __ li(VectorLoadICDescriptor::SlotRegister(), 5056 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
5083 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
5084 }
5085 // Use a regular load, not a contextual load, to avoid a reference 5057 // Use a regular load, not a contextual load, to avoid a reference
5086 // error. 5058 // error.
5087 CallLoadIC(NOT_CONTEXTUAL); 5059 CallLoadIC(NOT_CONTEXTUAL);
5088 PrepareForBailout(expr, TOS_REG); 5060 PrepareForBailout(expr, TOS_REG);
5089 context()->Plug(v0); 5061 context()->Plug(v0);
5090 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { 5062 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) {
5091 Comment cmnt(masm_, "[ Lookup slot"); 5063 Comment cmnt(masm_, "[ Lookup slot");
5092 Label done, slow; 5064 Label done, slow;
5093 5065
5094 // Generate code for loading from variables potentially shadowed 5066 // Generate code for loading from variables potentially shadowed
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
5456 Assembler::target_address_at(pc_immediate_load_address)) == 5428 Assembler::target_address_at(pc_immediate_load_address)) ==
5457 reinterpret_cast<uint64_t>( 5429 reinterpret_cast<uint64_t>(
5458 isolate->builtins()->OsrAfterStackCheck()->entry())); 5430 isolate->builtins()->OsrAfterStackCheck()->entry()));
5459 return OSR_AFTER_STACK_CHECK; 5431 return OSR_AFTER_STACK_CHECK;
5460 } 5432 }
5461 5433
5462 5434
5463 } } // namespace v8::internal 5435 } } // namespace v8::internal
5464 5436
5465 #endif // V8_TARGET_ARCH_MIPS64 5437 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/debug-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698