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

Side by Side Diff: src/runtime.cc

Issue 15777007: Re-land: Implement ObservedArrayPop, ObservedArrayShift, ObservedArrayUnshift & ObservedArraySplice (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/array.js ('k') | test/mjsunit/harmony/object-observe.js » ('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 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 13342 matching lines...) Expand 10 before | Expand all | Expand 10 after
13353 ASSERT(args.length() == 2); 13353 ASSERT(args.length() == 2);
13354 CONVERT_ARG_CHECKED(JSObject, obj1, 0); 13354 CONVERT_ARG_CHECKED(JSObject, obj1, 0);
13355 CONVERT_ARG_CHECKED(JSObject, obj2, 1); 13355 CONVERT_ARG_CHECKED(JSObject, obj2, 1);
13356 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); 13356 return isolate->heap()->ToBoolean(obj1->map() == obj2->map());
13357 } 13357 }
13358 13358
13359 13359
13360 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) { 13360 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) {
13361 NoHandleAllocation ha(isolate); 13361 NoHandleAllocation ha(isolate);
13362 ASSERT(args.length() == 1); 13362 ASSERT(args.length() == 1);
13363 CONVERT_ARG_CHECKED(JSReceiver, obj, 0); 13363
13364 if (!args[0]->IsJSReceiver()) return isolate->heap()->false_value();
13365 JSReceiver* obj = JSReceiver::cast(args[0]);
13364 if (obj->IsJSGlobalProxy()) { 13366 if (obj->IsJSGlobalProxy()) {
13365 Object* proto = obj->GetPrototype(); 13367 Object* proto = obj->GetPrototype();
13366 if (proto->IsNull()) return isolate->heap()->false_value(); 13368 if (proto->IsNull()) return isolate->heap()->false_value();
13367 ASSERT(proto->IsJSGlobalObject()); 13369 ASSERT(proto->IsJSGlobalObject());
13368 obj = JSReceiver::cast(proto); 13370 obj = JSReceiver::cast(proto);
13369 } 13371 }
13370 return isolate->heap()->ToBoolean(obj->map()->is_observed()); 13372 return isolate->heap()->ToBoolean(obj->map()->is_observed());
13371 } 13373 }
13372 13374
13373 13375
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
13522 // Handle last resort GC and make sure to allow future allocations 13524 // Handle last resort GC and make sure to allow future allocations
13523 // to grow the heap without causing GCs (if possible). 13525 // to grow the heap without causing GCs (if possible).
13524 isolate->counters()->gc_last_resort_from_js()->Increment(); 13526 isolate->counters()->gc_last_resort_from_js()->Increment();
13525 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13527 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13526 "Runtime::PerformGC"); 13528 "Runtime::PerformGC");
13527 } 13529 }
13528 } 13530 }
13529 13531
13530 13532
13531 } } // namespace v8::internal 13533 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/array.js ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698