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

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

Powered by Google App Engine
This is Rietveld 408576698