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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (name == get(i)) { | 314 if (name == get(i)) { |
315 int var = i - start; | 315 int var = i - start; |
316 *mode = ContextLocalMode(var); | 316 *mode = ContextLocalMode(var); |
317 *init_flag = ContextLocalInitFlag(var); | 317 *init_flag = ContextLocalInitFlag(var); |
318 result = Context::MIN_CONTEXT_SLOTS + var; | 318 result = Context::MIN_CONTEXT_SLOTS + var; |
319 context_slot_cache->Update(this, name, *mode, *init_flag, result); | 319 context_slot_cache->Update(this, name, *mode, *init_flag, result); |
320 ASSERT(result < ContextLength()); | 320 ASSERT(result < ContextLength()); |
321 return result; | 321 return result; |
322 } | 322 } |
323 } | 323 } |
| 324 // Cache as not found. Mode and init flag don't matter. |
324 context_slot_cache->Update(this, name, INTERNAL, kNeedsInitialization, -1); | 325 context_slot_cache->Update(this, name, INTERNAL, kNeedsInitialization, -1); |
325 } | 326 } |
326 return -1; | 327 return -1; |
327 } | 328 } |
328 | 329 |
329 | 330 |
330 int ScopeInfo::ParameterIndex(String* name) { | 331 int ScopeInfo::ParameterIndex(String* name) { |
331 ASSERT(name->IsSymbol()); | 332 ASSERT(name->IsSymbol()); |
332 if (length() > 0) { | 333 if (length() > 0) { |
333 // We must read parameters from the end since for | 334 // We must read parameters from the end since for |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 Context::MIN_CONTEXT_SLOTS, | 499 Context::MIN_CONTEXT_SLOTS, |
499 ContextLocalNameEntriesIndex(), | 500 ContextLocalNameEntriesIndex(), |
500 ContextLocalNameEntriesIndex() + ContextLocalCount(), | 501 ContextLocalNameEntriesIndex() + ContextLocalCount(), |
501 this); | 502 this); |
502 | 503 |
503 PrintF("}\n"); | 504 PrintF("}\n"); |
504 } | 505 } |
505 #endif // DEBUG | 506 #endif // DEBUG |
506 | 507 |
507 } } // namespace v8::internal | 508 } } // namespace v8::internal |
OLD | NEW |