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 4940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4951 } | 4951 } |
4952 | 4952 |
4953 | 4953 |
4954 // Reserve space for statics needing saving and restoring. | 4954 // Reserve space for statics needing saving and restoring. |
4955 int Relocatable::ArchiveSpacePerThread() { | 4955 int Relocatable::ArchiveSpacePerThread() { |
4956 return sizeof(Isolate::Current()->relocatable_top()); | 4956 return sizeof(Isolate::Current()->relocatable_top()); |
4957 } | 4957 } |
4958 | 4958 |
4959 | 4959 |
4960 // Archive statics that are thread local. | 4960 // Archive statics that are thread local. |
4961 char* Relocatable::ArchiveState(Isolate* isolate, char* to) { | 4961 char* Relocatable::ArchiveState(char* to) { |
| 4962 Isolate* isolate = Isolate::Current(); |
4962 *reinterpret_cast<Relocatable**>(to) = isolate->relocatable_top(); | 4963 *reinterpret_cast<Relocatable**>(to) = isolate->relocatable_top(); |
4963 isolate->set_relocatable_top(NULL); | 4964 isolate->set_relocatable_top(NULL); |
4964 return to + ArchiveSpacePerThread(); | 4965 return to + ArchiveSpacePerThread(); |
4965 } | 4966 } |
4966 | 4967 |
4967 | 4968 |
4968 // Restore statics that are thread local. | 4969 // Restore statics that are thread local. |
4969 char* Relocatable::RestoreState(Isolate* isolate, char* from) { | 4970 char* Relocatable::RestoreState(char* from) { |
| 4971 Isolate* isolate = Isolate::Current(); |
4970 isolate->set_relocatable_top(*reinterpret_cast<Relocatable**>(from)); | 4972 isolate->set_relocatable_top(*reinterpret_cast<Relocatable**>(from)); |
4971 return from + ArchiveSpacePerThread(); | 4973 return from + ArchiveSpacePerThread(); |
4972 } | 4974 } |
4973 | 4975 |
4974 | 4976 |
4975 char* Relocatable::Iterate(ObjectVisitor* v, char* thread_storage) { | 4977 char* Relocatable::Iterate(ObjectVisitor* v, char* thread_storage) { |
4976 Relocatable* top = *reinterpret_cast<Relocatable**>(thread_storage); | 4978 Relocatable* top = *reinterpret_cast<Relocatable**>(thread_storage); |
4977 Iterate(v, top); | 4979 Iterate(v, top); |
4978 return thread_storage + ArchiveSpacePerThread(); | 4980 return thread_storage + ArchiveSpacePerThread(); |
4979 } | 4981 } |
(...skipping 5442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10422 if (break_point_objects()->IsUndefined()) return 0; | 10424 if (break_point_objects()->IsUndefined()) return 0; |
10423 // Single beak point. | 10425 // Single beak point. |
10424 if (!break_point_objects()->IsFixedArray()) return 1; | 10426 if (!break_point_objects()->IsFixedArray()) return 1; |
10425 // Multiple break points. | 10427 // Multiple break points. |
10426 return FixedArray::cast(break_point_objects())->length(); | 10428 return FixedArray::cast(break_point_objects())->length(); |
10427 } | 10429 } |
10428 #endif | 10430 #endif |
10429 | 10431 |
10430 | 10432 |
10431 } } // namespace v8::internal | 10433 } } // namespace v8::internal |
OLD | NEW |