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 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3417 instance_type() > LAST_JS_OBJECT_TYPE || | 3417 instance_type() > LAST_JS_OBJECT_TYPE || |
3418 has_slow_elements_kind() || has_external_array_elements()); | 3418 has_slow_elements_kind() || has_external_array_elements()); |
3419 set_bit_field3(IsObserved::update(bit_field3(), is_observed)); | 3419 set_bit_field3(IsObserved::update(bit_field3(), is_observed)); |
3420 } | 3420 } |
3421 | 3421 |
3422 | 3422 |
3423 bool Map::is_observed() { | 3423 bool Map::is_observed() { |
3424 return IsObserved::decode(bit_field3()); | 3424 return IsObserved::decode(bit_field3()); |
3425 } | 3425 } |
3426 | 3426 |
| 3427 void Map::NotifyObjectLayoutChange() { |
| 3428 DeoptimizeDependentCodes(DependentCodes::kPrototypeCheckGroup); |
| 3429 } |
| 3430 |
| 3431 bool Map::CanOmitPrototypeChecks() { |
| 3432 return !HasTransitionArray() && !is_dictionary_map(); |
| 3433 } |
3427 | 3434 |
3428 void Map::AddDependentCode(DependentCodes::DependencyGroup group, | 3435 void Map::AddDependentCode(DependentCodes::DependencyGroup group, |
3429 Handle<Code> code) { | 3436 Handle<Code> code) { |
3430 Handle<DependentCodes> codes = | 3437 Handle<DependentCodes> codes = |
3431 DependentCodes::Insert(Handle<DependentCodes>(dependent_codes()), | 3438 DependentCodes::Insert(Handle<DependentCodes>(dependent_codes()), |
3432 group, code); | 3439 group, code); |
3433 if (*codes != dependent_codes()) { | 3440 if (*codes != dependent_codes()) { |
3434 set_dependent_codes(*codes); | 3441 set_dependent_codes(*codes); |
3435 } | 3442 } |
3436 } | 3443 } |
(...skipping 24 matching lines...) Expand all Loading... |
3461 return HeapObject::RawField( | 3468 return HeapObject::RawField( |
3462 this, FixedArray::OffsetOfElementAt(kCodesStartIndex + i)); | 3469 this, FixedArray::OffsetOfElementAt(kCodesStartIndex + i)); |
3463 } | 3470 } |
3464 | 3471 |
3465 | 3472 |
3466 void DependentCodes::clear_code_at(int i) { | 3473 void DependentCodes::clear_code_at(int i) { |
3467 set_undefined(kCodesStartIndex + i); | 3474 set_undefined(kCodesStartIndex + i); |
3468 } | 3475 } |
3469 | 3476 |
3470 | 3477 |
3471 void DependentCodes::ComputeGroupStartIndexes(GroupStartIndexes starts) { | |
3472 starts[0] = 0; | |
3473 for (int g = 1; g <= kGroupCount; g++) { | |
3474 int count = number_of_codes(static_cast<DependencyGroup>(g - 1)); | |
3475 starts[g] = starts[g - 1] + count; | |
3476 } | |
3477 } | |
3478 | |
3479 | |
3480 void DependentCodes::ExtendGroup(DependencyGroup group) { | 3478 void DependentCodes::ExtendGroup(DependencyGroup group) { |
3481 GroupStartIndexes starts; | 3479 GroupStartIndexes starts(this); |
3482 ComputeGroupStartIndexes(starts); | 3480 for (int g = kGroupCount - 1; g > group; g--) { |
3483 for (int g = kGroupCount - 2; g > group; g--) { | 3481 if (starts.at(g) < starts.at(g + 1)) { |
3484 set_code_at(starts[g + 1], code_at(starts[g])); | 3482 set_code_at(starts.at(g + 1), code_at(starts.at(g))); |
| 3483 } |
3485 } | 3484 } |
3486 } | 3485 } |
3487 | 3486 |
3488 | 3487 |
3489 void Code::set_flags(Code::Flags flags) { | 3488 void Code::set_flags(Code::Flags flags) { |
3490 STATIC_ASSERT(Code::NUMBER_OF_KINDS <= KindField::kMax + 1); | 3489 STATIC_ASSERT(Code::NUMBER_OF_KINDS <= KindField::kMax + 1); |
3491 // Make sure that all call stubs have an arguments count. | 3490 // Make sure that all call stubs have an arguments count. |
3492 ASSERT((ExtractKindFromFlags(flags) != CALL_IC && | 3491 ASSERT((ExtractKindFromFlags(flags) != CALL_IC && |
3493 ExtractKindFromFlags(flags) != KEYED_CALL_IC) || | 3492 ExtractKindFromFlags(flags) != KEYED_CALL_IC) || |
3494 ExtractArgumentsCountFromFlags(flags) >= 0); | 3493 ExtractArgumentsCountFromFlags(flags) >= 0); |
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5910 #undef WRITE_UINT32_FIELD | 5909 #undef WRITE_UINT32_FIELD |
5911 #undef READ_SHORT_FIELD | 5910 #undef READ_SHORT_FIELD |
5912 #undef WRITE_SHORT_FIELD | 5911 #undef WRITE_SHORT_FIELD |
5913 #undef READ_BYTE_FIELD | 5912 #undef READ_BYTE_FIELD |
5914 #undef WRITE_BYTE_FIELD | 5913 #undef WRITE_BYTE_FIELD |
5915 | 5914 |
5916 | 5915 |
5917 } } // namespace v8::internal | 5916 } } // namespace v8::internal |
5918 | 5917 |
5919 #endif // V8_OBJECTS_INL_H_ | 5918 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |