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

Side by Side Diff: src/runtime.cc

Issue 9424033: Removed Runtime_DefineAccessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 10 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') | src/x64/full-codegen-x64.cc » ('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 10341 matching lines...) Expand 10 before | Expand all | Expand 10 after
10352 static_cast<uint32_t>(elements->length()); 10352 static_cast<uint32_t>(elements->length());
10353 uint32_t min_length = actual_length < length ? actual_length : length; 10353 uint32_t min_length = actual_length < length ? actual_length : length;
10354 Handle<Object> length_object = 10354 Handle<Object> length_object =
10355 isolate->factory()->NewNumber(static_cast<double>(min_length)); 10355 isolate->factory()->NewNumber(static_cast<double>(min_length));
10356 single_interval->set(1, *length_object); 10356 single_interval->set(1, *length_object);
10357 return *isolate->factory()->NewJSArrayWithElements(single_interval); 10357 return *isolate->factory()->NewJSArrayWithElements(single_interval);
10358 } 10358 }
10359 } 10359 }
10360 10360
10361 10361
10362 // DefineAccessor takes an optional final argument which is the
10363 // property attributes (e.g. DONT_ENUM, DONT_DELETE). IMPORTANT: due
10364 // to the way accessors are implemented, it is set for both the getter
10365 // and setter on the first call to DefineAccessor and ignored on
10366 // subsequent calls.
10367 RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineAccessor) {
10368 RUNTIME_ASSERT(args.length() == 4 || args.length() == 5);
10369 // Compute attributes.
10370 PropertyAttributes attributes = NONE;
10371 if (args.length() == 5) {
10372 CONVERT_SMI_ARG_CHECKED(value, 4);
10373 // Only attribute bits should be set.
10374 ASSERT((value & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
10375 attributes = static_cast<PropertyAttributes>(value);
10376 }
10377
10378 CONVERT_ARG_CHECKED(JSObject, obj, 0);
10379 CONVERT_ARG_CHECKED(String, name, 1);
10380 CONVERT_SMI_ARG_CHECKED(flag, 2);
10381 CONVERT_ARG_CHECKED(JSFunction, fun, 3);
10382 return obj->DefineAccessor(name, flag == 0, fun, attributes);
10383 }
10384
10385
10386 RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) { 10362 RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) {
10387 ASSERT(args.length() == 3); 10363 ASSERT(args.length() == 3);
10388 CONVERT_ARG_CHECKED(JSObject, obj, 0); 10364 CONVERT_ARG_CHECKED(JSObject, obj, 0);
10389 CONVERT_ARG_CHECKED(String, name, 1); 10365 CONVERT_ARG_CHECKED(String, name, 1);
10390 CONVERT_SMI_ARG_CHECKED(flag, 2); 10366 CONVERT_SMI_ARG_CHECKED(flag, 2);
10391 return obj->LookupAccessor(name, flag == 0); 10367 return obj->LookupAccessor(name, flag == 0);
10392 } 10368 }
10393 10369
10394 10370
10395 #ifdef ENABLE_DEBUGGER_SUPPORT 10371 #ifdef ENABLE_DEBUGGER_SUPPORT
(...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after
13701 // Handle last resort GC and make sure to allow future allocations 13677 // Handle last resort GC and make sure to allow future allocations
13702 // to grow the heap without causing GCs (if possible). 13678 // to grow the heap without causing GCs (if possible).
13703 isolate->counters()->gc_last_resort_from_js()->Increment(); 13679 isolate->counters()->gc_last_resort_from_js()->Increment();
13704 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13680 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13705 "Runtime::PerformGC"); 13681 "Runtime::PerformGC");
13706 } 13682 }
13707 } 13683 }
13708 13684
13709 13685
13710 } } // namespace v8::internal 13686 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698