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

Side by Side Diff: src/scopeinfo.cc

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 return ScopeTypeField::decode(Flags()); 158 return ScopeTypeField::decode(Flags());
159 } 159 }
160 160
161 161
162 bool ScopeInfo::CallsEval() { 162 bool ScopeInfo::CallsEval() {
163 return length() > 0 && CallsEvalField::decode(Flags()); 163 return length() > 0 && CallsEvalField::decode(Flags());
164 } 164 }
165 165
166 166
167 LanguageMode ScopeInfo::language_mode() { 167 LanguageMode ScopeInfo::language_mode() {
168 return length() > 0 ? LanguageModeField::decode(Flags()) : CLASSIC_MODE; 168 return length() > 0 ? LanguageModeField::decode(Flags()) : SLOPPY_MODE;
169 } 169 }
170 170
171 171
172 int ScopeInfo::LocalCount() { 172 int ScopeInfo::LocalCount() {
173 return StackLocalCount() + ContextLocalCount(); 173 return StackLocalCount() + ContextLocalCount();
174 } 174 }
175 175
176 176
177 int ScopeInfo::StackSlotCount() { 177 int ScopeInfo::StackSlotCount() {
178 if (length() > 0) { 178 if (length() > 0) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 int start = scope_info->ContextLocalNameEntriesIndex(); 371 int start = scope_info->ContextLocalNameEntriesIndex();
372 int end = start + local_count; 372 int end = start + local_count;
373 for (int i = start; i < end; ++i) { 373 for (int i = start; i < end; ++i) {
374 int context_index = Context::MIN_CONTEXT_SLOTS + i - start; 374 int context_index = Context::MIN_CONTEXT_SLOTS + i - start;
375 Handle<Object> result = Runtime::SetObjectProperty( 375 Handle<Object> result = Runtime::SetObjectProperty(
376 isolate, 376 isolate,
377 scope_object, 377 scope_object,
378 Handle<String>(String::cast(scope_info->get(i))), 378 Handle<String>(String::cast(scope_info->get(i))),
379 Handle<Object>(context->get(context_index), isolate), 379 Handle<Object>(context->get(context_index), isolate),
380 ::NONE, 380 ::NONE,
381 kNonStrictMode); 381 kSloppyMode);
382 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, false); 382 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, false);
383 } 383 }
384 return true; 384 return true;
385 } 385 }
386 386
387 387
388 int ScopeInfo::ParameterEntriesIndex() { 388 int ScopeInfo::ParameterEntriesIndex() {
389 ASSERT(length() > 0); 389 ASSERT(length() > 0);
390 return kVariablePartIndex; 390 return kVariablePartIndex;
391 } 391 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } else { 552 } else {
553 ASSERT(var->index() >= 0); 553 ASSERT(var->index() >= 0);
554 info->set_index(i, var->index()); 554 info->set_index(i, var->index());
555 } 555 }
556 } 556 }
557 ASSERT(i == info->length()); 557 ASSERT(i == info->length());
558 return info; 558 return info;
559 } 559 }
560 560
561 } } // namespace v8::internal 561 } } // namespace v8::internal
OLDNEW
« src/preparser.h ('K') | « src/runtime.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698