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 3203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3214 | 3214 |
3215 | 3215 |
3216 int Code::arguments_count() { | 3216 int Code::arguments_count() { |
3217 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); | 3217 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); |
3218 return ExtractArgumentsCountFromFlags(flags()); | 3218 return ExtractArgumentsCountFromFlags(flags()); |
3219 } | 3219 } |
3220 | 3220 |
3221 | 3221 |
3222 int Code::major_key() { | 3222 int Code::major_key() { |
3223 ASSERT(kind() == STUB || | 3223 ASSERT(kind() == STUB || |
| 3224 kind() == COMPILED_STUB || |
3224 kind() == UNARY_OP_IC || | 3225 kind() == UNARY_OP_IC || |
3225 kind() == BINARY_OP_IC || | 3226 kind() == BINARY_OP_IC || |
3226 kind() == COMPARE_IC || | 3227 kind() == COMPARE_IC || |
3227 kind() == TO_BOOLEAN_IC); | 3228 kind() == TO_BOOLEAN_IC); |
3228 return StubMajorKeyField::decode( | 3229 return StubMajorKeyField::decode( |
3229 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); | 3230 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
3230 } | 3231 } |
3231 | 3232 |
3232 | 3233 |
3233 void Code::set_major_key(int major) { | 3234 void Code::set_major_key(int major) { |
3234 ASSERT(kind() == STUB || | 3235 ASSERT(kind() == STUB || |
| 3236 kind() == COMPILED_STUB || |
3235 kind() == UNARY_OP_IC || | 3237 kind() == UNARY_OP_IC || |
3236 kind() == BINARY_OP_IC || | 3238 kind() == BINARY_OP_IC || |
3237 kind() == COMPARE_IC || | 3239 kind() == COMPARE_IC || |
3238 kind() == TO_BOOLEAN_IC); | 3240 kind() == TO_BOOLEAN_IC); |
3239 ASSERT(0 <= major && major < 256); | 3241 ASSERT(0 <= major && major < 256); |
3240 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3242 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
3241 int updated = StubMajorKeyField::update(previous, major); | 3243 int updated = StubMajorKeyField::update(previous, major); |
3242 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3244 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
3243 } | 3245 } |
3244 | 3246 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 | 3335 |
3334 | 3336 |
3335 void Code::set_profiler_ticks(int ticks) { | 3337 void Code::set_profiler_ticks(int ticks) { |
3336 ASSERT_EQ(FUNCTION, kind()); | 3338 ASSERT_EQ(FUNCTION, kind()); |
3337 ASSERT(ticks < 256); | 3339 ASSERT(ticks < 256); |
3338 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); | 3340 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); |
3339 } | 3341 } |
3340 | 3342 |
3341 | 3343 |
3342 unsigned Code::stack_slots() { | 3344 unsigned Code::stack_slots() { |
3343 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3345 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); |
3344 return StackSlotsField::decode( | 3346 return StackSlotsField::decode( |
3345 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 3347 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
3346 } | 3348 } |
3347 | 3349 |
3348 | 3350 |
3349 void Code::set_stack_slots(unsigned slots) { | 3351 void Code::set_stack_slots(unsigned slots) { |
3350 CHECK(slots <= (1 << kStackSlotsBitCount)); | 3352 CHECK(slots <= (1 << kStackSlotsBitCount)); |
3351 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3353 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); |
3352 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3354 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
3353 int updated = StackSlotsField::update(previous, slots); | 3355 int updated = StackSlotsField::update(previous, slots); |
3354 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 3356 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
3355 } | 3357 } |
3356 | 3358 |
3357 | 3359 |
3358 unsigned Code::safepoint_table_offset() { | 3360 unsigned Code::safepoint_table_offset() { |
3359 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3361 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); |
3360 return SafepointTableOffsetField::decode( | 3362 return SafepointTableOffsetField::decode( |
3361 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); | 3363 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
3362 } | 3364 } |
3363 | 3365 |
3364 | 3366 |
3365 void Code::set_safepoint_table_offset(unsigned offset) { | 3367 void Code::set_safepoint_table_offset(unsigned offset) { |
3366 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); | 3368 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); |
3367 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3369 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); |
3368 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); | 3370 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); |
3369 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3371 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
3370 int updated = SafepointTableOffsetField::update(previous, offset); | 3372 int updated = SafepointTableOffsetField::update(previous, offset); |
3371 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3373 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
3372 } | 3374 } |
3373 | 3375 |
3374 | 3376 |
3375 unsigned Code::stack_check_table_offset() { | 3377 unsigned Code::stack_check_table_offset() { |
3376 ASSERT_EQ(FUNCTION, kind()); | 3378 ASSERT_EQ(FUNCTION, kind()); |
3377 return StackCheckTableOffsetField::decode( | 3379 return StackCheckTableOffsetField::decode( |
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5557 #undef WRITE_UINT32_FIELD | 5559 #undef WRITE_UINT32_FIELD |
5558 #undef READ_SHORT_FIELD | 5560 #undef READ_SHORT_FIELD |
5559 #undef WRITE_SHORT_FIELD | 5561 #undef WRITE_SHORT_FIELD |
5560 #undef READ_BYTE_FIELD | 5562 #undef READ_BYTE_FIELD |
5561 #undef WRITE_BYTE_FIELD | 5563 #undef WRITE_BYTE_FIELD |
5562 | 5564 |
5563 | 5565 |
5564 } } // namespace v8::internal | 5566 } } // namespace v8::internal |
5565 | 5567 |
5566 #endif // V8_OBJECTS_INL_H_ | 5568 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |