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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 // Determine if a local variable with the given name exists in a | 345 // Determine if a local variable with the given name exists in a |
346 // context. Do not consider context extension objects. This is | 346 // context. Do not consider context extension objects. This is |
347 // used for compiling code using eval. If the context surrounding | 347 // used for compiling code using eval. If the context surrounding |
348 // the eval call does not have a local variable with this name and | 348 // the eval call does not have a local variable with this name and |
349 // does not contain a with statement the property is global unless | 349 // does not contain a with statement the property is global unless |
350 // it is shadowed by a property in an extension object introduced by | 350 // it is shadowed by a property in an extension object introduced by |
351 // eval. | 351 // eval. |
352 bool GlobalIfNotShadowedByEval(Handle<String> name); | 352 bool GlobalIfNotShadowedByEval(Handle<String> name); |
353 | 353 |
| 354 // Determine if any function scope in the context call eval and if |
| 355 // any of those calls are in non-strict mode. |
| 356 void ComputeEvalScopeInfo(bool* outer_scope_calls_eval, |
| 357 bool* outer_scope_calls_non_strict_eval); |
| 358 |
354 // Code generation support. | 359 // Code generation support. |
355 static int SlotOffset(int index) { | 360 static int SlotOffset(int index) { |
356 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 361 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
357 } | 362 } |
358 | 363 |
359 static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize; | 364 static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize; |
360 | 365 |
361 // GC support. | 366 // GC support. |
362 typedef FixedBodyDescriptor< | 367 typedef FixedBodyDescriptor< |
363 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; | 368 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; |
(...skipping 11 matching lines...) Expand all Loading... |
375 #ifdef DEBUG | 380 #ifdef DEBUG |
376 // Bootstrapping-aware type checks. | 381 // Bootstrapping-aware type checks. |
377 static bool IsBootstrappingOrContext(Object* object); | 382 static bool IsBootstrappingOrContext(Object* object); |
378 static bool IsBootstrappingOrGlobalObject(Object* object); | 383 static bool IsBootstrappingOrGlobalObject(Object* object); |
379 #endif | 384 #endif |
380 }; | 385 }; |
381 | 386 |
382 } } // namespace v8::internal | 387 } } // namespace v8::internal |
383 | 388 |
384 #endif // V8_CONTEXTS_H_ | 389 #endif // V8_CONTEXTS_H_ |
OLD | NEW |