| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 if (IsJSGlobalProxy()) { | 2805 if (IsJSGlobalProxy()) { |
| 2806 Object* proto = GetPrototype(); | 2806 Object* proto = GetPrototype(); |
| 2807 if (proto->IsNull()) return value; | 2807 if (proto->IsNull()) return value; |
| 2808 ASSERT(proto->IsJSGlobalObject()); | 2808 ASSERT(proto->IsJSGlobalObject()); |
| 2809 return JSObject::cast(proto)->SetLocalPropertyIgnoreAttributes( | 2809 return JSObject::cast(proto)->SetLocalPropertyIgnoreAttributes( |
| 2810 name, | 2810 name, |
| 2811 value, | 2811 value, |
| 2812 attributes); | 2812 attributes); |
| 2813 } | 2813 } |
| 2814 | 2814 |
| 2815 // Unlike SetLocalProperty, we ignore the prototype chain and | 2815 // Check for accessor in prototype chain removed here in clone. |
| 2816 // any accessors in it. | |
| 2817 if (!result.IsFound()) { | 2816 if (!result.IsFound()) { |
| 2818 // Neither properties nor transitions found. | 2817 // Neither properties nor transitions found. |
| 2819 return AddProperty(name, value, attributes, kNonStrictMode); | 2818 return AddProperty(name, value, attributes, kNonStrictMode); |
| 2820 } | 2819 } |
| 2821 | 2820 |
| 2822 PropertyDetails details = PropertyDetails(attributes, NORMAL); | 2821 PropertyDetails details = PropertyDetails(attributes, NORMAL); |
| 2823 | 2822 |
| 2824 // Check of IsReadOnly removed from here in clone. | 2823 // Check of IsReadOnly removed from here in clone. |
| 2825 switch (result.type()) { | 2824 switch (result.type()) { |
| 2826 case NORMAL: | 2825 case NORMAL: |
| (...skipping 7380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10207 public: | 10206 public: |
| 10208 explicit SubStringAsciiSymbolKey(Handle<SeqAsciiString> string, | 10207 explicit SubStringAsciiSymbolKey(Handle<SeqAsciiString> string, |
| 10209 int from, | 10208 int from, |
| 10210 int length) | 10209 int length) |
| 10211 : string_(string), from_(from), length_(length) { } | 10210 : string_(string), from_(from), length_(length) { } |
| 10212 | 10211 |
| 10213 uint32_t Hash() { | 10212 uint32_t Hash() { |
| 10214 ASSERT(length_ >= 0); | 10213 ASSERT(length_ >= 0); |
| 10215 ASSERT(from_ + length_ <= string_->length()); | 10214 ASSERT(from_ + length_ <= string_->length()); |
| 10216 StringHasher hasher(length_); | 10215 StringHasher hasher(length_); |
| 10217 AssertNoAllocation no_alloc; | |
| 10218 const char* chars = string_->GetChars() + from_; | |
| 10219 | 10216 |
| 10220 // Very long strings have a trivial hash that doesn't inspect the | 10217 // Very long strings have a trivial hash that doesn't inspect the |
| 10221 // string contents. | 10218 // string contents. |
| 10222 if (hasher.has_trivial_hash()) { | 10219 if (hasher.has_trivial_hash()) { |
| 10223 hash_field_ = hasher.GetHashField(); | 10220 hash_field_ = hasher.GetHashField(); |
| 10224 } else { | 10221 } else { |
| 10225 int i = 0; | 10222 int i = 0; |
| 10226 // Do the iterative array index computation as long as there is a | 10223 // Do the iterative array index computation as long as there is a |
| 10227 // chance this is an array index. | 10224 // chance this is an array index. |
| 10228 while (i < length_ && hasher.is_array_index()) { | 10225 while (i < length_ && hasher.is_array_index()) { |
| 10229 hasher.AddCharacter(static_cast<uc32>(chars[i])); | 10226 hasher.AddCharacter(static_cast<uc32>( |
| 10227 string_->SeqAsciiStringGet(i + from_))); |
| 10230 i++; | 10228 i++; |
| 10231 } | 10229 } |
| 10232 | 10230 |
| 10233 // Process the remaining characters without updating the array | 10231 // Process the remaining characters without updating the array |
| 10234 // index. | 10232 // index. |
| 10235 while (i < length_) { | 10233 while (i < length_) { |
| 10236 hasher.AddCharacterNoIndex(static_cast<uc32>(chars[i])); | 10234 hasher.AddCharacterNoIndex(static_cast<uc32>( |
| 10235 string_->SeqAsciiStringGet(i + from_))); |
| 10237 i++; | 10236 i++; |
| 10238 } | 10237 } |
| 10239 hash_field_ = hasher.GetHashField(); | 10238 hash_field_ = hasher.GetHashField(); |
| 10240 } | 10239 } |
| 10241 | 10240 |
| 10242 uint32_t result = hash_field_ >> String::kHashShift; | 10241 uint32_t result = hash_field_ >> String::kHashShift; |
| 10243 ASSERT(result != 0); // Ensure that the hash value of 0 is never computed. | 10242 ASSERT(result != 0); // Ensure that the hash value of 0 is never computed. |
| 10244 return result; | 10243 return result; |
| 10245 } | 10244 } |
| 10246 | 10245 |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12163 if (break_point_objects()->IsUndefined()) return 0; | 12162 if (break_point_objects()->IsUndefined()) return 0; |
| 12164 // Single break point. | 12163 // Single break point. |
| 12165 if (!break_point_objects()->IsFixedArray()) return 1; | 12164 if (!break_point_objects()->IsFixedArray()) return 1; |
| 12166 // Multiple break points. | 12165 // Multiple break points. |
| 12167 return FixedArray::cast(break_point_objects())->length(); | 12166 return FixedArray::cast(break_point_objects())->length(); |
| 12168 } | 12167 } |
| 12169 #endif | 12168 #endif |
| 12170 | 12169 |
| 12171 | 12170 |
| 12172 } } // namespace v8::internal | 12171 } } // namespace v8::internal |
| OLD | NEW |