OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 16585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16596 } | 16596 } |
16597 | 16597 |
16598 | 16598 |
16599 void JSTypedArray::Neuter() { | 16599 void JSTypedArray::Neuter() { |
16600 NeuterView(); | 16600 NeuterView(); |
16601 set_length(Smi::FromInt(0)); | 16601 set_length(Smi::FromInt(0)); |
16602 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 16602 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
16603 } | 16603 } |
16604 | 16604 |
16605 | 16605 |
16606 Type* PropertyCell::type() { | 16606 HeapType* PropertyCell::type() { |
16607 return static_cast<Type*>(type_raw()); | 16607 return static_cast<HeapType*>(type_raw()); |
16608 } | 16608 } |
16609 | 16609 |
16610 | 16610 |
16611 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 16611 void PropertyCell::set_type(HeapType* type, WriteBarrierMode ignored) { |
16612 ASSERT(IsPropertyCell()); | 16612 ASSERT(IsPropertyCell()); |
16613 set_type_raw(type, ignored); | 16613 set_type_raw(type, ignored); |
16614 } | 16614 } |
16615 | 16615 |
16616 | 16616 |
16617 Handle<Type> PropertyCell::UpdatedType(Handle<PropertyCell> cell, | 16617 Handle<HeapType> PropertyCell::UpdatedType(Handle<PropertyCell> cell, |
16618 Handle<Object> value) { | 16618 Handle<Object> value) { |
16619 Isolate* isolate = cell->GetIsolate(); | 16619 Isolate* isolate = cell->GetIsolate(); |
16620 Handle<Type> old_type(cell->type(), isolate); | 16620 Handle<HeapType> old_type(cell->type(), isolate); |
16621 // TODO(2803): Do not track ConsString as constant because they cannot be | 16621 // TODO(2803): Do not track ConsString as constant because they cannot be |
16622 // embedded into code. | 16622 // embedded into code. |
16623 Handle<Type> new_type = value->IsConsString() || value->IsTheHole() | 16623 Handle<HeapType> new_type = value->IsConsString() || value->IsTheHole() |
16624 ? Type::Any(isolate) : Type::Constant(value, isolate); | 16624 ? HeapType::Any(isolate) : HeapType::Constant(value, isolate); |
16625 | 16625 |
16626 if (new_type->Is(old_type)) { | 16626 if (new_type->Is(old_type)) { |
16627 return old_type; | 16627 return old_type; |
16628 } | 16628 } |
16629 | 16629 |
16630 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16630 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16631 isolate, DependentCode::kPropertyCellChangedGroup); | 16631 isolate, DependentCode::kPropertyCellChangedGroup); |
16632 | 16632 |
16633 if (old_type->Is(Type::None()) || old_type->Is(Type::Undefined())) { | 16633 if (old_type->Is(HeapType::None()) || old_type->Is(HeapType::Undefined())) { |
16634 return new_type; | 16634 return new_type; |
16635 } | 16635 } |
16636 | 16636 |
16637 return Type::Any(isolate); | 16637 return HeapType::Any(isolate); |
16638 } | 16638 } |
16639 | 16639 |
16640 | 16640 |
16641 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, | 16641 void PropertyCell::SetValueInferType(Handle<PropertyCell> cell, |
16642 Handle<Object> value) { | 16642 Handle<Object> value) { |
16643 cell->set_value(*value); | 16643 cell->set_value(*value); |
16644 if (!Type::Any()->Is(cell->type())) { | 16644 if (!HeapType::Any()->Is(cell->type())) { |
16645 Handle<Type> new_type = UpdatedType(cell, value); | 16645 Handle<HeapType> new_type = UpdatedType(cell, value); |
16646 cell->set_type(*new_type); | 16646 cell->set_type(*new_type); |
16647 } | 16647 } |
16648 } | 16648 } |
16649 | 16649 |
16650 | 16650 |
16651 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { | 16651 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { |
16652 Handle<DependentCode> dep(dependent_code()); | 16652 Handle<DependentCode> dep(dependent_code()); |
16653 Handle<DependentCode> codes = | 16653 Handle<DependentCode> codes = |
16654 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, | 16654 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, |
16655 info->object_wrapper()); | 16655 info->object_wrapper()); |
(...skipping 16 matching lines...) Expand all Loading... |
16672 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16672 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16673 static const char* error_messages_[] = { | 16673 static const char* error_messages_[] = { |
16674 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16674 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16675 }; | 16675 }; |
16676 #undef ERROR_MESSAGES_TEXTS | 16676 #undef ERROR_MESSAGES_TEXTS |
16677 return error_messages_[reason]; | 16677 return error_messages_[reason]; |
16678 } | 16678 } |
16679 | 16679 |
16680 | 16680 |
16681 } } // namespace v8::internal | 16681 } } // namespace v8::internal |
OLD | NEW |