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 6618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6629 uint32_t index = 0; | 6629 uint32_t index = 0; |
6630 bool is_element = name->AsArrayIndex(&index); | 6630 bool is_element = name->AsArrayIndex(&index); |
6631 | 6631 |
6632 Handle<Object> old_value = isolate->factory()->the_hole_value(); | 6632 Handle<Object> old_value = isolate->factory()->the_hole_value(); |
6633 bool is_observed = object->map()->is_observed() && | 6633 bool is_observed = object->map()->is_observed() && |
6634 *name != isolate->heap()->hidden_string(); | 6634 *name != isolate->heap()->hidden_string(); |
6635 bool preexists = false; | 6635 bool preexists = false; |
6636 if (is_observed) { | 6636 if (is_observed) { |
6637 if (is_element) { | 6637 if (is_element) { |
6638 Maybe<bool> maybe = HasOwnElement(object, index); | 6638 Maybe<bool> maybe = HasOwnElement(object, index); |
6639 ASSERT(maybe.has_value); | 6639 // Workaround for a GCC 4.4.3 bug which leads to "‘preexists’ may be used |
| 6640 // uninitialized in this function". |
| 6641 if (!maybe.has_value) { |
| 6642 ASSERT(false); |
| 6643 return isolate->factory()->undefined_value(); |
| 6644 } |
6640 preexists = maybe.value; | 6645 preexists = maybe.value; |
6641 if (preexists && GetOwnElementAccessorPair(object, index).is_null()) { | 6646 if (preexists && GetOwnElementAccessorPair(object, index).is_null()) { |
6642 old_value = | 6647 old_value = |
6643 Object::GetElement(isolate, object, index).ToHandleChecked(); | 6648 Object::GetElement(isolate, object, index).ToHandleChecked(); |
6644 } | 6649 } |
6645 } else { | 6650 } else { |
6646 LookupResult lookup(isolate); | 6651 LookupResult lookup(isolate); |
6647 object->LookupOwn(name, &lookup, true); | 6652 object->LookupOwn(name, &lookup, true); |
6648 preexists = lookup.IsProperty(); | 6653 preexists = lookup.IsProperty(); |
6649 if (preexists && lookup.IsDataProperty()) { | 6654 if (preexists && lookup.IsDataProperty()) { |
(...skipping 10314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16964 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16969 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16965 static const char* error_messages_[] = { | 16970 static const char* error_messages_[] = { |
16966 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16971 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16967 }; | 16972 }; |
16968 #undef ERROR_MESSAGES_TEXTS | 16973 #undef ERROR_MESSAGES_TEXTS |
16969 return error_messages_[reason]; | 16974 return error_messages_[reason]; |
16970 } | 16975 } |
16971 | 16976 |
16972 | 16977 |
16973 } } // namespace v8::internal | 16978 } } // namespace v8::internal |
OLD | NEW |