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