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

Side by Side Diff: src/array.js

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 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 // Pull out the length so that modifications to the length in the 1146 // Pull out the length so that modifications to the length in the
1147 // loop will not affect the looping and side effects are visible. 1147 // loop will not affect the looping and side effects are visible.
1148 var array = ToObject(this); 1148 var array = ToObject(this);
1149 var length = ToUint32(array.length); 1149 var length = ToUint32(array.length);
1150 1150
1151 if (!IS_SPEC_FUNCTION(f)) { 1151 if (!IS_SPEC_FUNCTION(f)) {
1152 throw MakeTypeError('called_non_callable', [ f ]); 1152 throw MakeTypeError('called_non_callable', [ f ]);
1153 } 1153 }
1154 if (IS_NULL_OR_UNDEFINED(receiver)) { 1154 if (IS_NULL_OR_UNDEFINED(receiver)) {
1155 receiver = %GetDefaultReceiver(f) || receiver; 1155 receiver = %GetDefaultReceiver(f) || receiver;
1156 } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { 1156 } else if (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)) {
1157 receiver = ToObject(receiver); 1157 receiver = ToObject(receiver);
1158 } 1158 }
1159 1159
1160 var result = new $Array(); 1160 var result = new $Array();
1161 var accumulator = new InternalArray(); 1161 var accumulator = new InternalArray();
1162 var accumulator_length = 0; 1162 var accumulator_length = 0;
1163 if (%DebugCallbackSupportsStepping(f)) { 1163 if (%DebugCallbackSupportsStepping(f)) {
1164 for (var i = 0; i < length; i++) { 1164 for (var i = 0; i < length; i++) {
1165 if (i in array) { 1165 if (i in array) {
1166 var element = array[i]; 1166 var element = array[i];
(...skipping 27 matching lines...) Expand all
1194 // Pull out the length so that modifications to the length in the 1194 // Pull out the length so that modifications to the length in the
1195 // loop will not affect the looping and side effects are visible. 1195 // loop will not affect the looping and side effects are visible.
1196 var array = ToObject(this); 1196 var array = ToObject(this);
1197 var length = TO_UINT32(array.length); 1197 var length = TO_UINT32(array.length);
1198 1198
1199 if (!IS_SPEC_FUNCTION(f)) { 1199 if (!IS_SPEC_FUNCTION(f)) {
1200 throw MakeTypeError('called_non_callable', [ f ]); 1200 throw MakeTypeError('called_non_callable', [ f ]);
1201 } 1201 }
1202 if (IS_NULL_OR_UNDEFINED(receiver)) { 1202 if (IS_NULL_OR_UNDEFINED(receiver)) {
1203 receiver = %GetDefaultReceiver(f) || receiver; 1203 receiver = %GetDefaultReceiver(f) || receiver;
1204 } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { 1204 } else if (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)) {
1205 receiver = ToObject(receiver); 1205 receiver = ToObject(receiver);
1206 } 1206 }
1207 1207
1208 if (%DebugCallbackSupportsStepping(f)) { 1208 if (%DebugCallbackSupportsStepping(f)) {
1209 for (var i = 0; i < length; i++) { 1209 for (var i = 0; i < length; i++) {
1210 if (i in array) { 1210 if (i in array) {
1211 var element = array[i]; 1211 var element = array[i];
1212 // Prepare break slots for debugger step in. 1212 // Prepare break slots for debugger step in.
1213 %DebugPrepareStepInIfStepping(f); 1213 %DebugPrepareStepInIfStepping(f);
1214 %_CallFunction(receiver, element, i, array, f); 1214 %_CallFunction(receiver, element, i, array, f);
(...skipping 20 matching lines...) Expand all
1235 // Pull out the length so that modifications to the length in the 1235 // Pull out the length so that modifications to the length in the
1236 // loop will not affect the looping and side effects are visible. 1236 // loop will not affect the looping and side effects are visible.
1237 var array = ToObject(this); 1237 var array = ToObject(this);
1238 var length = TO_UINT32(array.length); 1238 var length = TO_UINT32(array.length);
1239 1239
1240 if (!IS_SPEC_FUNCTION(f)) { 1240 if (!IS_SPEC_FUNCTION(f)) {
1241 throw MakeTypeError('called_non_callable', [ f ]); 1241 throw MakeTypeError('called_non_callable', [ f ]);
1242 } 1242 }
1243 if (IS_NULL_OR_UNDEFINED(receiver)) { 1243 if (IS_NULL_OR_UNDEFINED(receiver)) {
1244 receiver = %GetDefaultReceiver(f) || receiver; 1244 receiver = %GetDefaultReceiver(f) || receiver;
1245 } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { 1245 } else if (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)) {
1246 receiver = ToObject(receiver); 1246 receiver = ToObject(receiver);
1247 } 1247 }
1248 1248
1249 if (%DebugCallbackSupportsStepping(f)) { 1249 if (%DebugCallbackSupportsStepping(f)) {
1250 for (var i = 0; i < length; i++) { 1250 for (var i = 0; i < length; i++) {
1251 if (i in array) { 1251 if (i in array) {
1252 var element = array[i]; 1252 var element = array[i];
1253 // Prepare break slots for debugger step in. 1253 // Prepare break slots for debugger step in.
1254 %DebugPrepareStepInIfStepping(f); 1254 %DebugPrepareStepInIfStepping(f);
1255 if (%_CallFunction(receiver, element, i, array, f)) return true; 1255 if (%_CallFunction(receiver, element, i, array, f)) return true;
(...skipping 19 matching lines...) Expand all
1275 // Pull out the length so that modifications to the length in the 1275 // Pull out the length so that modifications to the length in the
1276 // loop will not affect the looping and side effects are visible. 1276 // loop will not affect the looping and side effects are visible.
1277 var array = ToObject(this); 1277 var array = ToObject(this);
1278 var length = TO_UINT32(array.length); 1278 var length = TO_UINT32(array.length);
1279 1279
1280 if (!IS_SPEC_FUNCTION(f)) { 1280 if (!IS_SPEC_FUNCTION(f)) {
1281 throw MakeTypeError('called_non_callable', [ f ]); 1281 throw MakeTypeError('called_non_callable', [ f ]);
1282 } 1282 }
1283 if (IS_NULL_OR_UNDEFINED(receiver)) { 1283 if (IS_NULL_OR_UNDEFINED(receiver)) {
1284 receiver = %GetDefaultReceiver(f) || receiver; 1284 receiver = %GetDefaultReceiver(f) || receiver;
1285 } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { 1285 } else if (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)) {
1286 receiver = ToObject(receiver); 1286 receiver = ToObject(receiver);
1287 } 1287 }
1288 1288
1289 if (%DebugCallbackSupportsStepping(f)) { 1289 if (%DebugCallbackSupportsStepping(f)) {
1290 for (var i = 0; i < length; i++) { 1290 for (var i = 0; i < length; i++) {
1291 if (i in array) { 1291 if (i in array) {
1292 var element = array[i]; 1292 var element = array[i];
1293 // Prepare break slots for debugger step in. 1293 // Prepare break slots for debugger step in.
1294 %DebugPrepareStepInIfStepping(f); 1294 %DebugPrepareStepInIfStepping(f);
1295 if (!%_CallFunction(receiver, element, i, array, f)) return false; 1295 if (!%_CallFunction(receiver, element, i, array, f)) return false;
(...skipping 18 matching lines...) Expand all
1314 // Pull out the length so that modifications to the length in the 1314 // Pull out the length so that modifications to the length in the
1315 // loop will not affect the looping and side effects are visible. 1315 // loop will not affect the looping and side effects are visible.
1316 var array = ToObject(this); 1316 var array = ToObject(this);
1317 var length = TO_UINT32(array.length); 1317 var length = TO_UINT32(array.length);
1318 1318
1319 if (!IS_SPEC_FUNCTION(f)) { 1319 if (!IS_SPEC_FUNCTION(f)) {
1320 throw MakeTypeError('called_non_callable', [ f ]); 1320 throw MakeTypeError('called_non_callable', [ f ]);
1321 } 1321 }
1322 if (IS_NULL_OR_UNDEFINED(receiver)) { 1322 if (IS_NULL_OR_UNDEFINED(receiver)) {
1323 receiver = %GetDefaultReceiver(f) || receiver; 1323 receiver = %GetDefaultReceiver(f) || receiver;
1324 } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { 1324 } else if (!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)) {
1325 receiver = ToObject(receiver); 1325 receiver = ToObject(receiver);
1326 } 1326 }
1327 1327
1328 var result = new $Array(); 1328 var result = new $Array();
1329 var accumulator = new InternalArray(length); 1329 var accumulator = new InternalArray(length);
1330 if (%DebugCallbackSupportsStepping(f)) { 1330 if (%DebugCallbackSupportsStepping(f)) {
1331 for (var i = 0; i < length; i++) { 1331 for (var i = 0; i < length; i++) {
1332 if (i in array) { 1332 if (i in array) {
1333 var element = array[i]; 1333 var element = array[i];
1334 // Prepare break slots for debugger step in. 1334 // Prepare break slots for debugger step in.
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 )); 1635 ));
1636 1636
1637 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( 1637 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array(
1638 "join", getFunction("join", ArrayJoin), 1638 "join", getFunction("join", ArrayJoin),
1639 "pop", getFunction("pop", ArrayPop), 1639 "pop", getFunction("pop", ArrayPop),
1640 "push", getFunction("push", ArrayPush) 1640 "push", getFunction("push", ArrayPush)
1641 )); 1641 ));
1642 } 1642 }
1643 1643
1644 SetUpArray(); 1644 SetUpArray();
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.h » ('j') | src/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698