OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted, | 1033 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted, |
1034 Execution::ToString(isolate, key), Object); | 1034 Execution::ToString(isolate, key), Object); |
1035 name = Handle<String>::cast(converted); | 1035 name = Handle<String>::cast(converted); |
1036 } | 1036 } |
1037 | 1037 |
1038 if (name->IsString()) name = String::Flatten(Handle<String>::cast(name)); | 1038 if (name->IsString()) name = String::Flatten(Handle<String>::cast(name)); |
1039 return JSReceiver::DeleteProperty(receiver, name, mode); | 1039 return JSReceiver::DeleteProperty(receiver, name, mode); |
1040 } | 1040 } |
1041 | 1041 |
1042 | 1042 |
| 1043 RUNTIME_FUNCTION(Runtime_SetHiddenProperty) { |
| 1044 HandleScope scope(isolate); |
| 1045 RUNTIME_ASSERT(args.length() == 3); |
| 1046 |
| 1047 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
| 1048 CONVERT_ARG_HANDLE_CHECKED(String, key, 1); |
| 1049 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); |
| 1050 RUNTIME_ASSERT(key->IsUniqueName()); |
| 1051 return *JSObject::SetHiddenProperty(object, key, value); |
| 1052 } |
| 1053 |
| 1054 |
1043 RUNTIME_FUNCTION(Runtime_AddNamedProperty) { | 1055 RUNTIME_FUNCTION(Runtime_AddNamedProperty) { |
1044 HandleScope scope(isolate); | 1056 HandleScope scope(isolate); |
1045 RUNTIME_ASSERT(args.length() == 4); | 1057 RUNTIME_ASSERT(args.length() == 4); |
1046 | 1058 |
1047 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 1059 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
1048 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); | 1060 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); |
1049 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); | 1061 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); |
1050 CONVERT_SMI_ARG_CHECKED(unchecked_attributes, 3); | 1062 CONVERT_SMI_ARG_CHECKED(unchecked_attributes, 3); |
1051 RUNTIME_ASSERT( | 1063 RUNTIME_ASSERT( |
1052 (unchecked_attributes & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); | 1064 (unchecked_attributes & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); |
(...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3422 } | 3434 } |
3423 return NULL; | 3435 return NULL; |
3424 } | 3436 } |
3425 | 3437 |
3426 | 3438 |
3427 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 3439 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
3428 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 3440 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
3429 } | 3441 } |
3430 } | 3442 } |
3431 } // namespace v8::internal | 3443 } // namespace v8::internal |
OLD | NEW |