| 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 5634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5645 dictionary->set_requires_slow_elements(); | 5645 dictionary->set_requires_slow_elements(); |
| 5646 // Freeze all elements in the dictionary | 5646 // Freeze all elements in the dictionary |
| 5647 FreezeDictionary(dictionary); | 5647 FreezeDictionary(dictionary); |
| 5648 } | 5648 } |
| 5649 | 5649 |
| 5650 return object; | 5650 return object; |
| 5651 } | 5651 } |
| 5652 | 5652 |
| 5653 | 5653 |
| 5654 void JSObject::SetObserved(Handle<JSObject> object) { | 5654 void JSObject::SetObserved(Handle<JSObject> object) { |
| 5655 ASSERT(!object->map()->is_observed()); |
| 5655 Isolate* isolate = object->GetIsolate(); | 5656 Isolate* isolate = object->GetIsolate(); |
| 5656 | 5657 |
| 5657 if (object->map()->is_observed()) | |
| 5658 return; | |
| 5659 | |
| 5660 LookupResult result(isolate); | 5658 LookupResult result(isolate); |
| 5661 object->map()->LookupTransition(*object, | 5659 object->map()->LookupTransition(*object, |
| 5662 isolate->heap()->observed_symbol(), | 5660 isolate->heap()->observed_symbol(), |
| 5663 &result); | 5661 &result); |
| 5664 | 5662 |
| 5665 Handle<Map> new_map; | 5663 Handle<Map> new_map; |
| 5666 if (result.IsTransition()) { | 5664 if (result.IsTransition()) { |
| 5667 new_map = handle(result.GetTransitionTarget()); | 5665 new_map = handle(result.GetTransitionTarget()); |
| 5668 ASSERT(new_map->is_observed()); | 5666 ASSERT(new_map->is_observed()); |
| 5669 } else if (object->map()->CanHaveMoreTransitions()) { | 5667 } else if (object->map()->CanHaveMoreTransitions()) { |
| (...skipping 10822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16492 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16490 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16493 static const char* error_messages_[] = { | 16491 static const char* error_messages_[] = { |
| 16494 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16492 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16495 }; | 16493 }; |
| 16496 #undef ERROR_MESSAGES_TEXTS | 16494 #undef ERROR_MESSAGES_TEXTS |
| 16497 return error_messages_[reason]; | 16495 return error_messages_[reason]; |
| 16498 } | 16496 } |
| 16499 | 16497 |
| 16500 | 16498 |
| 16501 } } // namespace v8::internal | 16499 } } // namespace v8::internal |
| OLD | NEW |