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

Side by Side Diff: src/runtime.cc

Issue 7314003: Implement Object.defineProperty for proxies. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 Object* obj = args[0]; 621 Object* obj = args[0];
622 if (!obj->IsJSObject()) return isolate->heap()->null_value(); 622 if (!obj->IsJSObject()) return isolate->heap()->null_value();
623 return JSObject::cast(obj)->class_name(); 623 return JSObject::cast(obj)->class_name();
624 } 624 }
625 625
626 626
627 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) { 627 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) {
628 NoHandleAllocation ha; 628 NoHandleAllocation ha;
629 ASSERT(args.length() == 1); 629 ASSERT(args.length() == 1);
630 Object* obj = args[0]; 630 Object* obj = args[0];
631 obj = obj->GetPrototype(); 631 do {
632 while (obj->IsJSObject() &&
633 JSObject::cast(obj)->map()->is_hidden_prototype()) {
634 obj = obj->GetPrototype(); 632 obj = obj->GetPrototype();
635 } 633 } while (obj->IsJSObject() &&
634 JSObject::cast(obj)->map()->is_hidden_prototype());
636 return obj; 635 return obj;
637 } 636 }
638 637
639 638
640 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) { 639 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) {
641 NoHandleAllocation ha; 640 NoHandleAllocation ha;
642 ASSERT(args.length() == 2); 641 ASSERT(args.length() == 2);
643 // See ECMA-262, section 15.3.5.3, page 88 (steps 5 - 8). 642 // See ECMA-262, section 15.3.5.3, page 88 (steps 5 - 8).
644 Object* O = args[0]; 643 Object* O = args[0];
645 Object* V = args[1]; 644 Object* V = args[1];
(...skipping 11901 matching lines...) Expand 10 before | Expand all | Expand 10 after
12547 } else { 12546 } else {
12548 // Handle last resort GC and make sure to allow future allocations 12547 // Handle last resort GC and make sure to allow future allocations
12549 // to grow the heap without causing GCs (if possible). 12548 // to grow the heap without causing GCs (if possible).
12550 isolate->counters()->gc_last_resort_from_js()->Increment(); 12549 isolate->counters()->gc_last_resort_from_js()->Increment();
12551 isolate->heap()->CollectAllGarbage(false); 12550 isolate->heap()->CollectAllGarbage(false);
12552 } 12551 }
12553 } 12552 }
12554 12553
12555 12554
12556 } } // namespace v8::internal 12555 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698