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

Side by Side Diff: src/builtins.cc

Issue 3181013: Array builtins: add inline modifier to help gcc. (Closed)
Patch Set: Created 10 years, 4 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 | « no previous file | no next file » | 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 ASSERT(array_proto->elements() == Heap::empty_fixed_array()); 345 ASSERT(array_proto->elements() == Heap::empty_fixed_array());
346 // Object.prototype 346 // Object.prototype
347 array_proto = JSObject::cast(array_proto->GetPrototype()); 347 array_proto = JSObject::cast(array_proto->GetPrototype());
348 if (array_proto != global_context->initial_object_prototype()) return false; 348 if (array_proto != global_context->initial_object_prototype()) return false;
349 if (array_proto->elements() != Heap::empty_fixed_array()) return false; 349 if (array_proto->elements() != Heap::empty_fixed_array()) return false;
350 ASSERT(array_proto->GetPrototype()->IsNull()); 350 ASSERT(array_proto->GetPrototype()->IsNull());
351 return true; 351 return true;
352 } 352 }
353 353
354 354
355 static Object* EnsureJSArrayWithWritableFastElements(Object* receiver) { 355 static inline Object* EnsureJSArrayWithWritableFastElements(Object* receiver) {
356 if (!receiver->IsJSArray()) return NULL; 356 if (!receiver->IsJSArray()) return NULL;
357 JSArray* array = JSArray::cast(receiver); 357 JSArray* array = JSArray::cast(receiver);
358 HeapObject* elms = HeapObject::cast(array->elements()); 358 HeapObject* elms = HeapObject::cast(array->elements());
359 if (elms->map() == Heap::fixed_array_map()) return elms; 359 if (elms->map() == Heap::fixed_array_map()) return elms;
360 if (elms->map() == Heap::fixed_cow_array_map()) { 360 if (elms->map() == Heap::fixed_cow_array_map()) {
361 return array->EnsureWritableFastElements(); 361 return array->EnsureWritableFastElements();
362 } 362 }
363 return NULL; 363 return NULL;
364 } 364 }
365 365
366 366
367 static bool IsJSArrayFastElementMovingAllowed(JSArray* receiver) { 367 static inline bool IsJSArrayFastElementMovingAllowed(JSArray* receiver) {
368 Context* global_context = Top::context()->global_context(); 368 Context* global_context = Top::context()->global_context();
369 JSObject* array_proto = 369 JSObject* array_proto =
370 JSObject::cast(global_context->array_function()->prototype()); 370 JSObject::cast(global_context->array_function()->prototype());
371 return receiver->GetPrototype() == array_proto && 371 return receiver->GetPrototype() == array_proto &&
372 ArrayPrototypeHasNoElements(global_context, array_proto); 372 ArrayPrototypeHasNoElements(global_context, array_proto);
373 } 373 }
374 374
375 375
376 static Object* CallJsBuiltin(const char* name, 376 static Object* CallJsBuiltin(const char* name,
377 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) { 377 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 if (entry->contains(pc)) { 1527 if (entry->contains(pc)) {
1528 return names_[i]; 1528 return names_[i];
1529 } 1529 }
1530 } 1530 }
1531 } 1531 }
1532 return NULL; 1532 return NULL;
1533 } 1533 }
1534 1534
1535 1535
1536 } } // namespace v8::internal 1536 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698