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

Side by Side Diff: src/scopeinfo.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
OLDNEW
1 // Copyright 2006-2008 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
11 // with the distribution. 11 // with the distribution.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // -------------------------------------------------------------------------- 86 // --------------------------------------------------------------------------
87 // Debugging support 87 // Debugging support
88 88
89 #ifdef DEBUG 89 #ifdef DEBUG
90 void Print(); 90 void Print();
91 #endif 91 #endif
92 92
93 private: 93 private:
94 Handle<String> function_name_; 94 Handle<String> function_name_;
95 bool calls_eval_; 95 bool calls_eval_;
96 bool is_strict_mode_;
96 List<Handle<String>, Allocator > parameters_; 97 List<Handle<String>, Allocator > parameters_;
97 List<Handle<String>, Allocator > stack_slots_; 98 List<Handle<String>, Allocator > stack_slots_;
98 List<Handle<String>, Allocator > context_slots_; 99 List<Handle<String>, Allocator > context_slots_;
99 List<Variable::Mode, Allocator > context_modes_; 100 List<Variable::Mode, Allocator > context_modes_;
100 }; 101 };
101 102
102 103
103 // This object provides quick access to scope info details for runtime 104 // This object provides quick access to scope info details for runtime
104 // routines w/o the need to explicitly create a ScopeInfo object. 105 // routines w/o the need to explicitly create a ScopeInfo object.
105 class SerializedScopeInfo : public FixedArray { 106 class SerializedScopeInfo : public FixedArray {
106 public : 107 public :
107 108
108 static SerializedScopeInfo* cast(Object* object) { 109 static SerializedScopeInfo* cast(Object* object) {
109 ASSERT(object->IsFixedArray()); 110 ASSERT(object->IsFixedArray());
110 return reinterpret_cast<SerializedScopeInfo*>(object); 111 return reinterpret_cast<SerializedScopeInfo*>(object);
111 } 112 }
112 113
113 // Does this scope call eval? 114 // Does this scope call eval?
114 bool CallsEval(); 115 bool CallsEval();
115 116
117 // Is this scope a strict mode scope?
118 bool IsStrictMode();
119
116 // Does this scope have an arguments shadow? 120 // Does this scope have an arguments shadow?
117 bool HasArgumentsShadow() { 121 bool HasArgumentsShadow() {
118 return StackSlotIndex(GetHeap()->arguments_shadow_symbol()) >= 0; 122 return StackSlotIndex(GetHeap()->arguments_shadow_symbol()) >= 0;
119 } 123 }
120 124
121 // Return the number of stack slots for code. 125 // Return the number of stack slots for code.
122 int NumberOfStackSlots(); 126 int NumberOfStackSlots();
123 127
124 // Return the number of context slots for code. 128 // Return the number of context slots for code.
125 int NumberOfContextSlots(); 129 int NumberOfContextSlots();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 uint32_t values_[kLength]; 245 uint32_t values_[kLength];
242 246
243 friend class Isolate; 247 friend class Isolate;
244 DISALLOW_COPY_AND_ASSIGN(ContextSlotCache); 248 DISALLOW_COPY_AND_ASSIGN(ContextSlotCache);
245 }; 249 };
246 250
247 251
248 } } // namespace v8::internal 252 } } // namespace v8::internal
249 253
250 #endif // V8_SCOPEINFO_H_ 254 #endif // V8_SCOPEINFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698