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

Side by Side Diff: src/builtins.cc

Issue 2870018: Add "has fast elements" bit to maps and use it in inlined keyed loads. (Closed)
Patch Set: More ARM fixes. Created 10 years, 6 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
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } else { 188 } else {
189 // Allocate the JS Array 189 // Allocate the JS Array
190 JSFunction* constructor = 190 JSFunction* constructor =
191 Top::context()->global_context()->array_function(); 191 Top::context()->global_context()->array_function();
192 Object* obj = Heap::AllocateJSObject(constructor); 192 Object* obj = Heap::AllocateJSObject(constructor);
193 if (obj->IsFailure()) return obj; 193 if (obj->IsFailure()) return obj;
194 array = JSArray::cast(obj); 194 array = JSArray::cast(obj);
195 } 195 }
196 196
197 // 'array' now contains the JSArray we should initialize. 197 // 'array' now contains the JSArray we should initialize.
198 ASSERT(array->HasFastElements());
198 199
199 // Optimize the case where there is one argument and the argument is a 200 // Optimize the case where there is one argument and the argument is a
200 // small smi. 201 // small smi.
201 if (args.length() == 2) { 202 if (args.length() == 2) {
202 Object* obj = args[1]; 203 Object* obj = args[1];
203 if (obj->IsSmi()) { 204 if (obj->IsSmi()) {
204 int len = Smi::cast(obj)->value(); 205 int len = Smi::cast(obj)->value();
205 if (len >= 0 && len < JSObject::kInitialMaxFastElementArray) { 206 if (len >= 0 && len < JSObject::kInitialMaxFastElementArray) {
206 Object* obj = Heap::AllocateFixedArrayWithHoles(len); 207 Object* obj = Heap::AllocateFixedArrayWithHoles(len);
207 if (obj->IsFailure()) return obj; 208 if (obj->IsFailure()) return obj;
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 if (entry->contains(pc)) { 1515 if (entry->contains(pc)) {
1515 return names_[i]; 1516 return names_[i];
1516 } 1517 }
1517 } 1518 }
1518 } 1519 }
1519 return NULL; 1520 return NULL;
1520 } 1521 }
1521 1522
1522 1523
1523 } } // namespace v8::internal 1524 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698