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

Side by Side Diff: src/objects-inl.h

Issue 10837165: Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: HConstants, HSimulates, stub fixes Created 8 years, 1 month 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
OLDNEW
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
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
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 // Type feedback slot: type_feedback_info for FUNCTIONs, stub_info for STUBs.
4596 void Code::InitializeTypeFeedbackInfoNoWriteBarrier(Object* value) {
4597 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value);
4598 }
danno 2012/11/06 11:42:59 nit: whitespace between
Jakob Kummerow 2012/11/06 12:44:05 Done.
4599 Object* Code::type_feedback_info() {
4600 ASSERT(kind() == FUNCTION);
4601 return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset));
4602 }
4603 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) {
4604 ASSERT(kind() == FUNCTION);
4605 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value);
4606 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset,
4607 value, mode);
4608 }
4609 int Code::stub_info() {
4610 ASSERT(kind() == COMPARE_IC ||
4611 kind() == BINARY_OP_IC);
danno 2012/11/06 11:42:59 one line
Jakob Kummerow 2012/11/06 12:44:05 Done.
4612 Object* value = READ_FIELD(this, kTypeFeedbackInfoOffset);
4613 return Smi::cast(value)->value();
4614 }
4615 void Code::set_stub_info(int value) {
4616 ASSERT(kind() == COMPARE_IC ||
4617 kind() == BINARY_OP_IC);
4618 WRITE_FIELD(this, kTypeFeedbackInfoOffset, Smi::FromInt(value));
4619 }
4620
4655 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) 4621 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset)
4656 INT_ACCESSORS(Code, ic_age, kICAgeOffset) 4622 INT_ACCESSORS(Code, ic_age, kICAgeOffset)
4657 4623
4658 byte* Code::instruction_start() { 4624 byte* Code::instruction_start() {
4659 return FIELD_ADDR(this, kHeaderSize); 4625 return FIELD_ADDR(this, kHeaderSize);
4660 } 4626 }
4661 4627
4662 4628
4663 byte* Code::instruction_end() { 4629 byte* Code::instruction_end() {
4664 return instruction_start() + instruction_size(); 4630 return instruction_start() + instruction_size();
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
5549 #undef WRITE_UINT32_FIELD 5515 #undef WRITE_UINT32_FIELD
5550 #undef READ_SHORT_FIELD 5516 #undef READ_SHORT_FIELD
5551 #undef WRITE_SHORT_FIELD 5517 #undef WRITE_SHORT_FIELD
5552 #undef READ_BYTE_FIELD 5518 #undef READ_BYTE_FIELD
5553 #undef WRITE_BYTE_FIELD 5519 #undef WRITE_BYTE_FIELD
5554 5520
5555 5521
5556 } } // namespace v8::internal 5522 } } // namespace v8::internal
5557 5523
5558 #endif // V8_OBJECTS_INL_H_ 5524 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/hydrogen-instructions.cc ('K') | « src/objects.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698