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 3390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3401 | 3401 |
3402 | 3402 |
3403 void Code::set_unary_op_type(byte value) { | 3403 void Code::set_unary_op_type(byte value) { |
3404 ASSERT(is_unary_op_stub()); | 3404 ASSERT(is_unary_op_stub()); |
3405 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3405 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
3406 int updated = UnaryOpTypeField::update(previous, value); | 3406 int updated = UnaryOpTypeField::update(previous, value); |
3407 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 3407 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
3408 } | 3408 } |
3409 | 3409 |
3410 | 3410 |
3411 byte Code::binary_op_type() { | |
3412 ASSERT(is_binary_op_stub()); | |
3413 return BinaryOpTypeField::decode( | |
3414 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3415 } | |
3416 | |
3417 | |
3418 void Code::set_binary_op_type(byte value) { | |
3419 ASSERT(is_binary_op_stub()); | |
3420 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3421 int updated = BinaryOpTypeField::update(previous, value); | |
3422 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3423 } | |
3424 | |
3425 | |
3426 byte Code::binary_op_result_type() { | |
3427 ASSERT(is_binary_op_stub()); | |
3428 return BinaryOpResultTypeField::decode( | |
3429 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3430 } | |
3431 | |
3432 | |
3433 void Code::set_binary_op_result_type(byte value) { | |
3434 ASSERT(is_binary_op_stub()); | |
3435 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3436 int updated = BinaryOpResultTypeField::update(previous, value); | |
3437 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3438 } | |
3439 | |
3440 | |
3441 byte Code::compare_state() { | |
3442 ASSERT(is_compare_ic_stub()); | |
3443 return CompareStateField::decode( | |
3444 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3445 } | |
3446 | |
3447 | |
3448 void Code::set_compare_state(byte value) { | |
3449 ASSERT(is_compare_ic_stub()); | |
3450 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3451 int updated = CompareStateField::update(previous, value); | |
3452 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3453 } | |
3454 | |
3455 | |
3456 byte Code::compare_operation() { | |
3457 ASSERT(is_compare_ic_stub()); | |
3458 return CompareOperationField::decode( | |
3459 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | |
3460 } | |
3461 | |
3462 | |
3463 void Code::set_compare_operation(byte value) { | |
3464 ASSERT(is_compare_ic_stub()); | |
3465 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | |
3466 int updated = CompareOperationField::update(previous, value); | |
3467 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | |
3468 } | |
3469 | |
3470 | |
3471 byte Code::to_boolean_state() { | 3411 byte Code::to_boolean_state() { |
3472 ASSERT(is_to_boolean_ic_stub()); | 3412 ASSERT(is_to_boolean_ic_stub()); |
3473 return ToBooleanStateField::decode( | 3413 return ToBooleanStateField::decode( |
3474 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 3414 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
3475 } | 3415 } |
3476 | 3416 |
3477 | 3417 |
3478 void Code::set_to_boolean_state(byte value) { | 3418 void Code::set_to_boolean_state(byte value) { |
3479 ASSERT(is_to_boolean_ic_stub()); | 3419 ASSERT(is_to_boolean_ic_stub()); |
3480 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3420 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4615 ASSERT(obj->IsJSMessageObject()); | 4555 ASSERT(obj->IsJSMessageObject()); |
4616 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); | 4556 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); |
4617 return reinterpret_cast<JSMessageObject*>(obj); | 4557 return reinterpret_cast<JSMessageObject*>(obj); |
4618 } | 4558 } |
4619 | 4559 |
4620 | 4560 |
4621 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) | 4561 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) |
4622 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) | 4562 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) |
4623 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) | 4563 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
4624 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) | 4564 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
4625 ACCESSORS(Code, type_feedback_info, Object, kTypeFeedbackInfoOffset) | 4565 |
| 4566 |
| 4567 // Type feedback slot: type_feedback_info for FUNCTIONs, stub_info for STUBs. |
| 4568 void Code::InitializeTypeFeedbackInfoNoWriteBarrier(Object* value) { |
| 4569 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); |
| 4570 } |
| 4571 |
| 4572 |
| 4573 Object* Code::type_feedback_info() { |
| 4574 ASSERT(kind() == FUNCTION); |
| 4575 return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset)); |
| 4576 } |
| 4577 |
| 4578 |
| 4579 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { |
| 4580 ASSERT(kind() == FUNCTION); |
| 4581 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); |
| 4582 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
| 4583 value, mode); |
| 4584 } |
| 4585 |
| 4586 |
| 4587 int Code::stub_info() { |
| 4588 ASSERT(kind() == COMPARE_IC || kind() == BINARY_OP_IC); |
| 4589 Object* value = READ_FIELD(this, kTypeFeedbackInfoOffset); |
| 4590 return Smi::cast(value)->value(); |
| 4591 } |
| 4592 |
| 4593 |
| 4594 void Code::set_stub_info(int value) { |
| 4595 ASSERT(kind() == COMPARE_IC || kind() == BINARY_OP_IC); |
| 4596 WRITE_FIELD(this, kTypeFeedbackInfoOffset, Smi::FromInt(value)); |
| 4597 } |
| 4598 |
| 4599 |
4626 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) | 4600 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) |
4627 INT_ACCESSORS(Code, ic_age, kICAgeOffset) | 4601 INT_ACCESSORS(Code, ic_age, kICAgeOffset) |
4628 | 4602 |
| 4603 |
4629 byte* Code::instruction_start() { | 4604 byte* Code::instruction_start() { |
4630 return FIELD_ADDR(this, kHeaderSize); | 4605 return FIELD_ADDR(this, kHeaderSize); |
4631 } | 4606 } |
4632 | 4607 |
4633 | 4608 |
4634 byte* Code::instruction_end() { | 4609 byte* Code::instruction_end() { |
4635 return instruction_start() + instruction_size(); | 4610 return instruction_start() + instruction_size(); |
4636 } | 4611 } |
4637 | 4612 |
4638 | 4613 |
(...skipping 910 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 |