| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 101 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 102 DCHECK(!obj->IsAccessCheckNeeded()); | 102 DCHECK(!obj->IsAccessCheckNeeded()); |
| 103 DCHECK(!obj->map()->is_observed()); | 103 DCHECK(!obj->map()->is_observed()); |
| 104 Handle<Object> result; | 104 Handle<Object> result; |
| 105 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 105 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 106 isolate, result, JSObject::SetPrototype(obj, prototype, false)); | 106 isolate, result, JSObject::SetPrototype(obj, prototype, false)); |
| 107 return *result; | 107 return *result; |
| 108 } | 108 } |
| 109 | 109 |
| 110 | 110 |
| 111 RUNTIME_FUNCTION(Runtime_GetElementsCapacity) { |
| 112 HandleScope scope(isolate); |
| 113 DCHECK(args.length() == 1); |
| 114 CONVERT_ARG_HANDLE_CHECKED(JSArray, obj, 0); |
| 115 return Smi::FromInt(obj->elements()->length()); |
| 116 } |
| 117 |
| 118 |
| 111 RUNTIME_FUNCTION(Runtime_SetPrototype) { | 119 RUNTIME_FUNCTION(Runtime_SetPrototype) { |
| 112 HandleScope scope(isolate); | 120 HandleScope scope(isolate); |
| 113 DCHECK(args.length() == 2); | 121 DCHECK(args.length() == 2); |
| 114 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 122 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 115 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 123 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 116 if (obj->IsAccessCheckNeeded() && | 124 if (obj->IsAccessCheckNeeded() && |
| 117 !isolate->MayNamedAccess(obj, isolate->factory()->proto_string(), | 125 !isolate->MayNamedAccess(obj, isolate->factory()->proto_string(), |
| 118 v8::ACCESS_SET)) { | 126 v8::ACCESS_SET)) { |
| 119 isolate->ReportFailedAccessCheck(obj, v8::ACCESS_SET); | 127 isolate->ReportFailedAccessCheck(obj, v8::ACCESS_SET); |
| 120 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); | 128 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); |
| (...skipping 3192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3313 } | 3321 } |
| 3314 return NULL; | 3322 return NULL; |
| 3315 } | 3323 } |
| 3316 | 3324 |
| 3317 | 3325 |
| 3318 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 3326 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 3319 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 3327 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 3320 } | 3328 } |
| 3321 } | 3329 } |
| 3322 } // namespace v8::internal | 3330 } // namespace v8::internal |
| OLD | NEW |