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

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

Issue 403393008: MIPS: Introduce FLAG_vector_ics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/mips64/ic-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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 context()->Plug(v0); 1340 context()->Plug(v0);
1341 } 1341 }
1342 1342
1343 1343
1344 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { 1344 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
1345 Comment cmnt(masm_, "[ VariableProxy"); 1345 Comment cmnt(masm_, "[ VariableProxy");
1346 EmitVariableLoad(expr); 1346 EmitVariableLoad(expr);
1347 } 1347 }
1348 1348
1349 1349
1350 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(Variable* var, 1350 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
1351 TypeofState typeof_state, 1351 TypeofState typeof_state,
1352 Label* slow) { 1352 Label* slow) {
1353 Register current = cp; 1353 Register current = cp;
1354 Register next = a1; 1354 Register next = a1;
1355 Register temp = a2; 1355 Register temp = a2;
1356 1356
1357 Scope* s = scope(); 1357 Scope* s = scope();
1358 while (s != NULL) { 1358 while (s != NULL) {
1359 if (s->num_heap_slots() > 0) { 1359 if (s->num_heap_slots() > 0) {
1360 if (s->calls_sloppy_eval()) { 1360 if (s->calls_sloppy_eval()) {
(...skipping 25 matching lines...) Expand all
1386 // Check that extension is NULL. 1386 // Check that extension is NULL.
1387 __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX)); 1387 __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX));
1388 __ Branch(slow, ne, temp, Operand(zero_reg)); 1388 __ Branch(slow, ne, temp, Operand(zero_reg));
1389 // Load next context in chain. 1389 // Load next context in chain.
1390 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX)); 1390 __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX));
1391 __ Branch(&loop); 1391 __ Branch(&loop);
1392 __ bind(&fast); 1392 __ bind(&fast);
1393 } 1393 }
1394 1394
1395 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand()); 1395 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
1396 __ li(LoadIC::NameRegister(), Operand(var->name())); 1396 __ li(LoadIC::NameRegister(), Operand(proxy->var()->name()));
1397 if (FLAG_vector_ics) {
1398 __ li(LoadIC::SlotRegister(),
1399 Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
1400 }
1401
1397 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) 1402 ContextualMode mode = (typeof_state == INSIDE_TYPEOF)
1398 ? NOT_CONTEXTUAL 1403 ? NOT_CONTEXTUAL
1399 : CONTEXTUAL; 1404 : CONTEXTUAL;
1400 CallLoadIC(mode); 1405 CallLoadIC(mode);
1401 } 1406 }
1402 1407
1403 1408
1404 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var, 1409 MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
1405 Label* slow) { 1410 Label* slow) {
1406 ASSERT(var->IsContextSlot()); 1411 ASSERT(var->IsContextSlot());
(...skipping 17 matching lines...) Expand all
1424 __ ld(temp, ContextOperand(context, Context::EXTENSION_INDEX)); 1429 __ ld(temp, ContextOperand(context, Context::EXTENSION_INDEX));
1425 __ Branch(slow, ne, temp, Operand(zero_reg)); 1430 __ Branch(slow, ne, temp, Operand(zero_reg));
1426 1431
1427 // This function is used only for loads, not stores, so it's safe to 1432 // This function is used only for loads, not stores, so it's safe to
1428 // return an cp-based operand (the write barrier cannot be allowed to 1433 // return an cp-based operand (the write barrier cannot be allowed to
1429 // destroy the cp register). 1434 // destroy the cp register).
1430 return ContextOperand(context, var->index()); 1435 return ContextOperand(context, var->index());
1431 } 1436 }
1432 1437
1433 1438
1434 void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var, 1439 void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy,
1435 TypeofState typeof_state, 1440 TypeofState typeof_state,
1436 Label* slow, 1441 Label* slow,
1437 Label* done) { 1442 Label* done) {
1438 // Generate fast-case code for variables that might be shadowed by 1443 // Generate fast-case code for variables that might be shadowed by
1439 // eval-introduced variables. Eval is used a lot without 1444 // eval-introduced variables. Eval is used a lot without
1440 // introducing variables. In those cases, we do not want to 1445 // introducing variables. In those cases, we do not want to
1441 // perform a runtime call for all variables in the scope 1446 // perform a runtime call for all variables in the scope
1442 // containing the eval. 1447 // containing the eval.
1448 Variable* var = proxy->var();
1443 if (var->mode() == DYNAMIC_GLOBAL) { 1449 if (var->mode() == DYNAMIC_GLOBAL) {
1444 EmitLoadGlobalCheckExtensions(var, typeof_state, slow); 1450 EmitLoadGlobalCheckExtensions(proxy, typeof_state, slow);
1445 __ Branch(done); 1451 __ Branch(done);
1446 } else if (var->mode() == DYNAMIC_LOCAL) { 1452 } else if (var->mode() == DYNAMIC_LOCAL) {
1447 Variable* local = var->local_if_not_shadowed(); 1453 Variable* local = var->local_if_not_shadowed();
1448 __ ld(v0, ContextSlotOperandCheckExtensions(local, slow)); 1454 __ ld(v0, ContextSlotOperandCheckExtensions(local, slow));
1449 if (local->mode() == LET || local->mode() == CONST || 1455 if (local->mode() == LET || local->mode() == CONST ||
1450 local->mode() == CONST_LEGACY) { 1456 local->mode() == CONST_LEGACY) {
1451 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 1457 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
1452 __ dsubu(at, v0, at); // Sub as compare: at == 0 on eq. 1458 __ dsubu(at, v0, at); // Sub as compare: at == 0 on eq.
1453 if (local->mode() == CONST_LEGACY) { 1459 if (local->mode() == CONST_LEGACY) {
1454 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); 1460 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex);
(...skipping 17 matching lines...) Expand all
1472 1478
1473 // Three cases: global variables, lookup variables, and all other types of 1479 // Three cases: global variables, lookup variables, and all other types of
1474 // variables. 1480 // variables.
1475 switch (var->location()) { 1481 switch (var->location()) {
1476 case Variable::UNALLOCATED: { 1482 case Variable::UNALLOCATED: {
1477 Comment cmnt(masm_, "[ Global variable"); 1483 Comment cmnt(masm_, "[ Global variable");
1478 // Use inline caching. Variable name is passed in a2 and the global 1484 // Use inline caching. Variable name is passed in a2 and the global
1479 // object (receiver) in a0. 1485 // object (receiver) in a0.
1480 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand()); 1486 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
1481 __ li(LoadIC::NameRegister(), Operand(var->name())); 1487 __ li(LoadIC::NameRegister(), Operand(var->name()));
1488 if (FLAG_vector_ics) {
1489 __ li(LoadIC::SlotRegister(),
1490 Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
1491 }
1482 CallLoadIC(CONTEXTUAL); 1492 CallLoadIC(CONTEXTUAL);
1483 context()->Plug(v0); 1493 context()->Plug(v0);
1484 break; 1494 break;
1485 } 1495 }
1486 1496
1487 case Variable::PARAMETER: 1497 case Variable::PARAMETER:
1488 case Variable::LOCAL: 1498 case Variable::LOCAL:
1489 case Variable::CONTEXT: { 1499 case Variable::CONTEXT: {
1490 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" 1500 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable"
1491 : "[ Stack variable"); 1501 : "[ Stack variable");
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 } 1560 }
1551 context()->Plug(var); 1561 context()->Plug(var);
1552 break; 1562 break;
1553 } 1563 }
1554 1564
1555 case Variable::LOOKUP: { 1565 case Variable::LOOKUP: {
1556 Comment cmnt(masm_, "[ Lookup variable"); 1566 Comment cmnt(masm_, "[ Lookup variable");
1557 Label done, slow; 1567 Label done, slow;
1558 // Generate code for loading from variables potentially shadowed 1568 // Generate code for loading from variables potentially shadowed
1559 // by eval-introduced variables. 1569 // by eval-introduced variables.
1560 EmitDynamicLookupFastCase(var, NOT_INSIDE_TYPEOF, &slow, &done); 1570 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
1561 __ bind(&slow); 1571 __ bind(&slow);
1562 __ li(a1, Operand(var->name())); 1572 __ li(a1, Operand(var->name()));
1563 __ Push(cp, a1); // Context and name. 1573 __ Push(cp, a1); // Context and name.
1564 __ CallRuntime(Runtime::kLoadLookupSlot, 2); 1574 __ CallRuntime(Runtime::kLoadLookupSlot, 2);
1565 __ bind(&done); 1575 __ bind(&done);
1566 context()->Plug(v0); 1576 context()->Plug(v0);
1567 } 1577 }
1568 } 1578 }
1569 } 1579 }
1570 1580
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 // receiver = iter; f = 'next'; arg = received; 2079 // receiver = iter; f = 'next'; arg = received;
2070 __ bind(&l_next); 2080 __ bind(&l_next);
2071 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" 2081 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
2072 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter 2082 __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
2073 __ Push(load_name, a3, a0); // "next", iter, received 2083 __ Push(load_name, a3, a0); // "next", iter, received
2074 2084
2075 // result = receiver[f](arg); 2085 // result = receiver[f](arg);
2076 __ bind(&l_call); 2086 __ bind(&l_call);
2077 __ ld(load_receiver, MemOperand(sp, kPointerSize)); 2087 __ ld(load_receiver, MemOperand(sp, kPointerSize));
2078 __ ld(load_name, MemOperand(sp, 2 * kPointerSize)); 2088 __ ld(load_name, MemOperand(sp, 2 * kPointerSize));
2089 if (FLAG_vector_ics) {
2090 __ li(LoadIC::SlotRegister(),
2091 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot())));
2092 }
2079 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2093 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2080 CallIC(ic, TypeFeedbackId::None()); 2094 CallIC(ic, TypeFeedbackId::None());
2081 __ mov(a0, v0); 2095 __ mov(a0, v0);
2082 __ mov(a1, a0); 2096 __ mov(a1, a0);
2083 __ sd(a1, MemOperand(sp, 2 * kPointerSize)); 2097 __ sd(a1, MemOperand(sp, 2 * kPointerSize));
2084 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); 2098 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD);
2085 __ CallStub(&stub); 2099 __ CallStub(&stub);
2086 2100
2087 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2101 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2088 __ Drop(1); // The function is still on the stack; drop it. 2102 __ Drop(1); // The function is still on the stack; drop it.
2089 2103
2090 // if (!result.done) goto l_try; 2104 // if (!result.done) goto l_try;
2091 __ Move(load_receiver, v0); 2105 __ Move(load_receiver, v0);
2092 2106
2093 __ push(load_receiver); // save result 2107 __ push(load_receiver); // save result
2094 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" 2108 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
2109 if (FLAG_vector_ics) {
2110 __ li(LoadIC::SlotRegister(),
2111 Operand(Smi::FromInt(expr->DoneFeedbackSlot())));
2112 }
2095 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done 2113 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done
2096 __ mov(a0, v0); 2114 __ mov(a0, v0);
2097 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); 2115 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
2098 CallIC(bool_ic); 2116 CallIC(bool_ic);
2099 __ Branch(&l_try, eq, v0, Operand(zero_reg)); 2117 __ Branch(&l_try, eq, v0, Operand(zero_reg));
2100 2118
2101 // result.value 2119 // result.value
2102 __ pop(load_receiver); // result 2120 __ pop(load_receiver); // result
2103 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" 2121 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
2122 if (FLAG_vector_ics) {
2123 __ li(LoadIC::SlotRegister(),
2124 Operand(Smi::FromInt(expr->ValueFeedbackSlot())));
2125 }
2104 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value 2126 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value
2105 context()->DropAndPlug(2, v0); // drop iter and g 2127 context()->DropAndPlug(2, v0); // drop iter and g
2106 break; 2128 break;
2107 } 2129 }
2108 } 2130 }
2109 } 2131 }
2110 2132
2111 2133
2112 void FullCodeGenerator::EmitGeneratorResume(Expression *generator, 2134 void FullCodeGenerator::EmitGeneratorResume(Expression *generator,
2113 Expression *value, 2135 Expression *value,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2259 // root set. 2281 // root set.
2260 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, 2282 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset,
2261 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); 2283 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs);
2262 } 2284 }
2263 2285
2264 2286
2265 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { 2287 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
2266 SetSourcePosition(prop->position()); 2288 SetSourcePosition(prop->position());
2267 Literal* key = prop->key()->AsLiteral(); 2289 Literal* key = prop->key()->AsLiteral();
2268 __ li(LoadIC::NameRegister(), Operand(key->value())); 2290 __ li(LoadIC::NameRegister(), Operand(key->value()));
2269 // Call load IC. It has register arguments receiver and property. 2291 if (FLAG_vector_ics) {
2270 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); 2292 __ li(LoadIC::SlotRegister(),
2293 Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
2294 CallLoadIC(NOT_CONTEXTUAL);
2295 } else {
2296 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
2297 }
2271 } 2298 }
2272 2299
2273 2300
2274 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { 2301 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2275 SetSourcePosition(prop->position()); 2302 SetSourcePosition(prop->position());
2276 // Call keyed load IC. It has register arguments receiver and key. 2303 // Call keyed load IC. It has register arguments receiver and key.
2277 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2304 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2278 CallIC(ic, prop->PropertyFeedbackId()); 2305 if (FLAG_vector_ics) {
2306 __ li(LoadIC::SlotRegister(),
2307 Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
2308 CallIC(ic);
2309 } else {
2310 CallIC(ic, prop->PropertyFeedbackId());
2311 }
2279 } 2312 }
2280 2313
2281 2314
2282 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2315 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2283 Token::Value op, 2316 Token::Value op,
2284 OverwriteMode mode, 2317 OverwriteMode mode,
2285 Expression* left_expr, 2318 Expression* left_expr,
2286 Expression* right_expr) { 2319 Expression* right_expr) {
2287 Label done, smi_case, stub_call; 2320 Label done, smi_case, stub_call;
2288 2321
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 } else if (call_type == Call::GLOBAL_CALL) { 2779 } else if (call_type == Call::GLOBAL_CALL) {
2747 EmitCallWithLoadIC(expr); 2780 EmitCallWithLoadIC(expr);
2748 } else if (call_type == Call::LOOKUP_SLOT_CALL) { 2781 } else if (call_type == Call::LOOKUP_SLOT_CALL) {
2749 // Call to a lookup slot (dynamically introduced variable). 2782 // Call to a lookup slot (dynamically introduced variable).
2750 VariableProxy* proxy = callee->AsVariableProxy(); 2783 VariableProxy* proxy = callee->AsVariableProxy();
2751 Label slow, done; 2784 Label slow, done;
2752 2785
2753 { PreservePositionScope scope(masm()->positions_recorder()); 2786 { PreservePositionScope scope(masm()->positions_recorder());
2754 // Generate code for loading from variables potentially shadowed 2787 // Generate code for loading from variables potentially shadowed
2755 // by eval-introduced variables. 2788 // by eval-introduced variables.
2756 EmitDynamicLookupFastCase(proxy->var(), NOT_INSIDE_TYPEOF, &slow, &done); 2789 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
2757 } 2790 }
2758 2791
2759 __ bind(&slow); 2792 __ bind(&slow);
2760 // Call the runtime to find the function to call (returned in v0) 2793 // Call the runtime to find the function to call (returned in v0)
2761 // and the object holding it (returned in v1). 2794 // and the object holding it (returned in v1).
2762 ASSERT(!context_register().is(a2)); 2795 ASSERT(!context_register().is(a2));
2763 __ li(a2, Operand(proxy->name())); 2796 __ li(a2, Operand(proxy->name()));
2764 __ Push(context_register(), a2); 2797 __ Push(context_register(), a2);
2765 __ CallRuntime(Runtime::kLoadLookupSlot, 2); 2798 __ CallRuntime(Runtime::kLoadLookupSlot, 2);
2766 __ Push(v0, v1); // Function, receiver. 2799 __ Push(v0, v1); // Function, receiver.
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
4076 4109
4077 if (expr->is_jsruntime()) { 4110 if (expr->is_jsruntime()) {
4078 // Push the builtins object as the receiver. 4111 // Push the builtins object as the receiver.
4079 Register receiver = LoadIC::ReceiverRegister(); 4112 Register receiver = LoadIC::ReceiverRegister();
4080 __ ld(receiver, GlobalObjectOperand()); 4113 __ ld(receiver, GlobalObjectOperand());
4081 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); 4114 __ ld(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset));
4082 __ push(receiver); 4115 __ push(receiver);
4083 4116
4084 // Load the function from the receiver. 4117 // Load the function from the receiver.
4085 __ li(LoadIC::NameRegister(), Operand(expr->name())); 4118 __ li(LoadIC::NameRegister(), Operand(expr->name()));
4086 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); 4119 if (FLAG_vector_ics) {
4120 __ li(LoadIC::SlotRegister(),
4121 Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot())));
4122 CallLoadIC(NOT_CONTEXTUAL);
4123 } else {
4124 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId());
4125 }
4087 4126
4088 // Push the target function under the receiver. 4127 // Push the target function under the receiver.
4089 __ ld(at, MemOperand(sp, 0)); 4128 __ ld(at, MemOperand(sp, 0));
4090 __ push(at); 4129 __ push(at);
4091 __ sd(v0, MemOperand(sp, kPointerSize)); 4130 __ sd(v0, MemOperand(sp, kPointerSize));
4092 4131
4093 // Push the arguments ("left-to-right"). 4132 // Push the arguments ("left-to-right").
4094 int arg_count = args->length(); 4133 int arg_count = args->length();
4095 for (int i = 0; i < arg_count; i++) { 4134 for (int i = 0; i < arg_count; i++) {
4096 VisitForStackValue(args->at(i)); 4135 VisitForStackValue(args->at(i));
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4415 4454
4416 4455
4417 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { 4456 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
4418 ASSERT(!context()->IsEffect()); 4457 ASSERT(!context()->IsEffect());
4419 ASSERT(!context()->IsTest()); 4458 ASSERT(!context()->IsTest());
4420 VariableProxy* proxy = expr->AsVariableProxy(); 4459 VariableProxy* proxy = expr->AsVariableProxy();
4421 if (proxy != NULL && proxy->var()->IsUnallocated()) { 4460 if (proxy != NULL && proxy->var()->IsUnallocated()) {
4422 Comment cmnt(masm_, "[ Global variable"); 4461 Comment cmnt(masm_, "[ Global variable");
4423 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand()); 4462 __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
4424 __ li(LoadIC::NameRegister(), Operand(proxy->name())); 4463 __ li(LoadIC::NameRegister(), Operand(proxy->name()));
4464 if (FLAG_vector_ics) {
4465 __ li(LoadIC::SlotRegister(),
4466 Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
4467 }
4425 // Use a regular load, not a contextual load, to avoid a reference 4468 // Use a regular load, not a contextual load, to avoid a reference
4426 // error. 4469 // error.
4427 CallLoadIC(NOT_CONTEXTUAL); 4470 CallLoadIC(NOT_CONTEXTUAL);
4428 PrepareForBailout(expr, TOS_REG); 4471 PrepareForBailout(expr, TOS_REG);
4429 context()->Plug(v0); 4472 context()->Plug(v0);
4430 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { 4473 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) {
4431 Comment cmnt(masm_, "[ Lookup slot"); 4474 Comment cmnt(masm_, "[ Lookup slot");
4432 Label done, slow; 4475 Label done, slow;
4433 4476
4434 // Generate code for loading from variables potentially shadowed 4477 // Generate code for loading from variables potentially shadowed
4435 // by eval-introduced variables. 4478 // by eval-introduced variables.
4436 EmitDynamicLookupFastCase(proxy->var(), INSIDE_TYPEOF, &slow, &done); 4479 EmitDynamicLookupFastCase(proxy, INSIDE_TYPEOF, &slow, &done);
4437 4480
4438 __ bind(&slow); 4481 __ bind(&slow);
4439 __ li(a0, Operand(proxy->name())); 4482 __ li(a0, Operand(proxy->name()));
4440 __ Push(cp, a0); 4483 __ Push(cp, a0);
4441 __ CallRuntime(Runtime::kLoadLookupSlotNoReferenceError, 2); 4484 __ CallRuntime(Runtime::kLoadLookupSlotNoReferenceError, 2);
4442 PrepareForBailout(expr, TOS_REG); 4485 PrepareForBailout(expr, TOS_REG);
4443 __ bind(&done); 4486 __ bind(&done);
4444 4487
4445 context()->Plug(v0); 4488 context()->Plug(v0);
4446 } else { 4489 } else {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
4849 Assembler::target_address_at(pc_immediate_load_address)) == 4892 Assembler::target_address_at(pc_immediate_load_address)) ==
4850 reinterpret_cast<uint64_t>( 4893 reinterpret_cast<uint64_t>(
4851 isolate->builtins()->OsrAfterStackCheck()->entry())); 4894 isolate->builtins()->OsrAfterStackCheck()->entry()));
4852 return OSR_AFTER_STACK_CHECK; 4895 return OSR_AFTER_STACK_CHECK;
4853 } 4896 }
4854 4897
4855 4898
4856 } } // namespace v8::internal 4899 } } // namespace v8::internal
4857 4900
4858 #endif // V8_TARGET_ARCH_MIPS64 4901 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/mips64/ic-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698