OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3394 | 3394 |
3395 | 3395 |
3396 void Code::set_unary_op_type(byte value) { | 3396 void Code::set_unary_op_type(byte value) { |
3397 ASSERT(is_unary_op_stub()); | 3397 ASSERT(is_unary_op_stub()); |
3398 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3398 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
3399 int updated = UnaryOpTypeField::update(previous, value); | 3399 int updated = UnaryOpTypeField::update(previous, value); |
3400 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 3400 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
3401 } | 3401 } |
3402 | 3402 |
3403 | 3403 |
3404 byte Code::binary_op_type() { | |
3405 ASSERT(is_binary_op_stub()); | |
3406 return BinaryOpTypeField::decode( | |
3407 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3408 } | |
3409 | |
3410 | |
3411 void Code::set_binary_op_type(byte value) { | |
3412 ASSERT(is_binary_op_stub()); | |
3413 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3414 int updated = BinaryOpTypeField::update(previous, value); | |
3415 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3416 } | |
3417 | |
3418 | |
3419 byte Code::binary_op_result_type() { | |
3420 ASSERT(is_binary_op_stub()); | |
3421 return BinaryOpResultTypeField::decode( | |
3422 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3423 } | |
3424 | |
3425 | |
3426 void Code::set_binary_op_result_type(byte value) { | |
3427 ASSERT(is_binary_op_stub()); | |
3428 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3429 int updated = BinaryOpResultTypeField::update(previous, value); | |
3430 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3431 } | |
3432 | |
3433 | |
3434 byte Code::compare_state() { | |
3435 ASSERT(is_compare_ic_stub()); | |
3436 return CompareStateField::decode( | |
3437 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3438 } | |
3439 | |
3440 | |
3441 void Code::set_compare_state(byte value) { | |
3442 ASSERT(is_compare_ic_stub()); | |
3443 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3444 int updated = CompareStateField::update(previous, value); | |
3445 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3446 } | |
3447 | |
3448 | |
3449 byte Code::compare_operation() { | |
3450 ASSERT(is_compare_ic_stub()); | |
3451 return CompareOperationField::decode( | |
3452 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3453 } | |
3454 | |
3455 | |
3456 void Code::set_compare_operation(byte value) { | |
3457 ASSERT(is_compare_ic_stub()); | |
3458 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3459 int updated = CompareOperationField::update(previous, value); | |
3460 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3461 } | |
3462 | |
3463 | |
3464 byte Code::to_boolean_state() { | 3404 byte Code::to_boolean_state() { |
3465 ASSERT(is_to_boolean_ic_stub()); | 3405 ASSERT(is_to_boolean_ic_stub()); |
3466 return ToBooleanStateField::decode( | 3406 return ToBooleanStateField::decode( |
3467 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 3407 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
3468 } | 3408 } |
3469 | 3409 |
3470 | 3410 |
3471 void Code::set_to_boolean_state(byte value) { | 3411 void Code::set_to_boolean_state(byte value) { |
3472 ASSERT(is_to_boolean_ic_stub()); | 3412 ASSERT(is_to_boolean_ic_stub()); |
3473 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3413 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4644 ASSERT(obj->IsJSMessageObject()); | 4584 ASSERT(obj->IsJSMessageObject()); |
4645 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); | 4585 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); |
4646 return reinterpret_cast<JSMessageObject*>(obj); | 4586 return reinterpret_cast<JSMessageObject*>(obj); |
4647 } | 4587 } |
4648 | 4588 |
4649 | 4589 |
4650 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) | 4590 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) |
4651 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) | 4591 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) |
4652 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) | 4592 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
4653 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) | 4593 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
4654 ACCESSORS(Code, type_feedback_info, Object, kTypeFeedbackInfoOffset) | 4594 |
| 4595 |
| 4596 // Type feedback slot: type_feedback_info for FUNCTIONs, stub_info for STUBs. |
| 4597 void Code::InitializeTypeFeedbackInfoNoWriteBarrier(Object* value) { |
| 4598 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); |
| 4599 } |
| 4600 |
| 4601 |
| 4602 Object* Code::type_feedback_info() { |
| 4603 ASSERT(kind() == FUNCTION); |
| 4604 return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset)); |
| 4605 } |
| 4606 |
| 4607 |
| 4608 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { |
| 4609 ASSERT(kind() == FUNCTION); |
| 4610 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); |
| 4611 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
| 4612 value, mode); |
| 4613 } |
| 4614 |
| 4615 |
| 4616 int Code::stub_info() { |
| 4617 ASSERT(kind() == COMPARE_IC || kind() == BINARY_OP_IC); |
| 4618 Object* value = READ_FIELD(this, kTypeFeedbackInfoOffset); |
| 4619 return Smi::cast(value)->value(); |
| 4620 } |
| 4621 |
| 4622 |
| 4623 void Code::set_stub_info(int value) { |
| 4624 ASSERT(kind() == COMPARE_IC || kind() == BINARY_OP_IC); |
| 4625 WRITE_FIELD(this, kTypeFeedbackInfoOffset, Smi::FromInt(value)); |
| 4626 } |
| 4627 |
| 4628 |
4655 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) | 4629 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) |
4656 INT_ACCESSORS(Code, ic_age, kICAgeOffset) | 4630 INT_ACCESSORS(Code, ic_age, kICAgeOffset) |
4657 | 4631 |
| 4632 |
4658 byte* Code::instruction_start() { | 4633 byte* Code::instruction_start() { |
4659 return FIELD_ADDR(this, kHeaderSize); | 4634 return FIELD_ADDR(this, kHeaderSize); |
4660 } | 4635 } |
4661 | 4636 |
4662 | 4637 |
4663 byte* Code::instruction_end() { | 4638 byte* Code::instruction_end() { |
4664 return instruction_start() + instruction_size(); | 4639 return instruction_start() + instruction_size(); |
4665 } | 4640 } |
4666 | 4641 |
4667 | 4642 |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5549 #undef WRITE_UINT32_FIELD | 5524 #undef WRITE_UINT32_FIELD |
5550 #undef READ_SHORT_FIELD | 5525 #undef READ_SHORT_FIELD |
5551 #undef WRITE_SHORT_FIELD | 5526 #undef WRITE_SHORT_FIELD |
5552 #undef READ_BYTE_FIELD | 5527 #undef READ_BYTE_FIELD |
5553 #undef WRITE_BYTE_FIELD | 5528 #undef WRITE_BYTE_FIELD |
5554 | 5529 |
5555 | 5530 |
5556 } } // namespace v8::internal | 5531 } } // namespace v8::internal |
5557 | 5532 |
5558 #endif // V8_OBJECTS_INL_H_ | 5533 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |