| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 4636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4647 case CALL_IC: return "CALL_IC"; | 4647 case CALL_IC: return "CALL_IC"; |
| 4648 } | 4648 } |
| 4649 UNREACHABLE(); | 4649 UNREACHABLE(); |
| 4650 return NULL; | 4650 return NULL; |
| 4651 } | 4651 } |
| 4652 | 4652 |
| 4653 | 4653 |
| 4654 const char* Code::ICState2String(InlineCacheState state) { | 4654 const char* Code::ICState2String(InlineCacheState state) { |
| 4655 switch (state) { | 4655 switch (state) { |
| 4656 case UNINITIALIZED: return "UNINITIALIZED"; | 4656 case UNINITIALIZED: return "UNINITIALIZED"; |
| 4657 case UNINITIALIZED_IN_LOOP: return "UNINITIALIZED_IN_LOOP"; |
| 4657 case PREMONOMORPHIC: return "PREMONOMORPHIC"; | 4658 case PREMONOMORPHIC: return "PREMONOMORPHIC"; |
| 4658 case MONOMORPHIC: return "MONOMORPHIC"; | 4659 case MONOMORPHIC: return "MONOMORPHIC"; |
| 4659 case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE"; | 4660 case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE"; |
| 4660 case MEGAMORPHIC: return "MEGAMORPHIC"; | 4661 case MEGAMORPHIC: return "MEGAMORPHIC"; |
| 4661 case DEBUG_BREAK: return "DEBUG_BREAK"; | 4662 case DEBUG_BREAK: return "DEBUG_BREAK"; |
| 4662 case DEBUG_PREPARE_STEP_IN: return "DEBUG_PREPARE_STEP_IN"; | 4663 case DEBUG_PREPARE_STEP_IN: return "DEBUG_PREPARE_STEP_IN"; |
| 4663 } | 4664 } |
| 4664 UNREACHABLE(); | 4665 UNREACHABLE(); |
| 4665 return NULL; | 4666 return NULL; |
| 4666 } | 4667 } |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5849 if (length_field_ != 0) return length_field_ >> String::kHashShift; | 5850 if (length_field_ != 0) return length_field_ >> String::kHashShift; |
| 5850 unibrow::Utf8InputBuffer<> buffer(string_.start(), | 5851 unibrow::Utf8InputBuffer<> buffer(string_.start(), |
| 5851 static_cast<unsigned>(string_.length())); | 5852 static_cast<unsigned>(string_.length())); |
| 5852 chars_ = buffer.Length(); | 5853 chars_ = buffer.Length(); |
| 5853 length_field_ = String::ComputeLengthAndHashField(&buffer, chars_); | 5854 length_field_ = String::ComputeLengthAndHashField(&buffer, chars_); |
| 5854 return length_field_ >> String::kHashShift; | 5855 return length_field_ >> String::kHashShift; |
| 5855 } | 5856 } |
| 5856 | 5857 |
| 5857 Object* GetObject() { | 5858 Object* GetObject() { |
| 5858 if (length_field_ == 0) Hash(); | 5859 if (length_field_ == 0) Hash(); |
| 5859 unibrow::Utf8InputBuffer<> buffer(string_.start(), | 5860 return Heap::AllocateSymbol(string_, chars_, length_field_); |
| 5860 static_cast<unsigned>(string_.length())); | |
| 5861 return Heap::AllocateSymbol(&buffer, chars_, length_field_); | |
| 5862 } | 5861 } |
| 5863 | 5862 |
| 5864 static uint32_t StringHash(Object* obj) { | 5863 static uint32_t StringHash(Object* obj) { |
| 5865 return String::cast(obj)->Hash(); | 5864 return String::cast(obj)->Hash(); |
| 5866 } | 5865 } |
| 5867 | 5866 |
| 5868 bool IsStringKey() { return true; } | 5867 bool IsStringKey() { return true; } |
| 5869 | 5868 |
| 5870 Vector<const char> string_; | 5869 Vector<const char> string_; |
| 5871 uint32_t length_field_; | 5870 uint32_t length_field_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 5900 } | 5899 } |
| 5901 } | 5900 } |
| 5902 // Transform string to symbol if possible. | 5901 // Transform string to symbol if possible. |
| 5903 Map* map = Heap::SymbolMapForString(string_); | 5902 Map* map = Heap::SymbolMapForString(string_); |
| 5904 if (map != NULL) { | 5903 if (map != NULL) { |
| 5905 string_->set_map(map); | 5904 string_->set_map(map); |
| 5906 return string_; | 5905 return string_; |
| 5907 } | 5906 } |
| 5908 // Otherwise allocate a new symbol. | 5907 // Otherwise allocate a new symbol. |
| 5909 StringInputBuffer buffer(string_); | 5908 StringInputBuffer buffer(string_); |
| 5910 return Heap::AllocateSymbol(&buffer, | 5909 return Heap::AllocateInternalSymbol(&buffer, |
| 5911 string_->length(), | 5910 string_->length(), |
| 5912 string_->length_field()); | 5911 string_->length_field()); |
| 5913 } | 5912 } |
| 5914 | 5913 |
| 5915 static uint32_t StringHash(Object* obj) { | 5914 static uint32_t StringHash(Object* obj) { |
| 5916 return String::cast(obj)->Hash(); | 5915 return String::cast(obj)->Hash(); |
| 5917 } | 5916 } |
| 5918 | 5917 |
| 5919 bool IsStringKey() { return true; } | 5918 bool IsStringKey() { return true; } |
| 5920 | 5919 |
| 5921 String* string_; | 5920 String* string_; |
| 5922 }; | 5921 }; |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6955 // No break point. | 6954 // No break point. |
| 6956 if (break_point_objects()->IsUndefined()) return 0; | 6955 if (break_point_objects()->IsUndefined()) return 0; |
| 6957 // Single beak point. | 6956 // Single beak point. |
| 6958 if (!break_point_objects()->IsFixedArray()) return 1; | 6957 if (!break_point_objects()->IsFixedArray()) return 1; |
| 6959 // Multiple break points. | 6958 // Multiple break points. |
| 6960 return FixedArray::cast(break_point_objects())->length(); | 6959 return FixedArray::cast(break_point_objects())->length(); |
| 6961 } | 6960 } |
| 6962 | 6961 |
| 6963 | 6962 |
| 6964 } } // namespace v8::internal | 6963 } } // namespace v8::internal |
| OLD | NEW |