Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: src/contexts.h

Issue 6993008: Allow closures to be optimized if outer contexts that call eval are all in strict mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | src/contexts.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698