 Chromium Code Reviews
 Chromium Code Reviews Issue 349073002:
  Remove SmartMove from array.js  (Closed) 
  Base URL: git://github.com/v8/v8.git@bleeding_edge
    
  
    Issue 349073002:
  Remove SmartMove from array.js  (Closed) 
  Base URL: git://github.com/v8/v8.git@bleeding_edge| OLD | NEW | 
|---|---|
| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 assertTrue(%HasFastSmiElements(a4)); | 288 assertTrue(%HasFastSmiElements(a4)); | 
| 289 assertEquals([1,1,2,3], a4); | 289 assertEquals([1,1,2,3], a4); | 
| 290 a4 = [1,2,3]; | 290 a4 = [1,2,3]; | 
| 291 a4.unshift(1.1); | 291 a4.unshift(1.1); | 
| 292 // TODO(verwaest): We'll want to support double unshifting as well. | 292 // TODO(verwaest): We'll want to support double unshifting as well. | 
| 293 // assertTrue(%HasFastDoubleElements(a4)); | 293 // assertTrue(%HasFastDoubleElements(a4)); | 
| 294 assertTrue(%HasFastObjectElements(a4)); | 294 assertTrue(%HasFastObjectElements(a4)); | 
| 295 assertEquals([1.1,1,2,3], a4); | 295 assertEquals([1.1,1,2,3], a4); | 
| 296 a4 = [1.1,2,3]; | 296 a4 = [1.1,2,3]; | 
| 297 a4.unshift(1); | 297 a4.unshift(1); | 
| 298 // assertTrue(%HasFastDoubleElements(a4)); | 298 assertTrue(%HasFastDoubleElements(a4)); | 
| 
rafaelw
2014/06/22 23:59:19
It looks like this is actually the preferred backi
 | |
| 299 assertTrue(%HasFastObjectElements(a4)); | |
| 300 assertEquals([1,1.1,2,3], a4); | 299 assertEquals([1,1.1,2,3], a4); | 
| 301 a4 = [{},2,3]; | 300 a4 = [{},2,3]; | 
| 302 a4.unshift(1); | 301 a4.unshift(1); | 
| 303 assertTrue(%HasFastObjectElements(a4)); | 302 assertTrue(%HasFastObjectElements(a4)); | 
| 304 assertEquals([1,{},2,3], a4); | 303 assertEquals([1,{},2,3], a4); | 
| 305 a4 = [{},2,3]; | 304 a4 = [{},2,3]; | 
| 306 a4.unshift(1.1); | 305 a4.unshift(1.1); | 
| 307 assertTrue(%HasFastObjectElements(a4)); | 306 assertTrue(%HasFastObjectElements(a4)); | 
| 308 assertEquals([1.1,{},2,3], a4); | 307 assertEquals([1.1,{},2,3], a4); | 
| 309 } | 308 } | 
| 310 | 309 | 
| 311 if (support_smi_only_arrays) { | 310 if (support_smi_only_arrays) { | 
| 312 for (var i = 0; i < 3; i++) { | 311 for (var i = 0; i < 3; i++) { | 
| 313 array_natives_test(); | 312 array_natives_test(); | 
| 314 } | 313 } | 
| 315 %OptimizeFunctionOnNextCall(array_natives_test); | 314 %OptimizeFunctionOnNextCall(array_natives_test); | 
| 316 array_natives_test(); | 315 array_natives_test(); | 
| 317 } | 316 } | 
| OLD | NEW |