| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 while (p != end) { | 442 while (p != end) { |
| 443 if (*p == name) return static_cast<int>(p - p0); | 443 if (*p == name) return static_cast<int>(p - p0); |
| 444 p++; | 444 p++; |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 return -1; | 447 return -1; |
| 448 } | 448 } |
| 449 | 449 |
| 450 int SerializedScopeInfo::ContextSlotIndex(String* name, Variable::Mode* mode) { | 450 int SerializedScopeInfo::ContextSlotIndex(String* name, Variable::Mode* mode) { |
| 451 ASSERT(name->IsSymbol()); | 451 ASSERT(name->IsSymbol()); |
| 452 Isolate* isolate = Isolate::Current(); | 452 Isolate* isolate = GetIsolate(); |
| 453 int result = isolate->context_slot_cache()->Lookup(this, name, mode); | 453 int result = isolate->context_slot_cache()->Lookup(this, name, mode); |
| 454 if (result != ContextSlotCache::kNotFound) return result; | 454 if (result != ContextSlotCache::kNotFound) return result; |
| 455 if (length() > 0) { | 455 if (length() > 0) { |
| 456 // Slots start after length entry. | 456 // Slots start after length entry. |
| 457 Object** p0 = ContextEntriesAddr(); | 457 Object** p0 = ContextEntriesAddr(); |
| 458 int number_of_context_slots; | 458 int number_of_context_slots; |
| 459 p0 = ReadInt(p0, &number_of_context_slots); | 459 p0 = ReadInt(p0, &number_of_context_slots); |
| 460 Object** p = p0; | 460 Object** p = p0; |
| 461 Object** end = p0 + number_of_context_slots * 2; | 461 Object** end = p0 + number_of_context_slots * 2; |
| 462 while (p != end) { | 462 while (p != end) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 #endif // DEBUG | 624 #endif // DEBUG |
| 625 | 625 |
| 626 | 626 |
| 627 // Make sure the classes get instantiated by the template system. | 627 // Make sure the classes get instantiated by the template system. |
| 628 template class ScopeInfo<FreeStoreAllocationPolicy>; | 628 template class ScopeInfo<FreeStoreAllocationPolicy>; |
| 629 template class ScopeInfo<PreallocatedStorage>; | 629 template class ScopeInfo<PreallocatedStorage>; |
| 630 template class ScopeInfo<ZoneListAllocationPolicy>; | 630 template class ScopeInfo<ZoneListAllocationPolicy>; |
| 631 | 631 |
| 632 } } // namespace v8::internal | 632 } } // namespace v8::internal |
| OLD | NEW |