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 4930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4941 | 4941 |
4942 | 4942 |
4943 static bool IsValidAccessor(Handle<Object> obj) { | 4943 static bool IsValidAccessor(Handle<Object> obj) { |
4944 return obj->IsUndefined() || obj->IsSpecFunction() || obj->IsNull(); | 4944 return obj->IsUndefined() || obj->IsSpecFunction() || obj->IsNull(); |
4945 } | 4945 } |
4946 | 4946 |
4947 | 4947 |
4948 // Transform getter or setter into something DefineAccessor can handle. | 4948 // Transform getter or setter into something DefineAccessor can handle. |
4949 static Handle<Object> InstantiateAccessorComponent(Isolate* isolate, | 4949 static Handle<Object> InstantiateAccessorComponent(Isolate* isolate, |
4950 Handle<Object> component) { | 4950 Handle<Object> component) { |
4951 if (component->IsUndefined()) return isolate->factory()->null_value(); | 4951 if (component->IsUndefined()) return isolate->factory()->undefined_value(); |
4952 Handle<FunctionTemplateInfo> info = | 4952 Handle<FunctionTemplateInfo> info = |
4953 Handle<FunctionTemplateInfo>::cast(component); | 4953 Handle<FunctionTemplateInfo>::cast(component); |
4954 return Utils::OpenHandle(*Utils::ToLocal(info)->GetFunction()); | 4954 return Utils::OpenHandle(*Utils::ToLocal(info)->GetFunction()); |
4955 } | 4955 } |
4956 | 4956 |
4957 | 4957 |
4958 RUNTIME_FUNCTION(Runtime_DefineApiAccessorProperty) { | 4958 RUNTIME_FUNCTION(Runtime_DefineApiAccessorProperty) { |
4959 HandleScope scope(isolate); | 4959 HandleScope scope(isolate); |
4960 DCHECK(args.length() == 5); | 4960 DCHECK(args.length() == 5); |
4961 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 4961 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
(...skipping 10664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15626 } | 15626 } |
15627 return NULL; | 15627 return NULL; |
15628 } | 15628 } |
15629 | 15629 |
15630 | 15630 |
15631 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15631 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15632 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15632 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15633 } | 15633 } |
15634 | 15634 |
15635 } } // namespace v8::internal | 15635 } } // namespace v8::internal |
OLD | NEW |