OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 object, index, value, NONE)); | 411 object, index, value, NONE)); |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 RUNTIME_FUNCTION(Runtime_AppendElement) { | 415 RUNTIME_FUNCTION(Runtime_AppendElement) { |
416 HandleScope scope(isolate); | 416 HandleScope scope(isolate); |
417 DCHECK_EQ(2, args.length()); | 417 DCHECK_EQ(2, args.length()); |
418 | 418 |
419 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); | 419 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
420 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 420 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 421 CHECK(!value->IsTheHole(isolate)); |
421 | 422 |
422 uint32_t index; | 423 uint32_t index; |
423 CHECK(array->length()->ToArrayIndex(&index)); | 424 CHECK(array->length()->ToArrayIndex(&index)); |
424 | 425 |
425 RETURN_FAILURE_ON_EXCEPTION( | 426 RETURN_FAILURE_ON_EXCEPTION( |
426 isolate, JSObject::AddDataElement(array, index, value, NONE)); | 427 isolate, JSObject::AddDataElement(array, index, value, NONE)); |
427 JSObject::ValidateElements(array); | 428 JSObject::ValidateElements(array); |
428 return *array; | 429 return *array; |
429 } | 430 } |
430 | 431 |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 isolate, o, key, &success, LookupIterator::OWN); | 923 isolate, o, key, &success, LookupIterator::OWN); |
923 if (!success) return isolate->heap()->exception(); | 924 if (!success) return isolate->heap()->exception(); |
924 MAYBE_RETURN( | 925 MAYBE_RETURN( |
925 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
926 isolate->heap()->exception()); | 927 isolate->heap()->exception()); |
927 return *value; | 928 return *value; |
928 } | 929 } |
929 | 930 |
930 } // namespace internal | 931 } // namespace internal |
931 } // namespace v8 | 932 } // namespace v8 |
OLD | NEW |