OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 __ mov(r3, Operand(info)); | 1210 __ mov(r3, Operand(info)); |
1211 __ LoadRoot( | 1211 __ LoadRoot( |
1212 r4, pretenure ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | 1212 r4, pretenure ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); |
1213 __ Push(cp, r3, r4); | 1213 __ Push(cp, r3, r4); |
1214 __ CallRuntime(Runtime::kNewClosure, 3); | 1214 __ CallRuntime(Runtime::kNewClosure, 3); |
1215 } | 1215 } |
1216 context()->Plug(r3); | 1216 context()->Plug(r3); |
1217 } | 1217 } |
1218 | 1218 |
1219 | 1219 |
1220 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, | 1220 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
1221 int offset, | 1221 FeedbackVectorICSlot slot) { |
1222 FeedbackVectorICSlot slot) { | 1222 DCHECK(NeedsHomeObject(initializer)); |
1223 if (NeedsHomeObject(initializer)) { | 1223 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1224 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1224 __ mov(StoreDescriptor::NameRegister(), |
1225 __ mov(StoreDescriptor::NameRegister(), | 1225 Operand(isolate()->factory()->home_object_symbol())); |
1226 Operand(isolate()->factory()->home_object_symbol())); | 1226 __ LoadP(StoreDescriptor::ValueRegister(), |
1227 __ LoadP(StoreDescriptor::ValueRegister(), | 1227 MemOperand(sp, offset * kPointerSize)); |
1228 MemOperand(sp, offset * kPointerSize)); | 1228 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1229 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1229 CallStoreIC(); |
1230 CallStoreIC(); | |
1231 } | |
1232 } | 1230 } |
1233 | 1231 |
1234 | 1232 |
| 1233 void FullCodeGenerator::EmitSetHomeObjectAccumulator( |
| 1234 Expression* initializer, int offset, FeedbackVectorICSlot slot) { |
| 1235 DCHECK(NeedsHomeObject(initializer)); |
| 1236 __ Move(StoreDescriptor::ReceiverRegister(), r3); |
| 1237 __ mov(StoreDescriptor::NameRegister(), |
| 1238 Operand(isolate()->factory()->home_object_symbol())); |
| 1239 __ LoadP(StoreDescriptor::ValueRegister(), |
| 1240 MemOperand(sp, offset * kPointerSize)); |
| 1241 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 1242 CallStoreIC(); |
| 1243 } |
| 1244 |
| 1245 |
1235 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1246 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
1236 TypeofMode typeof_mode, | 1247 TypeofMode typeof_mode, |
1237 Label* slow) { | 1248 Label* slow) { |
1238 Register current = cp; | 1249 Register current = cp; |
1239 Register next = r4; | 1250 Register next = r4; |
1240 Register temp = r5; | 1251 Register temp = r5; |
1241 | 1252 |
1242 Scope* s = scope(); | 1253 Scope* s = scope(); |
1243 while (s != NULL) { | 1254 while (s != NULL) { |
1244 if (s->num_heap_slots() > 0) { | 1255 if (s->num_heap_slots() > 0) { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 __ bind(&allocated); | 1502 __ bind(&allocated); |
1492 // After this, registers are used as follows: | 1503 // After this, registers are used as follows: |
1493 // r3: Newly allocated regexp. | 1504 // r3: Newly allocated regexp. |
1494 // r8: Materialized regexp. | 1505 // r8: Materialized regexp. |
1495 // r5: temp. | 1506 // r5: temp. |
1496 __ CopyFields(r3, r8, r5.bit(), size / kPointerSize); | 1507 __ CopyFields(r3, r8, r5.bit(), size / kPointerSize); |
1497 context()->Plug(r3); | 1508 context()->Plug(r3); |
1498 } | 1509 } |
1499 | 1510 |
1500 | 1511 |
1501 void FullCodeGenerator::EmitAccessor(Expression* expression) { | 1512 void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) { |
| 1513 Expression* expression = (property == NULL) ? NULL : property->value(); |
1502 if (expression == NULL) { | 1514 if (expression == NULL) { |
1503 __ LoadRoot(r4, Heap::kNullValueRootIndex); | 1515 __ LoadRoot(r4, Heap::kNullValueRootIndex); |
1504 __ push(r4); | 1516 __ push(r4); |
1505 } else { | 1517 } else { |
1506 VisitForStackValue(expression); | 1518 VisitForStackValue(expression); |
| 1519 if (NeedsHomeObject(expression)) { |
| 1520 DCHECK(property->kind() == ObjectLiteral::Property::GETTER || |
| 1521 property->kind() == ObjectLiteral::Property::SETTER); |
| 1522 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; |
| 1523 EmitSetHomeObject(expression, offset, property->GetSlot()); |
| 1524 } |
1507 } | 1525 } |
1508 } | 1526 } |
1509 | 1527 |
1510 | 1528 |
1511 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1529 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1512 Comment cmnt(masm_, "[ ObjectLiteral"); | 1530 Comment cmnt(masm_, "[ ObjectLiteral"); |
1513 | 1531 |
1514 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1532 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1515 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1533 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1516 __ LoadP(r6, FieldMemOperand(r6, JSFunction::kLiteralsOffset)); | 1534 __ LoadP(r6, FieldMemOperand(r6, JSFunction::kLiteralsOffset)); |
1517 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); | 1535 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); |
1518 __ mov(r4, Operand(constant_properties)); | 1536 __ mov(r4, Operand(constant_properties)); |
1519 int flags = expr->ComputeFlags(); | 1537 int flags = expr->ComputeFlags(); |
1520 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); | 1538 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); |
1521 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1539 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1522 __ Push(r6, r5, r4, r3); | 1540 __ Push(r6, r5, r4, r3); |
1523 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1541 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1524 } else { | 1542 } else { |
1525 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); | 1543 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
1526 __ CallStub(&stub); | 1544 __ CallStub(&stub); |
1527 } | 1545 } |
1528 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); | 1546 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
1529 | 1547 |
1530 // If result_saved is true the result is on top of the stack. If | 1548 // If result_saved is true the result is on top of the stack. If |
1531 // result_saved is false the result is in r3. | 1549 // result_saved is false the result is in r3. |
1532 bool result_saved = false; | 1550 bool result_saved = false; |
1533 | 1551 |
1534 AccessorTable accessor_table(zone()); | 1552 AccessorTable accessor_table(zone()); |
1535 int property_index = 0; | 1553 int property_index = 0; |
1536 // store_slot_index points to the vector IC slot for the next store IC used. | |
1537 // ObjectLiteral::ComputeFeedbackRequirements controls the allocation of slots | |
1538 // and must be updated if the number of store ICs emitted here changes. | |
1539 int store_slot_index = 0; | |
1540 for (; property_index < expr->properties()->length(); property_index++) { | 1554 for (; property_index < expr->properties()->length(); property_index++) { |
1541 ObjectLiteral::Property* property = expr->properties()->at(property_index); | 1555 ObjectLiteral::Property* property = expr->properties()->at(property_index); |
1542 if (property->is_computed_name()) break; | 1556 if (property->is_computed_name()) break; |
1543 if (property->IsCompileTimeValue()) continue; | 1557 if (property->IsCompileTimeValue()) continue; |
1544 | 1558 |
1545 Literal* key = property->key()->AsLiteral(); | 1559 Literal* key = property->key()->AsLiteral(); |
1546 Expression* value = property->value(); | 1560 Expression* value = property->value(); |
1547 if (!result_saved) { | 1561 if (!result_saved) { |
1548 __ push(r3); // Save result on stack | 1562 __ push(r3); // Save result on stack |
1549 result_saved = true; | 1563 result_saved = true; |
1550 } | 1564 } |
1551 switch (property->kind()) { | 1565 switch (property->kind()) { |
1552 case ObjectLiteral::Property::CONSTANT: | 1566 case ObjectLiteral::Property::CONSTANT: |
1553 UNREACHABLE(); | 1567 UNREACHABLE(); |
1554 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1568 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
1555 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); | 1569 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); |
1556 // Fall through. | 1570 // Fall through. |
1557 case ObjectLiteral::Property::COMPUTED: | 1571 case ObjectLiteral::Property::COMPUTED: |
1558 // It is safe to use [[Put]] here because the boilerplate already | 1572 // It is safe to use [[Put]] here because the boilerplate already |
1559 // contains computed properties with an uninitialized value. | 1573 // contains computed properties with an uninitialized value. |
1560 if (key->value()->IsInternalizedString()) { | 1574 if (key->value()->IsInternalizedString()) { |
1561 if (property->emit_store()) { | 1575 if (property->emit_store()) { |
1562 VisitForAccumulatorValue(value); | 1576 VisitForAccumulatorValue(value); |
1563 DCHECK(StoreDescriptor::ValueRegister().is(r3)); | 1577 DCHECK(StoreDescriptor::ValueRegister().is(r3)); |
1564 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); | 1578 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); |
1565 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1579 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1566 if (FLAG_vector_stores) { | 1580 if (FLAG_vector_stores) { |
1567 EmitLoadStoreICSlot(expr->GetNthSlot(store_slot_index++)); | 1581 EmitLoadStoreICSlot(property->GetSlot(0)); |
1568 CallStoreIC(); | 1582 CallStoreIC(); |
1569 } else { | 1583 } else { |
1570 CallStoreIC(key->LiteralFeedbackId()); | 1584 CallStoreIC(key->LiteralFeedbackId()); |
1571 } | 1585 } |
1572 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1586 PrepareForBailoutForId(key->id(), NO_REGISTERS); |
1573 | 1587 |
1574 if (NeedsHomeObject(value)) { | 1588 if (NeedsHomeObject(value)) { |
1575 __ Move(StoreDescriptor::ReceiverRegister(), r3); | 1589 EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); |
1576 __ mov(StoreDescriptor::NameRegister(), | |
1577 Operand(isolate()->factory()->home_object_symbol())); | |
1578 __ LoadP(StoreDescriptor::ValueRegister(), MemOperand(sp)); | |
1579 if (FLAG_vector_stores) { | |
1580 EmitLoadStoreICSlot(expr->GetNthSlot(store_slot_index++)); | |
1581 } | |
1582 CallStoreIC(); | |
1583 } | 1590 } |
1584 } else { | 1591 } else { |
1585 VisitForEffect(value); | 1592 VisitForEffect(value); |
1586 } | 1593 } |
1587 break; | 1594 break; |
1588 } | 1595 } |
1589 // Duplicate receiver on stack. | 1596 // Duplicate receiver on stack. |
1590 __ LoadP(r3, MemOperand(sp)); | 1597 __ LoadP(r3, MemOperand(sp)); |
1591 __ push(r3); | 1598 __ push(r3); |
1592 VisitForStackValue(key); | 1599 VisitForStackValue(key); |
1593 VisitForStackValue(value); | 1600 VisitForStackValue(value); |
1594 if (property->emit_store()) { | 1601 if (property->emit_store()) { |
1595 EmitSetHomeObjectIfNeeded( | 1602 if (NeedsHomeObject(value)) { |
1596 value, 2, expr->SlotForHomeObject(value, &store_slot_index)); | 1603 EmitSetHomeObject(value, 2, property->GetSlot()); |
| 1604 } |
1597 __ LoadSmiLiteral(r3, Smi::FromInt(SLOPPY)); // PropertyAttributes | 1605 __ LoadSmiLiteral(r3, Smi::FromInt(SLOPPY)); // PropertyAttributes |
1598 __ push(r3); | 1606 __ push(r3); |
1599 __ CallRuntime(Runtime::kSetProperty, 4); | 1607 __ CallRuntime(Runtime::kSetProperty, 4); |
1600 } else { | 1608 } else { |
1601 __ Drop(3); | 1609 __ Drop(3); |
1602 } | 1610 } |
1603 break; | 1611 break; |
1604 case ObjectLiteral::Property::PROTOTYPE: | 1612 case ObjectLiteral::Property::PROTOTYPE: |
1605 // Duplicate receiver on stack. | 1613 // Duplicate receiver on stack. |
1606 __ LoadP(r3, MemOperand(sp)); | 1614 __ LoadP(r3, MemOperand(sp)); |
1607 __ push(r3); | 1615 __ push(r3); |
1608 VisitForStackValue(value); | 1616 VisitForStackValue(value); |
1609 DCHECK(property->emit_store()); | 1617 DCHECK(property->emit_store()); |
1610 __ CallRuntime(Runtime::kInternalSetPrototype, 2); | 1618 __ CallRuntime(Runtime::kInternalSetPrototype, 2); |
1611 break; | 1619 break; |
1612 case ObjectLiteral::Property::GETTER: | 1620 case ObjectLiteral::Property::GETTER: |
1613 if (property->emit_store()) { | 1621 if (property->emit_store()) { |
1614 accessor_table.lookup(key)->second->getter = value; | 1622 accessor_table.lookup(key)->second->getter = property; |
1615 } | 1623 } |
1616 break; | 1624 break; |
1617 case ObjectLiteral::Property::SETTER: | 1625 case ObjectLiteral::Property::SETTER: |
1618 if (property->emit_store()) { | 1626 if (property->emit_store()) { |
1619 accessor_table.lookup(key)->second->setter = value; | 1627 accessor_table.lookup(key)->second->setter = property; |
1620 } | 1628 } |
1621 break; | 1629 break; |
1622 } | 1630 } |
1623 } | 1631 } |
1624 | 1632 |
1625 // Emit code to define accessors, using only a single call to the runtime for | 1633 // Emit code to define accessors, using only a single call to the runtime for |
1626 // each pair of corresponding getters and setters. | 1634 // each pair of corresponding getters and setters. |
1627 for (AccessorTable::Iterator it = accessor_table.begin(); | 1635 for (AccessorTable::Iterator it = accessor_table.begin(); |
1628 it != accessor_table.end(); ++it) { | 1636 it != accessor_table.end(); ++it) { |
1629 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. | 1637 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. |
1630 __ push(r3); | 1638 __ push(r3); |
1631 VisitForStackValue(it->first); | 1639 VisitForStackValue(it->first); |
1632 EmitAccessor(it->second->getter); | 1640 EmitAccessor(it->second->getter); |
1633 EmitSetHomeObjectIfNeeded( | |
1634 it->second->getter, 2, | |
1635 expr->SlotForHomeObject(it->second->getter, &store_slot_index)); | |
1636 EmitAccessor(it->second->setter); | 1641 EmitAccessor(it->second->setter); |
1637 EmitSetHomeObjectIfNeeded( | |
1638 it->second->setter, 3, | |
1639 expr->SlotForHomeObject(it->second->setter, &store_slot_index)); | |
1640 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); | 1642 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); |
1641 __ push(r3); | 1643 __ push(r3); |
1642 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | 1644 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
1643 } | 1645 } |
1644 | 1646 |
1645 // Object literals have two parts. The "static" part on the left contains no | 1647 // Object literals have two parts. The "static" part on the left contains no |
1646 // computed property names, and so we can compute its map ahead of time; see | 1648 // computed property names, and so we can compute its map ahead of time; see |
1647 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1649 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
1648 // starts with the first computed property name, and continues with all | 1650 // starts with the first computed property name, and continues with all |
1649 // properties to its right. All the code from above initializes the static | 1651 // properties to its right. All the code from above initializes the static |
(...skipping 14 matching lines...) Expand all Loading... |
1664 __ push(r3); | 1666 __ push(r3); |
1665 | 1667 |
1666 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { | 1668 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { |
1667 DCHECK(!property->is_computed_name()); | 1669 DCHECK(!property->is_computed_name()); |
1668 VisitForStackValue(value); | 1670 VisitForStackValue(value); |
1669 DCHECK(property->emit_store()); | 1671 DCHECK(property->emit_store()); |
1670 __ CallRuntime(Runtime::kInternalSetPrototype, 2); | 1672 __ CallRuntime(Runtime::kInternalSetPrototype, 2); |
1671 } else { | 1673 } else { |
1672 EmitPropertyKey(property, expr->GetIdForProperty(property_index)); | 1674 EmitPropertyKey(property, expr->GetIdForProperty(property_index)); |
1673 VisitForStackValue(value); | 1675 VisitForStackValue(value); |
1674 EmitSetHomeObjectIfNeeded( | 1676 if (NeedsHomeObject(value)) { |
1675 value, 2, expr->SlotForHomeObject(value, &store_slot_index)); | 1677 EmitSetHomeObject(value, 2, property->GetSlot()); |
| 1678 } |
1676 | 1679 |
1677 switch (property->kind()) { | 1680 switch (property->kind()) { |
1678 case ObjectLiteral::Property::CONSTANT: | 1681 case ObjectLiteral::Property::CONSTANT: |
1679 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1682 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
1680 case ObjectLiteral::Property::COMPUTED: | 1683 case ObjectLiteral::Property::COMPUTED: |
1681 if (property->emit_store()) { | 1684 if (property->emit_store()) { |
1682 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); | 1685 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); |
1683 __ push(r3); | 1686 __ push(r3); |
1684 __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); | 1687 __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); |
1685 } else { | 1688 } else { |
(...skipping 25 matching lines...) Expand all Loading... |
1711 __ LoadP(r3, MemOperand(sp)); | 1714 __ LoadP(r3, MemOperand(sp)); |
1712 __ push(r3); | 1715 __ push(r3); |
1713 __ CallRuntime(Runtime::kToFastProperties, 1); | 1716 __ CallRuntime(Runtime::kToFastProperties, 1); |
1714 } | 1717 } |
1715 | 1718 |
1716 if (result_saved) { | 1719 if (result_saved) { |
1717 context()->PlugTOS(); | 1720 context()->PlugTOS(); |
1718 } else { | 1721 } else { |
1719 context()->Plug(r3); | 1722 context()->Plug(r3); |
1720 } | 1723 } |
1721 | |
1722 // Verify that compilation exactly consumed the number of store ic slots that | |
1723 // the ObjectLiteral node had to offer. | |
1724 DCHECK(!FLAG_vector_stores || store_slot_index == expr->slot_count()); | |
1725 } | 1724 } |
1726 | 1725 |
1727 | 1726 |
1728 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1727 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1729 Comment cmnt(masm_, "[ ArrayLiteral"); | 1728 Comment cmnt(masm_, "[ ArrayLiteral"); |
1730 | 1729 |
1731 expr->BuildConstantElements(isolate()); | 1730 expr->BuildConstantElements(isolate()); |
1732 Handle<FixedArray> constant_elements = expr->constant_elements(); | 1731 Handle<FixedArray> constant_elements = expr->constant_elements(); |
1733 bool has_fast_elements = | 1732 bool has_fast_elements = |
1734 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1733 IsFastObjectElementsKind(expr->constant_elements_kind()); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 break; | 2428 break; |
2430 default: | 2429 default: |
2431 UNREACHABLE(); | 2430 UNREACHABLE(); |
2432 } | 2431 } |
2433 | 2432 |
2434 __ bind(&done); | 2433 __ bind(&done); |
2435 context()->Plug(r3); | 2434 context()->Plug(r3); |
2436 } | 2435 } |
2437 | 2436 |
2438 | 2437 |
2439 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit, | 2438 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
2440 int* used_store_slots) { | |
2441 // Constructor is in r3. | 2439 // Constructor is in r3. |
2442 DCHECK(lit != NULL); | 2440 DCHECK(lit != NULL); |
2443 __ push(r3); | 2441 __ push(r3); |
2444 | 2442 |
2445 // No access check is needed here since the constructor is created by the | 2443 // No access check is needed here since the constructor is created by the |
2446 // class literal. | 2444 // class literal. |
2447 Register scratch = r4; | 2445 Register scratch = r4; |
2448 __ LoadP(scratch, | 2446 __ LoadP(scratch, |
2449 FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); | 2447 FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); |
2450 __ push(scratch); | 2448 __ push(scratch); |
(...skipping 13 matching lines...) Expand all Loading... |
2464 // The static prototype property is read only. We handle the non computed | 2462 // The static prototype property is read only. We handle the non computed |
2465 // property name case in the parser. Since this is the only case where we | 2463 // property name case in the parser. Since this is the only case where we |
2466 // need to check for an own read only property we special case this so we do | 2464 // need to check for an own read only property we special case this so we do |
2467 // not need to do this for every property. | 2465 // not need to do this for every property. |
2468 if (property->is_static() && property->is_computed_name()) { | 2466 if (property->is_static() && property->is_computed_name()) { |
2469 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1); | 2467 __ CallRuntime(Runtime::kThrowIfStaticPrototype, 1); |
2470 __ push(r3); | 2468 __ push(r3); |
2471 } | 2469 } |
2472 | 2470 |
2473 VisitForStackValue(value); | 2471 VisitForStackValue(value); |
2474 EmitSetHomeObjectIfNeeded(value, 2, | 2472 if (NeedsHomeObject(value)) { |
2475 lit->SlotForHomeObject(value, used_store_slots)); | 2473 EmitSetHomeObject(value, 2, property->GetSlot()); |
| 2474 } |
2476 | 2475 |
2477 switch (property->kind()) { | 2476 switch (property->kind()) { |
2478 case ObjectLiteral::Property::CONSTANT: | 2477 case ObjectLiteral::Property::CONSTANT: |
2479 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2478 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
2480 case ObjectLiteral::Property::PROTOTYPE: | 2479 case ObjectLiteral::Property::PROTOTYPE: |
2481 UNREACHABLE(); | 2480 UNREACHABLE(); |
2482 case ObjectLiteral::Property::COMPUTED: | 2481 case ObjectLiteral::Property::COMPUTED: |
2483 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2482 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
2484 break; | 2483 break; |
2485 | 2484 |
(...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5309 return ON_STACK_REPLACEMENT; | 5308 return ON_STACK_REPLACEMENT; |
5310 } | 5309 } |
5311 | 5310 |
5312 DCHECK(interrupt_address == | 5311 DCHECK(interrupt_address == |
5313 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5312 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5314 return OSR_AFTER_STACK_CHECK; | 5313 return OSR_AFTER_STACK_CHECK; |
5315 } | 5314 } |
5316 } // namespace internal | 5315 } // namespace internal |
5317 } // namespace v8 | 5316 } // namespace v8 |
5318 #endif // V8_TARGET_ARCH_PPC | 5317 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |