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

Side by Side Diff: src/runtime.cc

Issue 545116: Added Extensible property to objects and made methods for extracting and sett... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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/runtime.h ('k') | 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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 576
577 577
578 // Returns an array with the property description: 578 // Returns an array with the property description:
579 // if args[1] is not a property on args[0] 579 // if args[1] is not a property on args[0]
580 // returns undefined 580 // returns undefined
581 // if args[1] is a data property on args[0] 581 // if args[1] is a data property on args[0]
582 // [false, value, Writeable, Enumerable, Configurable] 582 // [false, value, Writeable, Enumerable, Configurable]
583 // if args[1] is an accessor on args[0] 583 // if args[1] is an accessor on args[0]
584 // [true, GetFunction, SetFunction, Enumerable, Configurable] 584 // [true, GetFunction, SetFunction, Enumerable, Configurable]
585 static Object* Runtime_GetOwnProperty(Arguments args) { 585 static Object* Runtime_GetOwnProperty(Arguments args) {
586 ASSERT(args.lenght() == 2);
586 HandleScope scope; 587 HandleScope scope;
587 Handle<FixedArray> elms = Factory::NewFixedArray(5); 588 Handle<FixedArray> elms = Factory::NewFixedArray(5);
588 Handle<JSArray> desc = Factory::NewJSArrayWithElements(elms); 589 Handle<JSArray> desc = Factory::NewJSArrayWithElements(elms);
589 LookupResult result; 590 LookupResult result;
590 CONVERT_CHECKED(JSObject, obj, args[0]); 591 CONVERT_CHECKED(JSObject, obj, args[0]);
591 CONVERT_CHECKED(String, name, args[1]); 592 CONVERT_CHECKED(String, name, args[1]);
592 593
593 // Use recursive implementation to also traverse hidden prototypes 594 // Use recursive implementation to also traverse hidden prototypes
594 GetOwnPropertyImplementation(obj, name, &result); 595 GetOwnPropertyImplementation(obj, name, &result);
595 596
(...skipping 23 matching lines...) Expand all
619 elms->set(1, result.GetLazyValue()); 620 elms->set(1, result.GetLazyValue());
620 elms->set(2, Heap::ToBoolean(!result.IsReadOnly())); 621 elms->set(2, Heap::ToBoolean(!result.IsReadOnly()));
621 } 622 }
622 623
623 elms->set(3, Heap::ToBoolean(!result.IsDontEnum())); 624 elms->set(3, Heap::ToBoolean(!result.IsDontEnum()));
624 elms->set(4, Heap::ToBoolean(!result.IsReadOnly())); 625 elms->set(4, Heap::ToBoolean(!result.IsReadOnly()));
625 return *desc; 626 return *desc;
626 } 627 }
627 628
628 629
630 static Object* Runtime_IsExtensible(Arguments args) {
631 ASSERT(args.length() == 1);
632 CONVERT_CHECKED(JSObject, obj, args[0]);
633 return obj->map()->is_extensible() ? Heap::true_value()
634 : Heap::false_value();
635 }
636
637
629 static Object* Runtime_RegExpCompile(Arguments args) { 638 static Object* Runtime_RegExpCompile(Arguments args) {
630 HandleScope scope; 639 HandleScope scope;
631 ASSERT(args.length() == 3); 640 ASSERT(args.length() == 3);
632 CONVERT_ARG_CHECKED(JSRegExp, re, 0); 641 CONVERT_ARG_CHECKED(JSRegExp, re, 0);
633 CONVERT_ARG_CHECKED(String, pattern, 1); 642 CONVERT_ARG_CHECKED(String, pattern, 1);
634 CONVERT_ARG_CHECKED(String, flags, 2); 643 CONVERT_ARG_CHECKED(String, flags, 2);
635 Handle<Object> result = RegExpImpl::Compile(re, pattern, flags); 644 Handle<Object> result = RegExpImpl::Compile(re, pattern, flags);
636 if (result.is_null()) return Failure::Exception(); 645 if (result.is_null()) return Failure::Exception();
637 return *result; 646 return *result;
638 } 647 }
(...skipping 7515 matching lines...) Expand 10 before | Expand all | Expand 10 after
8154 } else { 8163 } else {
8155 // Handle last resort GC and make sure to allow future allocations 8164 // Handle last resort GC and make sure to allow future allocations
8156 // to grow the heap without causing GCs (if possible). 8165 // to grow the heap without causing GCs (if possible).
8157 Counters::gc_last_resort_from_js.Increment(); 8166 Counters::gc_last_resort_from_js.Increment();
8158 Heap::CollectAllGarbage(false); 8167 Heap::CollectAllGarbage(false);
8159 } 8168 }
8160 } 8169 }
8161 8170
8162 8171
8163 } } // namespace v8::internal 8172 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698