| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 // Get the data object from access check info. | 923 // Get the data object from access check info. |
| 924 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); | 924 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); |
| 925 if (!constructor->shared()->IsApiFunction()) return; | 925 if (!constructor->shared()->IsApiFunction()) return; |
| 926 Object* data_obj = | 926 Object* data_obj = |
| 927 constructor->shared()->get_api_func_data()->access_check_info(); | 927 constructor->shared()->get_api_func_data()->access_check_info(); |
| 928 if (data_obj == heap_.undefined_value()) return; | 928 if (data_obj == heap_.undefined_value()) return; |
| 929 | 929 |
| 930 HandleScope scope(this); | 930 HandleScope scope(this); |
| 931 Handle<JSObject> receiver_handle(receiver); | 931 Handle<JSObject> receiver_handle(receiver); |
| 932 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); | 932 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); |
| 933 { VMState state(this, EXTERNAL); | 933 { VMState<EXTERNAL> state(this); |
| 934 thread_local_top()->failed_access_check_callback_( | 934 thread_local_top()->failed_access_check_callback_( |
| 935 v8::Utils::ToLocal(receiver_handle), | 935 v8::Utils::ToLocal(receiver_handle), |
| 936 type, | 936 type, |
| 937 v8::Utils::ToLocal(data)); | 937 v8::Utils::ToLocal(data)); |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 | 940 |
| 941 | 941 |
| 942 enum MayAccessDecision { | 942 enum MayAccessDecision { |
| 943 YES, NO, UNKNOWN | 943 YES, NO, UNKNOWN |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 if (!callback) return false; | 1002 if (!callback) return false; |
| 1003 | 1003 |
| 1004 HandleScope scope(this); | 1004 HandleScope scope(this); |
| 1005 Handle<JSObject> receiver_handle(receiver, this); | 1005 Handle<JSObject> receiver_handle(receiver, this); |
| 1006 Handle<Object> key_handle(key, this); | 1006 Handle<Object> key_handle(key, this); |
| 1007 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); | 1007 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); |
| 1008 LOG(this, ApiNamedSecurityCheck(key)); | 1008 LOG(this, ApiNamedSecurityCheck(key)); |
| 1009 bool result = false; | 1009 bool result = false; |
| 1010 { | 1010 { |
| 1011 // Leaving JavaScript. | 1011 // Leaving JavaScript. |
| 1012 VMState state(this, EXTERNAL); | 1012 VMState<EXTERNAL> state(this); |
| 1013 result = callback(v8::Utils::ToLocal(receiver_handle), | 1013 result = callback(v8::Utils::ToLocal(receiver_handle), |
| 1014 v8::Utils::ToLocal(key_handle), | 1014 v8::Utils::ToLocal(key_handle), |
| 1015 type, | 1015 type, |
| 1016 v8::Utils::ToLocal(data)); | 1016 v8::Utils::ToLocal(data)); |
| 1017 } | 1017 } |
| 1018 return result; | 1018 return result; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 | 1021 |
| 1022 bool Isolate::MayIndexedAccess(JSObject* receiver, | 1022 bool Isolate::MayIndexedAccess(JSObject* receiver, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1044 | 1044 |
| 1045 if (!callback) return false; | 1045 if (!callback) return false; |
| 1046 | 1046 |
| 1047 HandleScope scope(this); | 1047 HandleScope scope(this); |
| 1048 Handle<JSObject> receiver_handle(receiver, this); | 1048 Handle<JSObject> receiver_handle(receiver, this); |
| 1049 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); | 1049 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this); |
| 1050 LOG(this, ApiIndexedSecurityCheck(index)); | 1050 LOG(this, ApiIndexedSecurityCheck(index)); |
| 1051 bool result = false; | 1051 bool result = false; |
| 1052 { | 1052 { |
| 1053 // Leaving JavaScript. | 1053 // Leaving JavaScript. |
| 1054 VMState state(this, EXTERNAL); | 1054 VMState<EXTERNAL> state(this); |
| 1055 result = callback(v8::Utils::ToLocal(receiver_handle), | 1055 result = callback(v8::Utils::ToLocal(receiver_handle), |
| 1056 index, | 1056 index, |
| 1057 type, | 1057 type, |
| 1058 v8::Utils::ToLocal(data)); | 1058 v8::Utils::ToLocal(data)); |
| 1059 } | 1059 } |
| 1060 return result; | 1060 return result; |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 | 1063 |
| 1064 const char* const Isolate::kStackOverflowMessage = | 1064 const char* const Isolate::kStackOverflowMessage = |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2109 stub_cache_ = new StubCache(this, runtime_zone()); | 2109 stub_cache_ = new StubCache(this, runtime_zone()); |
| 2110 regexp_stack_ = new RegExpStack(); | 2110 regexp_stack_ = new RegExpStack(); |
| 2111 regexp_stack_->isolate_ = this; | 2111 regexp_stack_->isolate_ = this; |
| 2112 date_cache_ = new DateCache(); | 2112 date_cache_ = new DateCache(); |
| 2113 code_stub_interface_descriptors_ = | 2113 code_stub_interface_descriptors_ = |
| 2114 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; | 2114 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; |
| 2115 cpu_profiler_ = new CpuProfiler(this); | 2115 cpu_profiler_ = new CpuProfiler(this); |
| 2116 heap_profiler_ = new HeapProfiler(heap()); | 2116 heap_profiler_ = new HeapProfiler(heap()); |
| 2117 | 2117 |
| 2118 // Enable logging before setting up the heap | 2118 // Enable logging before setting up the heap |
| 2119 logger_->SetUp(); | 2119 logger_->SetUp(this); |
| 2120 | 2120 |
| 2121 // Initialize other runtime facilities | 2121 // Initialize other runtime facilities |
| 2122 #if defined(USE_SIMULATOR) | 2122 #if defined(USE_SIMULATOR) |
| 2123 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) | 2123 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) |
| 2124 Simulator::Initialize(this); | 2124 Simulator::Initialize(this); |
| 2125 #endif | 2125 #endif |
| 2126 #endif | 2126 #endif |
| 2127 | 2127 |
| 2128 { // NOLINT | 2128 { // NOLINT |
| 2129 // Ensure that the thread has a valid stack guard. The v8::Locker object | 2129 // Ensure that the thread has a valid stack guard. The v8::Locker object |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 | 2450 |
| 2451 #ifdef DEBUG | 2451 #ifdef DEBUG |
| 2452 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2452 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2453 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2453 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2454 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2454 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2455 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2455 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2456 #undef ISOLATE_FIELD_OFFSET | 2456 #undef ISOLATE_FIELD_OFFSET |
| 2457 #endif | 2457 #endif |
| 2458 | 2458 |
| 2459 } } // namespace v8::internal | 2459 } } // namespace v8::internal |
| OLD | NEW |