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

Side by Side Diff: src/builtins.cc

Issue 3043060: [Isolates] Replace ISOLATE_FROM_HEAP with Heap::isolate() (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 | src/isolate.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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Set length and elements on the array. 238 // Set length and elements on the array.
239 array->set_elements(FixedArray::cast(obj)); 239 array->set_elements(FixedArray::cast(obj));
240 array->set_length(len); 240 array->set_length(len);
241 241
242 return array; 242 return array;
243 } 243 }
244 244
245 245
246 static Object* AllocateJSArray(Heap* heap) { 246 static Object* AllocateJSArray(Heap* heap) {
247 JSFunction* array_function = 247 JSFunction* array_function =
248 ISOLATE_FROM_HEAP(heap)->context()->global_context()->array_function(); 248 heap->isolate()->context()->global_context()->array_function();
249 Object* result = heap->AllocateJSObject(array_function); 249 Object* result = heap->AllocateJSObject(array_function);
250 if (result->IsFailure()) return result; 250 if (result->IsFailure()) return result;
251 return result; 251 return result;
252 } 252 }
253 253
254 254
255 static Object* AllocateEmptyJSArray(Heap* heap) { 255 static Object* AllocateEmptyJSArray(Heap* heap) {
256 Object* result = AllocateJSArray(heap); 256 Object* result = AllocateJSArray(heap);
257 if (result->IsFailure()) return result; 257 if (result->IsFailure()) return result;
258 JSArray* result_array = JSArray::cast(result); 258 JSArray* result_array = JSArray::cast(result);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return true; 371 return true;
372 } 372 }
373 373
374 374
375 static bool IsFastElementMovingAllowed(Heap* heap, 375 static bool IsFastElementMovingAllowed(Heap* heap,
376 Object* receiver, 376 Object* receiver,
377 FixedArray** elements) { 377 FixedArray** elements) {
378 if (!IsJSArrayWithFastElements(heap, receiver, elements)) return false; 378 if (!IsJSArrayWithFastElements(heap, receiver, elements)) return false;
379 379
380 Context* global_context = 380 Context* global_context =
381 ISOLATE_FROM_HEAP(heap)->context()->global_context(); 381 heap->isolate()->context()->global_context();
382 JSObject* array_proto = 382 JSObject* array_proto =
383 JSObject::cast(global_context->array_function()->prototype()); 383 JSObject::cast(global_context->array_function()->prototype());
384 if (JSArray::cast(receiver)->GetPrototype() != array_proto) return false; 384 if (JSArray::cast(receiver)->GetPrototype() != array_proto) return false;
385 return ArrayPrototypeHasNoElements(heap, global_context, array_proto); 385 return ArrayPrototypeHasNoElements(heap, global_context, array_proto);
386 } 386 }
387 387
388 388
389 static Object* CallJsBuiltin(Isolate* isolate, 389 static Object* CallJsBuiltin(Isolate* isolate,
390 const char* name, 390 const char* name,
391 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) { 391 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 if (entry->contains(pc)) { 1580 if (entry->contains(pc)) {
1581 return names_[i]; 1581 return names_[i];
1582 } 1582 }
1583 } 1583 }
1584 } 1584 }
1585 return NULL; 1585 return NULL;
1586 } 1586 }
1587 1587
1588 1588
1589 } } // namespace v8::internal 1589 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698