| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 4775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4786 | 4786 |
| 4787 object->set_properties(*fields); | 4787 object->set_properties(*fields); |
| 4788 ASSERT(object->IsJSObject()); | 4788 ASSERT(object->IsJSObject()); |
| 4789 | 4789 |
| 4790 // Check that it really works. | 4790 // Check that it really works. |
| 4791 ASSERT(object->HasFastProperties()); | 4791 ASSERT(object->HasFastProperties()); |
| 4792 } | 4792 } |
| 4793 | 4793 |
| 4794 | 4794 |
| 4795 void JSObject::ResetElements(Handle<JSObject> object) { | 4795 void JSObject::ResetElements(Handle<JSObject> object) { |
| 4796 Heap* heap = object->GetIsolate()->heap(); | 4796 Isolate* isolate = object->GetIsolate(); |
| 4797 CHECK(object->map() != heap->sloppy_arguments_elements_map()); | 4797 CHECK(object->map() != isolate->heap()->sloppy_arguments_elements_map()); |
| 4798 object->set_elements(object->map()->GetInitialElements()); | 4798 if (object->map()->has_dictionary_elements()) { |
| 4799 Handle<SeededNumberDictionary> new_elements = |
| 4800 SeededNumberDictionary::New(isolate, 0); |
| 4801 object->set_elements(*new_elements); |
| 4802 } else { |
| 4803 object->set_elements(object->map()->GetInitialElements()); |
| 4804 } |
| 4799 } | 4805 } |
| 4800 | 4806 |
| 4801 | 4807 |
| 4802 static Handle<SeededNumberDictionary> CopyFastElementsToDictionary( | 4808 static Handle<SeededNumberDictionary> CopyFastElementsToDictionary( |
| 4803 Handle<FixedArrayBase> array, | 4809 Handle<FixedArrayBase> array, |
| 4804 int length, | 4810 int length, |
| 4805 Handle<SeededNumberDictionary> dictionary) { | 4811 Handle<SeededNumberDictionary> dictionary) { |
| 4806 Isolate* isolate = array->GetIsolate(); | 4812 Isolate* isolate = array->GetIsolate(); |
| 4807 Factory* factory = isolate->factory(); | 4813 Factory* factory = isolate->factory(); |
| 4808 bool has_double_elements = array->IsFixedDoubleArray(); | 4814 bool has_double_elements = array->IsFixedDoubleArray(); |
| (...skipping 12200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17009 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17015 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 17010 static const char* error_messages_[] = { | 17016 static const char* error_messages_[] = { |
| 17011 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17017 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 17012 }; | 17018 }; |
| 17013 #undef ERROR_MESSAGES_TEXTS | 17019 #undef ERROR_MESSAGES_TEXTS |
| 17014 return error_messages_[reason]; | 17020 return error_messages_[reason]; |
| 17015 } | 17021 } |
| 17016 | 17022 |
| 17017 | 17023 |
| 17018 } } // namespace v8::internal | 17024 } } // namespace v8::internal |
| OLD | NEW |