OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3592 func->shared()->set_name(*Utils::OpenHandle(*name)); | 3592 func->shared()->set_name(*Utils::OpenHandle(*name)); |
3593 } | 3593 } |
3594 | 3594 |
3595 | 3595 |
3596 Handle<Value> Function::GetName() const { | 3596 Handle<Value> Function::GetName() const { |
3597 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); | 3597 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); |
3598 return Utils::ToLocal(i::Handle<i::Object>(func->shared()->name())); | 3598 return Utils::ToLocal(i::Handle<i::Object>(func->shared()->name())); |
3599 } | 3599 } |
3600 | 3600 |
3601 | 3601 |
3602 Handle<Value> Function::GetInferredName() const { | |
3603 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); | |
3604 return Utils::ToLocal(i::Handle<i::Object>(func->shared()->inferred_name())); | |
3605 } | |
3606 | |
3607 | |
3608 ScriptOrigin Function::GetScriptOrigin() const { | 3602 ScriptOrigin Function::GetScriptOrigin() const { |
3609 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); | 3603 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); |
3610 if (func->shared()->script()->IsScript()) { | 3604 if (func->shared()->script()->IsScript()) { |
3611 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); | 3605 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); |
3612 v8::ScriptOrigin origin( | 3606 v8::ScriptOrigin origin( |
3613 Utils::ToLocal(i::Handle<i::Object>(script->name())), | 3607 Utils::ToLocal(i::Handle<i::Object>(script->name())), |
3614 v8::Integer::New(script->line_offset()->value()), | 3608 v8::Integer::New(script->line_offset()->value()), |
3615 v8::Integer::New(script->column_offset()->value())); | 3609 v8::Integer::New(script->column_offset()->value())); |
3616 return origin; | 3610 return origin; |
3617 } | 3611 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 | 4020 |
4027 i::Heap* heap = i::Isolate::Current()->heap(); | 4021 i::Heap* heap = i::Isolate::Current()->heap(); |
4028 heap_statistics->set_total_heap_size(heap->CommittedMemory()); | 4022 heap_statistics->set_total_heap_size(heap->CommittedMemory()); |
4029 heap_statistics->set_total_heap_size_executable( | 4023 heap_statistics->set_total_heap_size_executable( |
4030 heap->CommittedMemoryExecutable()); | 4024 heap->CommittedMemoryExecutable()); |
4031 heap_statistics->set_used_heap_size(heap->SizeOfObjects()); | 4025 heap_statistics->set_used_heap_size(heap->SizeOfObjects()); |
4032 heap_statistics->set_heap_size_limit(heap->MaxReserved()); | 4026 heap_statistics->set_heap_size_limit(heap->MaxReserved()); |
4033 } | 4027 } |
4034 | 4028 |
4035 | 4029 |
4036 void v8::V8::VisitExternalResources(ExternalResourceVisitor* visitor) { | |
4037 i::Isolate* isolate = i::Isolate::Current(); | |
4038 IsDeadCheck(isolate, "v8::V8::VisitExternalResources"); | |
4039 isolate->heap()->VisitExternalResources(visitor); | |
4040 } | |
4041 | |
4042 | |
4043 bool v8::V8::IdleNotification() { | 4030 bool v8::V8::IdleNotification() { |
4044 // Returning true tells the caller that it need not | 4031 // Returning true tells the caller that it need not |
4045 // continue to call IdleNotification. | 4032 // continue to call IdleNotification. |
4046 i::Isolate* isolate = i::Isolate::Current(); | 4033 i::Isolate* isolate = i::Isolate::Current(); |
4047 if (isolate == NULL || !isolate->IsInitialized()) return true; | 4034 if (isolate == NULL || !isolate->IsInitialized()) return true; |
4048 return i::V8::IdleNotification(); | 4035 return i::V8::IdleNotification(); |
4049 } | 4036 } |
4050 | 4037 |
4051 | 4038 |
4052 void v8::V8::LowMemoryNotification() { | 4039 void v8::V8::LowMemoryNotification() { |
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6134 | 6121 |
6135 | 6122 |
6136 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6123 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6137 HandleScopeImplementer* scope_implementer = | 6124 HandleScopeImplementer* scope_implementer = |
6138 reinterpret_cast<HandleScopeImplementer*>(storage); | 6125 reinterpret_cast<HandleScopeImplementer*>(storage); |
6139 scope_implementer->IterateThis(v); | 6126 scope_implementer->IterateThis(v); |
6140 return storage + ArchiveSpacePerThread(); | 6127 return storage + ArchiveSpacePerThread(); |
6141 } | 6128 } |
6142 | 6129 |
6143 } } // namespace v8::internal | 6130 } } // namespace v8::internal |
OLD | NEW |