| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3552 ENTER_V8; | 3552 ENTER_V8; |
| 3553 i::Object** ctx = reinterpret_cast<i::Object**>(this); | 3553 i::Object** ctx = reinterpret_cast<i::Object**>(this); |
| 3554 i::Handle<i::Context> context = | 3554 i::Handle<i::Context> context = |
| 3555 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); | 3555 i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); |
| 3556 i::Isolate::Current()->bootstrapper()->ReattachGlobal( | 3556 i::Isolate::Current()->bootstrapper()->ReattachGlobal( |
| 3557 context, | 3557 context, |
| 3558 Utils::OpenHandle(*global_object)); | 3558 Utils::OpenHandle(*global_object)); |
| 3559 } | 3559 } |
| 3560 | 3560 |
| 3561 | 3561 |
| 3562 void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) { |
| 3563 i::GlobalHandles::SetWrapperClassId(global_handle, class_id); |
| 3564 } |
| 3565 |
| 3566 |
| 3562 Local<v8::Object> ObjectTemplate::NewInstance() { | 3567 Local<v8::Object> ObjectTemplate::NewInstance() { |
| 3563 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); | 3568 ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); |
| 3564 LOG_API("ObjectTemplate::NewInstance"); | 3569 LOG_API("ObjectTemplate::NewInstance"); |
| 3565 ENTER_V8; | 3570 ENTER_V8; |
| 3566 EXCEPTION_PREAMBLE(); | 3571 EXCEPTION_PREAMBLE(); |
| 3567 i::Handle<i::Object> obj = | 3572 i::Handle<i::Object> obj = |
| 3568 i::Execution::InstantiateObject(Utils::OpenHandle(this), | 3573 i::Execution::InstantiateObject(Utils::OpenHandle(this), |
| 3569 &has_pending_exception); | 3574 &has_pending_exception); |
| 3570 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); | 3575 EXCEPTION_BAILOUT_CHECK(Local<v8::Object>()); |
| 3571 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); | 3576 return Utils::ToLocal(i::Handle<i::JSObject>::cast(obj)); |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4099 } | 4104 } |
| 4100 | 4105 |
| 4101 | 4106 |
| 4102 void V8::SetFailedAccessCheckCallbackFunction( | 4107 void V8::SetFailedAccessCheckCallbackFunction( |
| 4103 FailedAccessCheckCallback callback) { | 4108 FailedAccessCheckCallback callback) { |
| 4104 if (IsDeadCheck("v8::V8::SetFailedAccessCheckCallbackFunction()")) return; | 4109 if (IsDeadCheck("v8::V8::SetFailedAccessCheckCallbackFunction()")) return; |
| 4105 i::Isolate::Current()->SetFailedAccessCheckCallback(callback); | 4110 i::Isolate::Current()->SetFailedAccessCheckCallback(callback); |
| 4106 } | 4111 } |
| 4107 | 4112 |
| 4108 | 4113 |
| 4109 void V8::AddObjectGroup(Persistent<Value>* objects, size_t length) { | 4114 void V8::AddObjectGroup(Persistent<Value>* objects, |
| 4115 size_t length, |
| 4116 RetainedObjectInfo* info) { |
| 4110 if (IsDeadCheck("v8::V8::AddObjectGroup()")) return; | 4117 if (IsDeadCheck("v8::V8::AddObjectGroup()")) return; |
| 4111 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); | 4118 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); |
| 4112 i::Isolate::Current()->global_handles()->AddGroup( | 4119 i::Isolate::Current()->global_handles()->AddGroup( |
| 4113 reinterpret_cast<i::Object***>(objects), length); | 4120 reinterpret_cast<i::Object***>(objects), length, info); |
| 4114 } | 4121 } |
| 4115 | 4122 |
| 4116 | 4123 |
| 4117 int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) { | 4124 int V8::AdjustAmountOfExternalAllocatedMemory(int change_in_bytes) { |
| 4118 if (IsDeadCheck("v8::V8::AdjustAmountOfExternalAllocatedMemory()")) return 0; | 4125 if (IsDeadCheck("v8::V8::AdjustAmountOfExternalAllocatedMemory()")) return 0; |
| 4119 return HEAP->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); | 4126 return HEAP->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); |
| 4120 } | 4127 } |
| 4121 | 4128 |
| 4122 | 4129 |
| 4123 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { | 4130 void V8::SetGlobalGCPrologueCallback(GCCallback callback) { |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5094 internal_type = i::HeapSnapshot::kAggregated; | 5101 internal_type = i::HeapSnapshot::kAggregated; |
| 5095 break; | 5102 break; |
| 5096 default: | 5103 default: |
| 5097 UNREACHABLE(); | 5104 UNREACHABLE(); |
| 5098 } | 5105 } |
| 5099 return reinterpret_cast<const HeapSnapshot*>( | 5106 return reinterpret_cast<const HeapSnapshot*>( |
| 5100 i::HeapProfiler::TakeSnapshot( | 5107 i::HeapProfiler::TakeSnapshot( |
| 5101 *Utils::OpenHandle(*title), internal_type, control)); | 5108 *Utils::OpenHandle(*title), internal_type, control)); |
| 5102 } | 5109 } |
| 5103 | 5110 |
| 5111 |
| 5112 void HeapProfiler::DefineWrapperClass(uint16_t class_id, |
| 5113 WrapperInfoCallback callback) { |
| 5114 i::Isolate::Current()->heap_profiler()->DefineWrapperClass(class_id, |
| 5115 callback); |
| 5116 } |
| 5117 |
| 5104 #endif // ENABLE_LOGGING_AND_PROFILING | 5118 #endif // ENABLE_LOGGING_AND_PROFILING |
| 5105 | 5119 |
| 5106 | 5120 |
| 5107 v8::Testing::StressType internal::Testing::stress_type_ = | 5121 v8::Testing::StressType internal::Testing::stress_type_ = |
| 5108 v8::Testing::kStressTypeOpt; | 5122 v8::Testing::kStressTypeOpt; |
| 5109 | 5123 |
| 5110 | 5124 |
| 5111 void Testing::SetStressRunType(Testing::StressType type) { | 5125 void Testing::SetStressRunType(Testing::StressType type) { |
| 5112 internal::Testing::set_stress_type(type); | 5126 internal::Testing::set_stress_type(type); |
| 5113 } | 5127 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5158 SetFlagsFromString(kForcedOptimizations); | 5172 SetFlagsFromString(kForcedOptimizations); |
| 5159 } else if (run == GetStressRuns() - 2) { | 5173 } else if (run == GetStressRuns() - 2) { |
| 5160 SetFlagsFromString(kEagerOptimizations); | 5174 SetFlagsFromString(kEagerOptimizations); |
| 5161 } else { | 5175 } else { |
| 5162 SetFlagsFromString(kLazyOptimizations); | 5176 SetFlagsFromString(kLazyOptimizations); |
| 5163 } | 5177 } |
| 5164 #endif | 5178 #endif |
| 5165 } | 5179 } |
| 5166 | 5180 |
| 5167 | 5181 |
| 5182 void Testing::DeoptimizeAll() { |
| 5183 internal::Deoptimizer::DeoptimizeAll(); |
| 5184 } |
| 5185 |
| 5186 |
| 5168 namespace internal { | 5187 namespace internal { |
| 5169 | 5188 |
| 5170 | 5189 |
| 5171 void HandleScopeImplementer::FreeThreadResources() { | 5190 void HandleScopeImplementer::FreeThreadResources() { |
| 5172 Free(); | 5191 Free(); |
| 5173 } | 5192 } |
| 5174 | 5193 |
| 5175 | 5194 |
| 5176 char* HandleScopeImplementer::ArchiveThread(char* storage) { | 5195 char* HandleScopeImplementer::ArchiveThread(char* storage) { |
| 5177 Isolate* isolate = Isolate::Current(); | 5196 Isolate* isolate = Isolate::Current(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5227 | 5246 |
| 5228 | 5247 |
| 5229 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5248 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5230 HandleScopeImplementer* thread_local = | 5249 HandleScopeImplementer* thread_local = |
| 5231 reinterpret_cast<HandleScopeImplementer*>(storage); | 5250 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5232 thread_local->IterateThis(v); | 5251 thread_local->IterateThis(v); |
| 5233 return storage + ArchiveSpacePerThread(); | 5252 return storage + ArchiveSpacePerThread(); |
| 5234 } | 5253 } |
| 5235 | 5254 |
| 5236 } } // namespace v8::internal | 5255 } } // namespace v8::internal |
| OLD | NEW |