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