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

Side by Side Diff: src/ast.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
« no previous file with comments | « src/ast.h ('k') | src/bootstrapper.cc » ('j') | src/globals.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (m_literal->depth() + 1 > depth_acc) { 372 if (m_literal->depth() + 1 > depth_acc) {
373 depth_acc = m_literal->depth() + 1; 373 depth_acc = m_literal->depth() + 1;
374 } 374 }
375 } 375 }
376 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); 376 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
377 if (boilerplate_value->IsTheHole()) { 377 if (boilerplate_value->IsTheHole()) {
378 is_holey = true; 378 is_holey = true;
379 } else if (boilerplate_value->IsUninitialized()) { 379 } else if (boilerplate_value->IsUninitialized()) {
380 is_simple = false; 380 is_simple = false;
381 JSObject::SetOwnElement( 381 JSObject::SetOwnElement(
382 array, i, handle(Smi::FromInt(0), isolate), kNonStrictMode); 382 array, i, handle(Smi::FromInt(0), isolate), kSloppyMode);
383 } else { 383 } else {
384 JSObject::SetOwnElement(array, i, boilerplate_value, kNonStrictMode); 384 JSObject::SetOwnElement(array, i, boilerplate_value, kSloppyMode);
385 } 385 }
386 } 386 }
387 387
388 Handle<FixedArrayBase> element_values(array->elements()); 388 Handle<FixedArrayBase> element_values(array->elements());
389 389
390 // Simple and shallow arrays can be lazily copied, we transform the 390 // Simple and shallow arrays can be lazily copied, we transform the
391 // elements array to a copy-on-write array. 391 // elements array to a copy-on-write array.
392 if (is_simple && depth_acc == 1 && values()->length() > 0 && 392 if (is_simple && depth_acc == 1 && values()->length() > 0 &&
393 array->HasFastSmiOrObjectElements()) { 393 array->HasFastSmiOrObjectElements()) {
394 element_values->set_map(isolate->heap()->fixed_cow_array_map()); 394 element_values->set_map(isolate->heap()->fixed_cow_array_map());
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1173 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1174 str = arr; 1174 str = arr;
1175 } else { 1175 } else {
1176 str = DoubleToCString(value_->Number(), buffer); 1176 str = DoubleToCString(value_->Number(), buffer);
1177 } 1177 }
1178 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); 1178 return isolate_->factory()->NewStringFromAscii(CStrVector(str));
1179 } 1179 }
1180 1180
1181 1181
1182 } } // namespace v8::internal 1182 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/bootstrapper.cc » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698