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 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2043 HandleScope scope(isolate); | 2043 HandleScope scope(isolate); |
2044 DCHECK(args.length() == 1); | 2044 DCHECK(args.length() == 1); |
2045 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 2045 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
2046 Handle<Object> result; | 2046 Handle<Object> result; |
2047 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2047 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2048 isolate, result, JSObject::PreventExtensions(obj)); | 2048 isolate, result, JSObject::PreventExtensions(obj)); |
2049 return *result; | 2049 return *result; |
2050 } | 2050 } |
2051 | 2051 |
2052 | 2052 |
2053 RUNTIME_FUNCTION(Runtime_ToMethod) { | |
2054 HandleScope scope(isolate); | |
2055 DCHECK(args.length() == 2); | |
2056 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | |
2057 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); | |
2058 Handle<JSFunction> clone = JSFunction::Copy(fun); | |
2059 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); | |
2060 JSObject::SetOwnPropertyIgnoreAttributes( | |
2061 clone, | |
2062 home_object_symbol, | |
2063 home_object, | |
2064 DONT_ENUM).Assert(); | |
Toon Verwaest
2014/08/21 09:02:20
Are you using "git cl format"? This seems weirdly
Dmitry Lomov (no reviews)
2014/08/21 11:09:11
Done.
| |
2065 return *clone; | |
2066 } | |
2067 | |
2068 | |
2069 RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { | |
2070 DCHECK(args.length() == 0); | |
2071 return isolate->heap()->home_object_symbol(); | |
2072 } | |
2073 | |
2074 | |
2053 RUNTIME_FUNCTION(Runtime_IsExtensible) { | 2075 RUNTIME_FUNCTION(Runtime_IsExtensible) { |
2054 SealHandleScope shs(isolate); | 2076 SealHandleScope shs(isolate); |
2055 DCHECK(args.length() == 1); | 2077 DCHECK(args.length() == 1); |
2056 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 2078 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
2057 if (obj->IsJSGlobalProxy()) { | 2079 if (obj->IsJSGlobalProxy()) { |
2058 PrototypeIterator iter(isolate, obj); | 2080 PrototypeIterator iter(isolate, obj); |
2059 if (iter.IsAtEnd()) return isolate->heap()->false_value(); | 2081 if (iter.IsAtEnd()) return isolate->heap()->false_value(); |
2060 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); | 2082 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); |
2061 obj = JSObject::cast(iter.GetCurrent()); | 2083 obj = JSObject::cast(iter.GetCurrent()); |
2062 } | 2084 } |
(...skipping 13563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15626 } | 15648 } |
15627 return NULL; | 15649 return NULL; |
15628 } | 15650 } |
15629 | 15651 |
15630 | 15652 |
15631 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15653 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15632 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15654 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15633 } | 15655 } |
15634 | 15656 |
15635 } } // namespace v8::internal | 15657 } } // namespace v8::internal |
OLD | NEW |