| 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(Handle<JSFunction>::cast( |
| 2059 isolate->factory()->CopyJSObject(fun))); |
| 2060 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); |
| 2061 Object::SetProperty(clone, home_object_symbol, home_object, STRICT); |
| 2062 return *clone; |
| 2063 } |
| 2064 |
| 2065 |
| 2053 RUNTIME_FUNCTION(Runtime_IsExtensible) { | 2066 RUNTIME_FUNCTION(Runtime_IsExtensible) { |
| 2054 SealHandleScope shs(isolate); | 2067 SealHandleScope shs(isolate); |
| 2055 DCHECK(args.length() == 1); | 2068 DCHECK(args.length() == 1); |
| 2056 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 2069 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 2057 if (obj->IsJSGlobalProxy()) { | 2070 if (obj->IsJSGlobalProxy()) { |
| 2058 PrototypeIterator iter(isolate, obj); | 2071 PrototypeIterator iter(isolate, obj); |
| 2059 if (iter.IsAtEnd()) return isolate->heap()->false_value(); | 2072 if (iter.IsAtEnd()) return isolate->heap()->false_value(); |
| 2060 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); | 2073 DCHECK(iter.GetCurrent()->IsJSGlobalObject()); |
| 2061 obj = JSObject::cast(iter.GetCurrent()); | 2074 obj = JSObject::cast(iter.GetCurrent()); |
| 2062 } | 2075 } |
| (...skipping 13567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15630 } | 15643 } |
| 15631 return NULL; | 15644 return NULL; |
| 15632 } | 15645 } |
| 15633 | 15646 |
| 15634 | 15647 |
| 15635 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15648 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15636 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15649 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15637 } | 15650 } |
| 15638 | 15651 |
| 15639 } } // namespace v8::internal | 15652 } } // namespace v8::internal |
| OLD | NEW |