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

Side by Side Diff: src/runtime.cc

Issue 7390028: Implement `in' for proxies. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Mads' comments. 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 4297 matching lines...) Expand 10 before | Expand all | Expand 10 after
4308 } 4308 }
4309 } 4309 }
4310 return isolate->heap()->false_value(); 4310 return isolate->heap()->false_value();
4311 } 4311 }
4312 4312
4313 4313
4314 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) { 4314 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) {
4315 NoHandleAllocation na; 4315 NoHandleAllocation na;
4316 ASSERT(args.length() == 2); 4316 ASSERT(args.length() == 2);
4317 4317
4318 // Only JS objects can have properties. 4318 // Only JS receivers can have properties.
4319 if (args[0]->IsJSObject()) { 4319 if (args[0]->IsJSReceiver()) {
4320 JSObject* object = JSObject::cast(args[0]); 4320 JSReceiver* receiver = JSReceiver::cast(args[0]);
4321 CONVERT_CHECKED(String, key, args[1]); 4321 CONVERT_CHECKED(String, key, args[1]);
4322 if (object->HasProperty(key)) return isolate->heap()->true_value(); 4322 if (receiver->HasProperty(key)) return isolate->heap()->true_value();
4323 } 4323 }
4324 return isolate->heap()->false_value(); 4324 return isolate->heap()->false_value();
4325 } 4325 }
4326 4326
4327 4327
4328 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) { 4328 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) {
4329 NoHandleAllocation na; 4329 NoHandleAllocation na;
4330 ASSERT(args.length() == 2); 4330 ASSERT(args.length() == 2);
4331 4331
4332 // Only JS objects can have elements. 4332 // Only JS objects can have elements.
(...skipping 8362 matching lines...) Expand 10 before | Expand all | Expand 10 after
12695 } else { 12695 } else {
12696 // Handle last resort GC and make sure to allow future allocations 12696 // Handle last resort GC and make sure to allow future allocations
12697 // to grow the heap without causing GCs (if possible). 12697 // to grow the heap without causing GCs (if possible).
12698 isolate->counters()->gc_last_resort_from_js()->Increment(); 12698 isolate->counters()->gc_last_resort_from_js()->Increment();
12699 isolate->heap()->CollectAllGarbage(false); 12699 isolate->heap()->CollectAllGarbage(false);
12700 } 12700 }
12701 } 12701 }
12702 12702
12703 12703
12704 } } // namespace v8::internal 12704 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698