| 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 5302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5313 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); | 5313 ASSERT(HeapObject::cast(obj)->Size() == JSMessageObject::kSize); |
| 5314 return reinterpret_cast<JSMessageObject*>(obj); | 5314 return reinterpret_cast<JSMessageObject*>(obj); |
| 5315 } | 5315 } |
| 5316 | 5316 |
| 5317 | 5317 |
| 5318 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) | 5318 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) |
| 5319 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) | 5319 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) |
| 5320 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) | 5320 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) |
| 5321 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) | 5321 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
| 5322 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) | 5322 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
| 5323 | 5323 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) |
| 5324 | |
| 5325 // Type feedback slot: type_feedback_info for FUNCTIONs, stub_info for STUBs. | |
| 5326 void Code::InitializeTypeFeedbackInfoNoWriteBarrier(Object* value) { | |
| 5327 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); | |
| 5328 } | |
| 5329 | 5324 |
| 5330 | 5325 |
| 5331 Object* Code::type_feedback_info() { | 5326 Object* Code::type_feedback_info() { |
| 5332 ASSERT(kind() == FUNCTION); | 5327 ASSERT(kind() == FUNCTION); |
| 5333 return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset)); | 5328 return raw_type_feedback_info(); |
| 5334 } | 5329 } |
| 5335 | 5330 |
| 5336 | 5331 |
| 5337 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { | 5332 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { |
| 5338 ASSERT(kind() == FUNCTION); | 5333 ASSERT(kind() == FUNCTION); |
| 5339 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); | 5334 set_raw_type_feedback_info(value, mode); |
| 5340 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, | 5335 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
| 5341 value, mode); | 5336 value, mode); |
| 5342 } | 5337 } |
| 5343 | 5338 |
| 5344 | 5339 |
| 5345 Object* Code::next_code_link() { | 5340 Object* Code::next_code_link() { |
| 5346 CHECK(kind() == OPTIMIZED_FUNCTION); | 5341 CHECK(kind() == OPTIMIZED_FUNCTION); |
| 5347 return Object::cast(READ_FIELD(this, kTypeFeedbackInfoOffset)); | 5342 return raw_type_feedback_info(); |
| 5348 } | 5343 } |
| 5349 | 5344 |
| 5350 | 5345 |
| 5351 void Code::set_next_code_link(Object* value, WriteBarrierMode mode) { | 5346 void Code::set_next_code_link(Object* value, WriteBarrierMode mode) { |
| 5352 CHECK(kind() == OPTIMIZED_FUNCTION); | 5347 CHECK(kind() == OPTIMIZED_FUNCTION); |
| 5353 WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); | 5348 set_raw_type_feedback_info(value); |
| 5354 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, | 5349 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
| 5355 value, mode); | 5350 value, mode); |
| 5356 } | 5351 } |
| 5357 | 5352 |
| 5358 | 5353 |
| 5359 int Code::stub_info() { | 5354 int Code::stub_info() { |
| 5360 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || | 5355 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || |
| 5361 kind() == BINARY_OP_IC || kind() == LOAD_IC); | 5356 kind() == BINARY_OP_IC || kind() == LOAD_IC); |
| 5362 Object* value = READ_FIELD(this, kTypeFeedbackInfoOffset); | 5357 return Smi::cast(raw_type_feedback_info())->value(); |
| 5363 return Smi::cast(value)->value(); | |
| 5364 } | 5358 } |
| 5365 | 5359 |
| 5366 | 5360 |
| 5367 void Code::set_stub_info(int value) { | 5361 void Code::set_stub_info(int value) { |
| 5368 ASSERT(kind() == COMPARE_IC || | 5362 ASSERT(kind() == COMPARE_IC || |
| 5369 kind() == COMPARE_NIL_IC || | 5363 kind() == COMPARE_NIL_IC || |
| 5370 kind() == BINARY_OP_IC || | 5364 kind() == BINARY_OP_IC || |
| 5371 kind() == STUB || | 5365 kind() == STUB || |
| 5372 kind() == LOAD_IC || | 5366 kind() == LOAD_IC || |
| 5373 kind() == KEYED_LOAD_IC || | 5367 kind() == KEYED_LOAD_IC || |
| 5374 kind() == STORE_IC || | 5368 kind() == STORE_IC || |
| 5375 kind() == KEYED_STORE_IC); | 5369 kind() == KEYED_STORE_IC); |
| 5376 WRITE_FIELD(this, kTypeFeedbackInfoOffset, Smi::FromInt(value)); | 5370 set_raw_type_feedback_info(Smi::FromInt(value)); |
| 5377 } | 5371 } |
| 5378 | 5372 |
| 5379 | 5373 |
| 5380 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) | 5374 ACCESSORS(Code, gc_metadata, Object, kGCMetadataOffset) |
| 5381 INT_ACCESSORS(Code, ic_age, kICAgeOffset) | 5375 INT_ACCESSORS(Code, ic_age, kICAgeOffset) |
| 5382 | 5376 |
| 5383 | 5377 |
| 5384 byte* Code::instruction_start() { | 5378 byte* Code::instruction_start() { |
| 5385 return FIELD_ADDR(this, kHeaderSize); | 5379 return FIELD_ADDR(this, kHeaderSize); |
| 5386 } | 5380 } |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6400 #undef WRITE_UINT32_FIELD | 6394 #undef WRITE_UINT32_FIELD |
| 6401 #undef READ_SHORT_FIELD | 6395 #undef READ_SHORT_FIELD |
| 6402 #undef WRITE_SHORT_FIELD | 6396 #undef WRITE_SHORT_FIELD |
| 6403 #undef READ_BYTE_FIELD | 6397 #undef READ_BYTE_FIELD |
| 6404 #undef WRITE_BYTE_FIELD | 6398 #undef WRITE_BYTE_FIELD |
| 6405 | 6399 |
| 6406 | 6400 |
| 6407 } } // namespace v8::internal | 6401 } } // namespace v8::internal |
| 6408 | 6402 |
| 6409 #endif // V8_OBJECTS_INL_H_ | 6403 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |