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 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 } | 2079 } |
2080 return isolate->heap()->ToBoolean(needs_access_checks); | 2080 return isolate->heap()->ToBoolean(needs_access_checks); |
2081 } | 2081 } |
2082 | 2082 |
2083 | 2083 |
2084 RUNTIME_FUNCTION(Runtime_EnableAccessChecks) { | 2084 RUNTIME_FUNCTION(Runtime_EnableAccessChecks) { |
2085 HandleScope scope(isolate); | 2085 HandleScope scope(isolate); |
2086 ASSERT(args.length() == 1); | 2086 ASSERT(args.length() == 1); |
2087 CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0); | 2087 CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0); |
2088 Handle<Map> old_map(object->map()); | 2088 Handle<Map> old_map(object->map()); |
2089 ASSERT(!old_map->is_access_check_needed()); | 2089 RUNTIME_ASSERT(!old_map->is_access_check_needed()); |
2090 // Copy map so it won't interfere constructor's initial map. | 2090 // Copy map so it won't interfere constructor's initial map. |
2091 Handle<Map> new_map = Map::Copy(old_map); | 2091 Handle<Map> new_map = Map::Copy(old_map); |
2092 new_map->set_is_access_check_needed(true); | 2092 new_map->set_is_access_check_needed(true); |
2093 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map); | 2093 JSObject::MigrateToMap(Handle<JSObject>::cast(object), new_map); |
2094 return isolate->heap()->undefined_value(); | 2094 return isolate->heap()->undefined_value(); |
2095 } | 2095 } |
2096 | 2096 |
2097 | 2097 |
2098 // Transform getter or setter into something DefineAccessor can handle. | 2098 // Transform getter or setter into something DefineAccessor can handle. |
2099 static Handle<Object> InstantiateAccessorComponent(Isolate* isolate, | 2099 static Handle<Object> InstantiateAccessorComponent(Isolate* isolate, |
(...skipping 13017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15117 } | 15117 } |
15118 return NULL; | 15118 return NULL; |
15119 } | 15119 } |
15120 | 15120 |
15121 | 15121 |
15122 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15122 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15123 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15123 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15124 } | 15124 } |
15125 | 15125 |
15126 } } // namespace v8::internal | 15126 } } // namespace v8::internal |
OLD | NEW |