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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 __ Branch(&fast, eq, temp, Operand(t0)); | 1379 __ Branch(&fast, eq, temp, Operand(t0)); |
1380 // Check that extension is NULL. | 1380 // Check that extension is NULL. |
1381 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX)); | 1381 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX)); |
1382 __ Branch(slow, ne, temp, Operand(zero_reg)); | 1382 __ Branch(slow, ne, temp, Operand(zero_reg)); |
1383 // Load next context in chain. | 1383 // Load next context in chain. |
1384 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); | 1384 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); |
1385 __ Branch(&loop); | 1385 __ Branch(&loop); |
1386 __ bind(&fast); | 1386 __ bind(&fast); |
1387 } | 1387 } |
1388 | 1388 |
1389 __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); | 1389 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1390 __ li(LoadConvention::NameRegister(), Operand(proxy->var()->name())); | 1390 __ li(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); |
1391 if (FLAG_vector_ics) { | 1391 if (FLAG_vector_ics) { |
1392 __ li(VectorLoadConvention::SlotRegister(), | 1392 __ li(VectorLoadICDescriptor::SlotRegister(), |
1393 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1393 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); |
1394 } | 1394 } |
1395 | 1395 |
1396 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) | 1396 ContextualMode mode = (typeof_state == INSIDE_TYPEOF) |
1397 ? NOT_CONTEXTUAL | 1397 ? NOT_CONTEXTUAL |
1398 : CONTEXTUAL; | 1398 : CONTEXTUAL; |
1399 CallLoadIC(mode); | 1399 CallLoadIC(mode); |
1400 } | 1400 } |
1401 | 1401 |
1402 | 1402 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { | 1468 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
1469 // Record position before possible IC call. | 1469 // Record position before possible IC call. |
1470 SetSourcePosition(proxy->position()); | 1470 SetSourcePosition(proxy->position()); |
1471 Variable* var = proxy->var(); | 1471 Variable* var = proxy->var(); |
1472 | 1472 |
1473 // Three cases: global variables, lookup variables, and all other types of | 1473 // Three cases: global variables, lookup variables, and all other types of |
1474 // variables. | 1474 // variables. |
1475 switch (var->location()) { | 1475 switch (var->location()) { |
1476 case Variable::UNALLOCATED: { | 1476 case Variable::UNALLOCATED: { |
1477 Comment cmnt(masm_, "[ Global variable"); | 1477 Comment cmnt(masm_, "[ Global variable"); |
1478 __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); | 1478 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
1479 __ li(LoadConvention::NameRegister(), Operand(var->name())); | 1479 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); |
1480 if (FLAG_vector_ics) { | 1480 if (FLAG_vector_ics) { |
1481 __ li(VectorLoadConvention::SlotRegister(), | 1481 __ li(VectorLoadICDescriptor::SlotRegister(), |
1482 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 1482 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); |
1483 } | 1483 } |
1484 CallLoadIC(CONTEXTUAL); | 1484 CallLoadIC(CONTEXTUAL); |
1485 context()->Plug(v0); | 1485 context()->Plug(v0); |
1486 break; | 1486 break; |
1487 } | 1487 } |
1488 | 1488 |
1489 case Variable::PARAMETER: | 1489 case Variable::PARAMETER: |
1490 case Variable::LOCAL: | 1490 case Variable::LOCAL: |
1491 case Variable::CONTEXT: { | 1491 case Variable::CONTEXT: { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 switch (property->kind()) { | 1681 switch (property->kind()) { |
1682 case ObjectLiteral::Property::CONSTANT: | 1682 case ObjectLiteral::Property::CONSTANT: |
1683 UNREACHABLE(); | 1683 UNREACHABLE(); |
1684 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1684 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
1685 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); | 1685 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); |
1686 // Fall through. | 1686 // Fall through. |
1687 case ObjectLiteral::Property::COMPUTED: | 1687 case ObjectLiteral::Property::COMPUTED: |
1688 if (key->value()->IsInternalizedString()) { | 1688 if (key->value()->IsInternalizedString()) { |
1689 if (property->emit_store()) { | 1689 if (property->emit_store()) { |
1690 VisitForAccumulatorValue(value); | 1690 VisitForAccumulatorValue(value); |
1691 __ mov(StoreConvention::ValueRegister(), result_register()); | 1691 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
1692 DCHECK(StoreConvention::ValueRegister().is(a0)); | 1692 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
1693 __ li(StoreConvention::NameRegister(), Operand(key->value())); | 1693 __ li(StoreDescriptor::NameRegister(), Operand(key->value())); |
1694 __ lw(StoreConvention::ReceiverRegister(), MemOperand(sp)); | 1694 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1695 CallStoreIC(key->LiteralFeedbackId()); | 1695 CallStoreIC(key->LiteralFeedbackId()); |
1696 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1696 PrepareForBailoutForId(key->id(), NO_REGISTERS); |
1697 } else { | 1697 } else { |
1698 VisitForEffect(value); | 1698 VisitForEffect(value); |
1699 } | 1699 } |
1700 break; | 1700 break; |
1701 } | 1701 } |
1702 // Duplicate receiver on stack. | 1702 // Duplicate receiver on stack. |
1703 __ lw(a0, MemOperand(sp)); | 1703 __ lw(a0, MemOperand(sp)); |
1704 __ push(a0); | 1704 __ push(a0); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 | 1866 |
1867 // Evaluate LHS expression. | 1867 // Evaluate LHS expression. |
1868 switch (assign_type) { | 1868 switch (assign_type) { |
1869 case VARIABLE: | 1869 case VARIABLE: |
1870 // Nothing to do here. | 1870 // Nothing to do here. |
1871 break; | 1871 break; |
1872 case NAMED_PROPERTY: | 1872 case NAMED_PROPERTY: |
1873 if (expr->is_compound()) { | 1873 if (expr->is_compound()) { |
1874 // We need the receiver both on the stack and in the register. | 1874 // We need the receiver both on the stack and in the register. |
1875 VisitForStackValue(property->obj()); | 1875 VisitForStackValue(property->obj()); |
1876 __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); | 1876 __ lw(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
1877 } else { | 1877 } else { |
1878 VisitForStackValue(property->obj()); | 1878 VisitForStackValue(property->obj()); |
1879 } | 1879 } |
1880 break; | 1880 break; |
1881 case KEYED_PROPERTY: | 1881 case KEYED_PROPERTY: |
1882 // We need the key and receiver on both the stack and in v0 and a1. | 1882 // We need the key and receiver on both the stack and in v0 and a1. |
1883 if (expr->is_compound()) { | 1883 if (expr->is_compound()) { |
1884 VisitForStackValue(property->obj()); | 1884 VisitForStackValue(property->obj()); |
1885 VisitForStackValue(property->key()); | 1885 VisitForStackValue(property->key()); |
1886 __ lw(LoadConvention::ReceiverRegister(), | 1886 __ lw(LoadDescriptor::ReceiverRegister(), |
1887 MemOperand(sp, 1 * kPointerSize)); | 1887 MemOperand(sp, 1 * kPointerSize)); |
1888 __ lw(LoadConvention::NameRegister(), MemOperand(sp, 0)); | 1888 __ lw(LoadDescriptor::NameRegister(), MemOperand(sp, 0)); |
1889 } else { | 1889 } else { |
1890 VisitForStackValue(property->obj()); | 1890 VisitForStackValue(property->obj()); |
1891 VisitForStackValue(property->key()); | 1891 VisitForStackValue(property->key()); |
1892 } | 1892 } |
1893 break; | 1893 break; |
1894 } | 1894 } |
1895 | 1895 |
1896 // For compound assignments we need another deoptimization point after the | 1896 // For compound assignments we need another deoptimization point after the |
1897 // variable/property load. | 1897 // variable/property load. |
1898 if (expr->is_compound()) { | 1898 if (expr->is_compound()) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 | 2016 |
2017 case Yield::kDelegating: { | 2017 case Yield::kDelegating: { |
2018 VisitForStackValue(expr->generator_object()); | 2018 VisitForStackValue(expr->generator_object()); |
2019 | 2019 |
2020 // Initial stack layout is as follows: | 2020 // Initial stack layout is as follows: |
2021 // [sp + 1 * kPointerSize] iter | 2021 // [sp + 1 * kPointerSize] iter |
2022 // [sp + 0 * kPointerSize] g | 2022 // [sp + 0 * kPointerSize] g |
2023 | 2023 |
2024 Label l_catch, l_try, l_suspend, l_continuation, l_resume; | 2024 Label l_catch, l_try, l_suspend, l_continuation, l_resume; |
2025 Label l_next, l_call; | 2025 Label l_next, l_call; |
2026 Register load_receiver = LoadConvention::ReceiverRegister(); | 2026 Register load_receiver = LoadDescriptor::ReceiverRegister(); |
2027 Register load_name = LoadConvention::NameRegister(); | 2027 Register load_name = LoadDescriptor::NameRegister(); |
2028 | 2028 |
2029 // Initial send value is undefined. | 2029 // Initial send value is undefined. |
2030 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); | 2030 __ LoadRoot(a0, Heap::kUndefinedValueRootIndex); |
2031 __ Branch(&l_next); | 2031 __ Branch(&l_next); |
2032 | 2032 |
2033 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } | 2033 // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } |
2034 __ bind(&l_catch); | 2034 __ bind(&l_catch); |
2035 __ mov(a0, v0); | 2035 __ mov(a0, v0); |
2036 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); | 2036 handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos())); |
2037 __ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw" | 2037 __ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 | 2075 |
2076 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" | 2076 __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
2077 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter | 2077 __ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter |
2078 __ Push(load_name, a3, a0); // "next", iter, received | 2078 __ Push(load_name, a3, a0); // "next", iter, received |
2079 | 2079 |
2080 // result = receiver[f](arg); | 2080 // result = receiver[f](arg); |
2081 __ bind(&l_call); | 2081 __ bind(&l_call); |
2082 __ lw(load_receiver, MemOperand(sp, kPointerSize)); | 2082 __ lw(load_receiver, MemOperand(sp, kPointerSize)); |
2083 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); | 2083 __ lw(load_name, MemOperand(sp, 2 * kPointerSize)); |
2084 if (FLAG_vector_ics) { | 2084 if (FLAG_vector_ics) { |
2085 __ li(VectorLoadConvention::SlotRegister(), | 2085 __ li(VectorLoadICDescriptor::SlotRegister(), |
2086 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); | 2086 Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); |
2087 } | 2087 } |
2088 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2088 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2089 CallIC(ic, TypeFeedbackId::None()); | 2089 CallIC(ic, TypeFeedbackId::None()); |
2090 __ mov(a0, v0); | 2090 __ mov(a0, v0); |
2091 __ mov(a1, a0); | 2091 __ mov(a1, a0); |
2092 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); | 2092 __ sw(a1, MemOperand(sp, 2 * kPointerSize)); |
2093 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); | 2093 CallFunctionStub stub(isolate(), 1, CALL_AS_METHOD); |
2094 __ CallStub(&stub); | 2094 __ CallStub(&stub); |
2095 | 2095 |
2096 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2096 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2097 __ Drop(1); // The function is still on the stack; drop it. | 2097 __ Drop(1); // The function is still on the stack; drop it. |
2098 | 2098 |
2099 // if (!result.done) goto l_try; | 2099 // if (!result.done) goto l_try; |
2100 __ Move(load_receiver, v0); | 2100 __ Move(load_receiver, v0); |
2101 | 2101 |
2102 __ push(load_receiver); // save result | 2102 __ push(load_receiver); // save result |
2103 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" | 2103 __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
2104 if (FLAG_vector_ics) { | 2104 if (FLAG_vector_ics) { |
2105 __ li(VectorLoadConvention::SlotRegister(), | 2105 __ li(VectorLoadICDescriptor::SlotRegister(), |
2106 Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); | 2106 Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); |
2107 } | 2107 } |
2108 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done | 2108 CallLoadIC(NOT_CONTEXTUAL); // v0=result.done |
2109 __ mov(a0, v0); | 2109 __ mov(a0, v0); |
2110 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 2110 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
2111 CallIC(bool_ic); | 2111 CallIC(bool_ic); |
2112 __ Branch(&l_try, eq, v0, Operand(zero_reg)); | 2112 __ Branch(&l_try, eq, v0, Operand(zero_reg)); |
2113 | 2113 |
2114 // result.value | 2114 // result.value |
2115 __ pop(load_receiver); // result | 2115 __ pop(load_receiver); // result |
2116 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" | 2116 __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
2117 if (FLAG_vector_ics) { | 2117 if (FLAG_vector_ics) { |
2118 __ li(VectorLoadConvention::SlotRegister(), | 2118 __ li(VectorLoadICDescriptor::SlotRegister(), |
2119 Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); | 2119 Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); |
2120 } | 2120 } |
2121 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value | 2121 CallLoadIC(NOT_CONTEXTUAL); // v0=result.value |
2122 context()->DropAndPlug(2, v0); // drop iter and g | 2122 context()->DropAndPlug(2, v0); // drop iter and g |
2123 break; | 2123 break; |
2124 } | 2124 } |
2125 } | 2125 } |
2126 } | 2126 } |
2127 | 2127 |
2128 | 2128 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2273 // Only the value field needs a write barrier, as the other values are in the | 2273 // Only the value field needs a write barrier, as the other values are in the |
2274 // root set. | 2274 // root set. |
2275 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, | 2275 __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, |
2276 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); | 2276 a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); |
2277 } | 2277 } |
2278 | 2278 |
2279 | 2279 |
2280 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 2280 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
2281 SetSourcePosition(prop->position()); | 2281 SetSourcePosition(prop->position()); |
2282 Literal* key = prop->key()->AsLiteral(); | 2282 Literal* key = prop->key()->AsLiteral(); |
2283 __ li(LoadConvention::NameRegister(), Operand(key->value())); | 2283 __ li(LoadDescriptor::NameRegister(), Operand(key->value())); |
2284 if (FLAG_vector_ics) { | 2284 if (FLAG_vector_ics) { |
2285 __ li(VectorLoadConvention::SlotRegister(), | 2285 __ li(VectorLoadICDescriptor::SlotRegister(), |
2286 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2286 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); |
2287 CallLoadIC(NOT_CONTEXTUAL); | 2287 CallLoadIC(NOT_CONTEXTUAL); |
2288 } else { | 2288 } else { |
2289 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); | 2289 CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId()); |
2290 } | 2290 } |
2291 } | 2291 } |
2292 | 2292 |
2293 | 2293 |
2294 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 2294 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
2295 SetSourcePosition(prop->position()); | 2295 SetSourcePosition(prop->position()); |
2296 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2296 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2297 if (FLAG_vector_ics) { | 2297 if (FLAG_vector_ics) { |
2298 __ li(VectorLoadConvention::SlotRegister(), | 2298 __ li(VectorLoadICDescriptor::SlotRegister(), |
2299 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); | 2299 Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); |
2300 CallIC(ic); | 2300 CallIC(ic); |
2301 } else { | 2301 } else { |
2302 CallIC(ic, prop->PropertyFeedbackId()); | 2302 CallIC(ic, prop->PropertyFeedbackId()); |
2303 } | 2303 } |
2304 } | 2304 } |
2305 | 2305 |
2306 | 2306 |
2307 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 2307 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
2308 Token::Value op, | 2308 Token::Value op, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 switch (assign_type) { | 2427 switch (assign_type) { |
2428 case VARIABLE: { | 2428 case VARIABLE: { |
2429 Variable* var = expr->AsVariableProxy()->var(); | 2429 Variable* var = expr->AsVariableProxy()->var(); |
2430 EffectContext context(this); | 2430 EffectContext context(this); |
2431 EmitVariableAssignment(var, Token::ASSIGN); | 2431 EmitVariableAssignment(var, Token::ASSIGN); |
2432 break; | 2432 break; |
2433 } | 2433 } |
2434 case NAMED_PROPERTY: { | 2434 case NAMED_PROPERTY: { |
2435 __ push(result_register()); // Preserve value. | 2435 __ push(result_register()); // Preserve value. |
2436 VisitForAccumulatorValue(prop->obj()); | 2436 VisitForAccumulatorValue(prop->obj()); |
2437 __ mov(StoreConvention::ReceiverRegister(), result_register()); | 2437 __ mov(StoreDescriptor::ReceiverRegister(), result_register()); |
2438 __ pop(StoreConvention::ValueRegister()); // Restore value. | 2438 __ pop(StoreDescriptor::ValueRegister()); // Restore value. |
2439 __ li(StoreConvention::NameRegister(), | 2439 __ li(StoreDescriptor::NameRegister(), |
2440 Operand(prop->key()->AsLiteral()->value())); | 2440 Operand(prop->key()->AsLiteral()->value())); |
2441 CallStoreIC(); | 2441 CallStoreIC(); |
2442 break; | 2442 break; |
2443 } | 2443 } |
2444 case KEYED_PROPERTY: { | 2444 case KEYED_PROPERTY: { |
2445 __ push(result_register()); // Preserve value. | 2445 __ push(result_register()); // Preserve value. |
2446 VisitForStackValue(prop->obj()); | 2446 VisitForStackValue(prop->obj()); |
2447 VisitForAccumulatorValue(prop->key()); | 2447 VisitForAccumulatorValue(prop->key()); |
2448 __ mov(StoreConvention::NameRegister(), result_register()); | 2448 __ mov(StoreDescriptor::NameRegister(), result_register()); |
2449 __ Pop(StoreConvention::ValueRegister(), | 2449 __ Pop(StoreDescriptor::ValueRegister(), |
2450 StoreConvention::ReceiverRegister()); | 2450 StoreDescriptor::ReceiverRegister()); |
2451 Handle<Code> ic = strict_mode() == SLOPPY | 2451 Handle<Code> ic = strict_mode() == SLOPPY |
2452 ? isolate()->builtins()->KeyedStoreIC_Initialize() | 2452 ? isolate()->builtins()->KeyedStoreIC_Initialize() |
2453 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); | 2453 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
2454 CallIC(ic); | 2454 CallIC(ic); |
2455 break; | 2455 break; |
2456 } | 2456 } |
2457 } | 2457 } |
2458 context()->Plug(v0); | 2458 context()->Plug(v0); |
2459 } | 2459 } |
2460 | 2460 |
2461 | 2461 |
2462 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2462 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
2463 Variable* var, MemOperand location) { | 2463 Variable* var, MemOperand location) { |
2464 __ sw(result_register(), location); | 2464 __ sw(result_register(), location); |
2465 if (var->IsContextSlot()) { | 2465 if (var->IsContextSlot()) { |
2466 // RecordWrite may destroy all its register arguments. | 2466 // RecordWrite may destroy all its register arguments. |
2467 __ Move(a3, result_register()); | 2467 __ Move(a3, result_register()); |
2468 int offset = Context::SlotOffset(var->index()); | 2468 int offset = Context::SlotOffset(var->index()); |
2469 __ RecordWriteContextSlot( | 2469 __ RecordWriteContextSlot( |
2470 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs); | 2470 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs); |
2471 } | 2471 } |
2472 } | 2472 } |
2473 | 2473 |
2474 | 2474 |
2475 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { | 2475 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
2476 if (var->IsUnallocated()) { | 2476 if (var->IsUnallocated()) { |
2477 // Global var, const, or let. | 2477 // Global var, const, or let. |
2478 __ mov(StoreConvention::ValueRegister(), result_register()); | 2478 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2479 __ li(StoreConvention::NameRegister(), Operand(var->name())); | 2479 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); |
2480 __ lw(StoreConvention::ReceiverRegister(), GlobalObjectOperand()); | 2480 __ lw(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
2481 CallStoreIC(); | 2481 CallStoreIC(); |
2482 | 2482 |
2483 } else if (op == Token::INIT_CONST_LEGACY) { | 2483 } else if (op == Token::INIT_CONST_LEGACY) { |
2484 // Const initializers need a write barrier. | 2484 // Const initializers need a write barrier. |
2485 DCHECK(!var->IsParameter()); // No const parameters. | 2485 DCHECK(!var->IsParameter()); // No const parameters. |
2486 if (var->IsLookupSlot()) { | 2486 if (var->IsLookupSlot()) { |
2487 __ li(a0, Operand(var->name())); | 2487 __ li(a0, Operand(var->name())); |
2488 __ Push(v0, cp, a0); // Context and name. | 2488 __ Push(v0, cp, a0); // Context and name. |
2489 __ CallRuntime(Runtime::kInitializeLegacyConstLookupSlot, 3); | 2489 __ CallRuntime(Runtime::kInitializeLegacyConstLookupSlot, 3); |
2490 } else { | 2490 } else { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 | 2540 |
2541 | 2541 |
2542 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { | 2542 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
2543 // Assignment to a property, using a named store IC. | 2543 // Assignment to a property, using a named store IC. |
2544 Property* prop = expr->target()->AsProperty(); | 2544 Property* prop = expr->target()->AsProperty(); |
2545 DCHECK(prop != NULL); | 2545 DCHECK(prop != NULL); |
2546 DCHECK(prop->key()->IsLiteral()); | 2546 DCHECK(prop->key()->IsLiteral()); |
2547 | 2547 |
2548 // Record source code position before IC call. | 2548 // Record source code position before IC call. |
2549 SetSourcePosition(expr->position()); | 2549 SetSourcePosition(expr->position()); |
2550 __ mov(StoreConvention::ValueRegister(), result_register()); | 2550 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2551 __ li(StoreConvention::NameRegister(), | 2551 __ li(StoreDescriptor::NameRegister(), |
2552 Operand(prop->key()->AsLiteral()->value())); | 2552 Operand(prop->key()->AsLiteral()->value())); |
2553 __ pop(StoreConvention::ReceiverRegister()); | 2553 __ pop(StoreDescriptor::ReceiverRegister()); |
2554 CallStoreIC(expr->AssignmentFeedbackId()); | 2554 CallStoreIC(expr->AssignmentFeedbackId()); |
2555 | 2555 |
2556 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2556 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
2557 context()->Plug(v0); | 2557 context()->Plug(v0); |
2558 } | 2558 } |
2559 | 2559 |
2560 | 2560 |
2561 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { | 2561 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
2562 // Assignment to a property, using a keyed store IC. | 2562 // Assignment to a property, using a keyed store IC. |
2563 | 2563 |
2564 // Record source code position before IC call. | 2564 // Record source code position before IC call. |
2565 SetSourcePosition(expr->position()); | 2565 SetSourcePosition(expr->position()); |
2566 // Call keyed store IC. | 2566 // Call keyed store IC. |
2567 // The arguments are: | 2567 // The arguments are: |
2568 // - a0 is the value, | 2568 // - a0 is the value, |
2569 // - a1 is the key, | 2569 // - a1 is the key, |
2570 // - a2 is the receiver. | 2570 // - a2 is the receiver. |
2571 __ mov(StoreConvention::ValueRegister(), result_register()); | 2571 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2572 __ Pop(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister()); | 2572 __ Pop(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); |
2573 DCHECK(StoreConvention::ValueRegister().is(a0)); | 2573 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
2574 | 2574 |
2575 Handle<Code> ic = strict_mode() == SLOPPY | 2575 Handle<Code> ic = strict_mode() == SLOPPY |
2576 ? isolate()->builtins()->KeyedStoreIC_Initialize() | 2576 ? isolate()->builtins()->KeyedStoreIC_Initialize() |
2577 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); | 2577 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
2578 CallIC(ic, expr->AssignmentFeedbackId()); | 2578 CallIC(ic, expr->AssignmentFeedbackId()); |
2579 | 2579 |
2580 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 2580 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
2581 context()->Plug(v0); | 2581 context()->Plug(v0); |
2582 } | 2582 } |
2583 | 2583 |
2584 | 2584 |
2585 void FullCodeGenerator::VisitProperty(Property* expr) { | 2585 void FullCodeGenerator::VisitProperty(Property* expr) { |
2586 Comment cmnt(masm_, "[ Property"); | 2586 Comment cmnt(masm_, "[ Property"); |
2587 Expression* key = expr->key(); | 2587 Expression* key = expr->key(); |
2588 | 2588 |
2589 if (key->IsPropertyName()) { | 2589 if (key->IsPropertyName()) { |
2590 VisitForAccumulatorValue(expr->obj()); | 2590 VisitForAccumulatorValue(expr->obj()); |
2591 __ Move(LoadConvention::ReceiverRegister(), v0); | 2591 __ Move(LoadDescriptor::ReceiverRegister(), v0); |
2592 EmitNamedPropertyLoad(expr); | 2592 EmitNamedPropertyLoad(expr); |
2593 PrepareForBailoutForId(expr->LoadId(), TOS_REG); | 2593 PrepareForBailoutForId(expr->LoadId(), TOS_REG); |
2594 context()->Plug(v0); | 2594 context()->Plug(v0); |
2595 } else { | 2595 } else { |
2596 VisitForStackValue(expr->obj()); | 2596 VisitForStackValue(expr->obj()); |
2597 VisitForAccumulatorValue(expr->key()); | 2597 VisitForAccumulatorValue(expr->key()); |
2598 __ Move(LoadConvention::NameRegister(), v0); | 2598 __ Move(LoadDescriptor::NameRegister(), v0); |
2599 __ pop(LoadConvention::ReceiverRegister()); | 2599 __ pop(LoadDescriptor::ReceiverRegister()); |
2600 EmitKeyedPropertyLoad(expr); | 2600 EmitKeyedPropertyLoad(expr); |
2601 context()->Plug(v0); | 2601 context()->Plug(v0); |
2602 } | 2602 } |
2603 } | 2603 } |
2604 | 2604 |
2605 | 2605 |
2606 void FullCodeGenerator::CallIC(Handle<Code> code, | 2606 void FullCodeGenerator::CallIC(Handle<Code> code, |
2607 TypeFeedbackId id) { | 2607 TypeFeedbackId id) { |
2608 ic_total_count_++; | 2608 ic_total_count_++; |
2609 __ Call(code, RelocInfo::CODE_TARGET, id); | 2609 __ Call(code, RelocInfo::CODE_TARGET, id); |
(...skipping 13 matching lines...) Expand all Loading... |
2623 { StackValueContext context(this); | 2623 { StackValueContext context(this); |
2624 EmitVariableLoad(callee->AsVariableProxy()); | 2624 EmitVariableLoad(callee->AsVariableProxy()); |
2625 PrepareForBailout(callee, NO_REGISTERS); | 2625 PrepareForBailout(callee, NO_REGISTERS); |
2626 } | 2626 } |
2627 // Push undefined as receiver. This is patched in the method prologue if it | 2627 // Push undefined as receiver. This is patched in the method prologue if it |
2628 // is a sloppy mode method. | 2628 // is a sloppy mode method. |
2629 __ Push(isolate()->factory()->undefined_value()); | 2629 __ Push(isolate()->factory()->undefined_value()); |
2630 } else { | 2630 } else { |
2631 // Load the function from the receiver. | 2631 // Load the function from the receiver. |
2632 DCHECK(callee->IsProperty()); | 2632 DCHECK(callee->IsProperty()); |
2633 __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); | 2633 __ lw(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
2634 EmitNamedPropertyLoad(callee->AsProperty()); | 2634 EmitNamedPropertyLoad(callee->AsProperty()); |
2635 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); | 2635 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
2636 // Push the target function under the receiver. | 2636 // Push the target function under the receiver. |
2637 __ lw(at, MemOperand(sp, 0)); | 2637 __ lw(at, MemOperand(sp, 0)); |
2638 __ push(at); | 2638 __ push(at); |
2639 __ sw(v0, MemOperand(sp, kPointerSize)); | 2639 __ sw(v0, MemOperand(sp, kPointerSize)); |
2640 } | 2640 } |
2641 | 2641 |
2642 EmitCall(expr, call_type); | 2642 EmitCall(expr, call_type); |
2643 } | 2643 } |
2644 | 2644 |
2645 | 2645 |
2646 // Code common for calls using the IC. | 2646 // Code common for calls using the IC. |
2647 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, | 2647 void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, |
2648 Expression* key) { | 2648 Expression* key) { |
2649 // Load the key. | 2649 // Load the key. |
2650 VisitForAccumulatorValue(key); | 2650 VisitForAccumulatorValue(key); |
2651 | 2651 |
2652 Expression* callee = expr->expression(); | 2652 Expression* callee = expr->expression(); |
2653 | 2653 |
2654 // Load the function from the receiver. | 2654 // Load the function from the receiver. |
2655 DCHECK(callee->IsProperty()); | 2655 DCHECK(callee->IsProperty()); |
2656 __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); | 2656 __ lw(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
2657 __ Move(LoadConvention::NameRegister(), v0); | 2657 __ Move(LoadDescriptor::NameRegister(), v0); |
2658 EmitKeyedPropertyLoad(callee->AsProperty()); | 2658 EmitKeyedPropertyLoad(callee->AsProperty()); |
2659 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); | 2659 PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
2660 | 2660 |
2661 // Push the target function under the receiver. | 2661 // Push the target function under the receiver. |
2662 __ lw(at, MemOperand(sp, 0)); | 2662 __ lw(at, MemOperand(sp, 0)); |
2663 __ push(at); | 2663 __ push(at); |
2664 __ sw(v0, MemOperand(sp, kPointerSize)); | 2664 __ sw(v0, MemOperand(sp, kPointerSize)); |
2665 | 2665 |
2666 EmitCall(expr, CallIC::METHOD); | 2666 EmitCall(expr, CallIC::METHOD); |
2667 } | 2667 } |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4091 EmitInlineRuntimeCall(expr); | 4091 EmitInlineRuntimeCall(expr); |
4092 return; | 4092 return; |
4093 } | 4093 } |
4094 | 4094 |
4095 Comment cmnt(masm_, "[ CallRuntime"); | 4095 Comment cmnt(masm_, "[ CallRuntime"); |
4096 ZoneList<Expression*>* args = expr->arguments(); | 4096 ZoneList<Expression*>* args = expr->arguments(); |
4097 int arg_count = args->length(); | 4097 int arg_count = args->length(); |
4098 | 4098 |
4099 if (expr->is_jsruntime()) { | 4099 if (expr->is_jsruntime()) { |
4100 // Push the builtins object as the receiver. | 4100 // Push the builtins object as the receiver. |
4101 Register receiver = LoadConvention::ReceiverRegister(); | 4101 Register receiver = LoadDescriptor::ReceiverRegister(); |
4102 __ lw(receiver, GlobalObjectOperand()); | 4102 __ lw(receiver, GlobalObjectOperand()); |
4103 __ lw(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); | 4103 __ lw(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); |
4104 __ push(receiver); | 4104 __ push(receiver); |
4105 | 4105 |
4106 // Load the function from the receiver. | 4106 // Load the function from the receiver. |
4107 __ li(LoadConvention::NameRegister(), Operand(expr->name())); | 4107 __ li(LoadDescriptor::NameRegister(), Operand(expr->name())); |
4108 if (FLAG_vector_ics) { | 4108 if (FLAG_vector_ics) { |
4109 __ li(VectorLoadConvention::SlotRegister(), | 4109 __ li(VectorLoadICDescriptor::SlotRegister(), |
4110 Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); | 4110 Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); |
4111 CallLoadIC(NOT_CONTEXTUAL); | 4111 CallLoadIC(NOT_CONTEXTUAL); |
4112 } else { | 4112 } else { |
4113 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); | 4113 CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
4114 } | 4114 } |
4115 | 4115 |
4116 // Push the target function under the receiver. | 4116 // Push the target function under the receiver. |
4117 __ lw(at, MemOperand(sp, 0)); | 4117 __ lw(at, MemOperand(sp, 0)); |
4118 __ push(at); | 4118 __ push(at); |
4119 __ sw(v0, MemOperand(sp, kPointerSize)); | 4119 __ sw(v0, MemOperand(sp, kPointerSize)); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4282 EmitVariableLoad(expr->expression()->AsVariableProxy()); | 4282 EmitVariableLoad(expr->expression()->AsVariableProxy()); |
4283 } else { | 4283 } else { |
4284 // Reserve space for result of postfix operation. | 4284 // Reserve space for result of postfix operation. |
4285 if (expr->is_postfix() && !context()->IsEffect()) { | 4285 if (expr->is_postfix() && !context()->IsEffect()) { |
4286 __ li(at, Operand(Smi::FromInt(0))); | 4286 __ li(at, Operand(Smi::FromInt(0))); |
4287 __ push(at); | 4287 __ push(at); |
4288 } | 4288 } |
4289 if (assign_type == NAMED_PROPERTY) { | 4289 if (assign_type == NAMED_PROPERTY) { |
4290 // Put the object both on the stack and in the register. | 4290 // Put the object both on the stack and in the register. |
4291 VisitForStackValue(prop->obj()); | 4291 VisitForStackValue(prop->obj()); |
4292 __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); | 4292 __ lw(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
4293 EmitNamedPropertyLoad(prop); | 4293 EmitNamedPropertyLoad(prop); |
4294 } else { | 4294 } else { |
4295 VisitForStackValue(prop->obj()); | 4295 VisitForStackValue(prop->obj()); |
4296 VisitForStackValue(prop->key()); | 4296 VisitForStackValue(prop->key()); |
4297 __ lw(LoadConvention::ReceiverRegister(), | 4297 __ lw(LoadDescriptor::ReceiverRegister(), |
4298 MemOperand(sp, 1 * kPointerSize)); | 4298 MemOperand(sp, 1 * kPointerSize)); |
4299 __ lw(LoadConvention::NameRegister(), MemOperand(sp, 0)); | 4299 __ lw(LoadDescriptor::NameRegister(), MemOperand(sp, 0)); |
4300 EmitKeyedPropertyLoad(prop); | 4300 EmitKeyedPropertyLoad(prop); |
4301 } | 4301 } |
4302 } | 4302 } |
4303 | 4303 |
4304 // We need a second deoptimization point after loading the value | 4304 // We need a second deoptimization point after loading the value |
4305 // in case evaluating the property load my have a side effect. | 4305 // in case evaluating the property load my have a side effect. |
4306 if (assign_type == VARIABLE) { | 4306 if (assign_type == VARIABLE) { |
4307 PrepareForBailout(expr->expression(), TOS_REG); | 4307 PrepareForBailout(expr->expression(), TOS_REG); |
4308 } else { | 4308 } else { |
4309 PrepareForBailoutForId(prop->LoadId(), TOS_REG); | 4309 PrepareForBailoutForId(prop->LoadId(), TOS_REG); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4400 context()->PlugTOS(); | 4400 context()->PlugTOS(); |
4401 } | 4401 } |
4402 } else { | 4402 } else { |
4403 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 4403 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
4404 Token::ASSIGN); | 4404 Token::ASSIGN); |
4405 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4405 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
4406 context()->Plug(v0); | 4406 context()->Plug(v0); |
4407 } | 4407 } |
4408 break; | 4408 break; |
4409 case NAMED_PROPERTY: { | 4409 case NAMED_PROPERTY: { |
4410 __ mov(StoreConvention::ValueRegister(), result_register()); | 4410 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
4411 __ li(StoreConvention::NameRegister(), | 4411 __ li(StoreDescriptor::NameRegister(), |
4412 Operand(prop->key()->AsLiteral()->value())); | 4412 Operand(prop->key()->AsLiteral()->value())); |
4413 __ pop(StoreConvention::ReceiverRegister()); | 4413 __ pop(StoreDescriptor::ReceiverRegister()); |
4414 CallStoreIC(expr->CountStoreFeedbackId()); | 4414 CallStoreIC(expr->CountStoreFeedbackId()); |
4415 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4415 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
4416 if (expr->is_postfix()) { | 4416 if (expr->is_postfix()) { |
4417 if (!context()->IsEffect()) { | 4417 if (!context()->IsEffect()) { |
4418 context()->PlugTOS(); | 4418 context()->PlugTOS(); |
4419 } | 4419 } |
4420 } else { | 4420 } else { |
4421 context()->Plug(v0); | 4421 context()->Plug(v0); |
4422 } | 4422 } |
4423 break; | 4423 break; |
4424 } | 4424 } |
4425 case KEYED_PROPERTY: { | 4425 case KEYED_PROPERTY: { |
4426 __ mov(StoreConvention::ValueRegister(), result_register()); | 4426 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
4427 __ Pop(StoreConvention::ReceiverRegister(), | 4427 __ Pop(StoreDescriptor::ReceiverRegister(), |
4428 StoreConvention::NameRegister()); | 4428 StoreDescriptor::NameRegister()); |
4429 Handle<Code> ic = strict_mode() == SLOPPY | 4429 Handle<Code> ic = strict_mode() == SLOPPY |
4430 ? isolate()->builtins()->KeyedStoreIC_Initialize() | 4430 ? isolate()->builtins()->KeyedStoreIC_Initialize() |
4431 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); | 4431 : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); |
4432 CallIC(ic, expr->CountStoreFeedbackId()); | 4432 CallIC(ic, expr->CountStoreFeedbackId()); |
4433 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4433 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
4434 if (expr->is_postfix()) { | 4434 if (expr->is_postfix()) { |
4435 if (!context()->IsEffect()) { | 4435 if (!context()->IsEffect()) { |
4436 context()->PlugTOS(); | 4436 context()->PlugTOS(); |
4437 } | 4437 } |
4438 } else { | 4438 } else { |
4439 context()->Plug(v0); | 4439 context()->Plug(v0); |
4440 } | 4440 } |
4441 break; | 4441 break; |
4442 } | 4442 } |
4443 } | 4443 } |
4444 } | 4444 } |
4445 | 4445 |
4446 | 4446 |
4447 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 4447 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
4448 DCHECK(!context()->IsEffect()); | 4448 DCHECK(!context()->IsEffect()); |
4449 DCHECK(!context()->IsTest()); | 4449 DCHECK(!context()->IsTest()); |
4450 VariableProxy* proxy = expr->AsVariableProxy(); | 4450 VariableProxy* proxy = expr->AsVariableProxy(); |
4451 if (proxy != NULL && proxy->var()->IsUnallocated()) { | 4451 if (proxy != NULL && proxy->var()->IsUnallocated()) { |
4452 Comment cmnt(masm_, "[ Global variable"); | 4452 Comment cmnt(masm_, "[ Global variable"); |
4453 __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); | 4453 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
4454 __ li(LoadConvention::NameRegister(), Operand(proxy->name())); | 4454 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); |
4455 if (FLAG_vector_ics) { | 4455 if (FLAG_vector_ics) { |
4456 __ li(VectorLoadConvention::SlotRegister(), | 4456 __ li(VectorLoadICDescriptor::SlotRegister(), |
4457 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); | 4457 Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); |
4458 } | 4458 } |
4459 // Use a regular load, not a contextual load, to avoid a reference | 4459 // Use a regular load, not a contextual load, to avoid a reference |
4460 // error. | 4460 // error. |
4461 CallLoadIC(NOT_CONTEXTUAL); | 4461 CallLoadIC(NOT_CONTEXTUAL); |
4462 PrepareForBailout(expr, TOS_REG); | 4462 PrepareForBailout(expr, TOS_REG); |
4463 context()->Plug(v0); | 4463 context()->Plug(v0); |
4464 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { | 4464 } else if (proxy != NULL && proxy->var()->IsLookupSlot()) { |
4465 Comment cmnt(masm_, "[ Lookup slot"); | 4465 Comment cmnt(masm_, "[ Lookup slot"); |
4466 Label done, slow; | 4466 Label done, slow; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4879 Assembler::target_address_at(pc_immediate_load_address)) == | 4879 Assembler::target_address_at(pc_immediate_load_address)) == |
4880 reinterpret_cast<uint32_t>( | 4880 reinterpret_cast<uint32_t>( |
4881 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4881 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4882 return OSR_AFTER_STACK_CHECK; | 4882 return OSR_AFTER_STACK_CHECK; |
4883 } | 4883 } |
4884 | 4884 |
4885 | 4885 |
4886 } } // namespace v8::internal | 4886 } } // namespace v8::internal |
4887 | 4887 |
4888 #endif // V8_TARGET_ARCH_MIPS | 4888 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |