OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // generate an index for each native JS file. | 48 // generate an index for each native JS file. |
49 class SourceCodeCache BASE_EMBEDDED { | 49 class SourceCodeCache BASE_EMBEDDED { |
50 public: | 50 public: |
51 explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { } | 51 explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { } |
52 | 52 |
53 void Initialize(bool create_heap_objects) { | 53 void Initialize(bool create_heap_objects) { |
54 cache_ = create_heap_objects ? Heap::empty_fixed_array() : NULL; | 54 cache_ = create_heap_objects ? Heap::empty_fixed_array() : NULL; |
55 } | 55 } |
56 | 56 |
57 void Iterate(ObjectVisitor* v) { | 57 void Iterate(ObjectVisitor* v) { |
58 v->VisitPointer(bit_cast<Object**, FixedArray**>(&cache_)); | 58 v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_)); |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 bool Lookup(Vector<const char> name, Handle<JSFunction>* handle) { | 62 bool Lookup(Vector<const char> name, Handle<JSFunction>* handle) { |
63 for (int i = 0; i < cache_->length(); i+=2) { | 63 for (int i = 0; i < cache_->length(); i+=2) { |
64 SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i)); | 64 SeqAsciiString* str = SeqAsciiString::cast(cache_->get(i)); |
65 if (str->IsEqualTo(name)) { | 65 if (str->IsEqualTo(name)) { |
66 *handle = Handle<JSFunction>(JSFunction::cast(cache_->get(i + 1))); | 66 *handle = Handle<JSFunction>(JSFunction::cast(cache_->get(i + 1))); |
67 return true; | 67 return true; |
68 } | 68 } |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 } | 1523 } |
1524 | 1524 |
1525 | 1525 |
1526 // Restore statics that are thread local. | 1526 // Restore statics that are thread local. |
1527 char* Genesis::RestoreState(char* from) { | 1527 char* Genesis::RestoreState(char* from) { |
1528 current_ = *reinterpret_cast<Genesis**>(from); | 1528 current_ = *reinterpret_cast<Genesis**>(from); |
1529 return from + sizeof(current_); | 1529 return from + sizeof(current_); |
1530 } | 1530 } |
1531 | 1531 |
1532 } } // namespace v8::internal | 1532 } } // namespace v8::internal |
OLD | NEW |