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

Side by Side Diff: src/runtime.cc

Issue 7799026: Make proxies work as prototypes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Kevin's comments. Created 9 years, 3 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/property.h ('k') | test/mjsunit/harmony/proxies.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 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 4473 matching lines...) Expand 10 before | Expand all | Expand 10 after
4484 4484
4485 4485
4486 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) { 4486 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) {
4487 NoHandleAllocation na; 4487 NoHandleAllocation na;
4488 ASSERT(args.length() == 2); 4488 ASSERT(args.length() == 2);
4489 4489
4490 // Only JS receivers can have properties. 4490 // Only JS receivers can have properties.
4491 if (args[0]->IsJSReceiver()) { 4491 if (args[0]->IsJSReceiver()) {
4492 JSReceiver* receiver = JSReceiver::cast(args[0]); 4492 JSReceiver* receiver = JSReceiver::cast(args[0]);
4493 CONVERT_CHECKED(String, key, args[1]); 4493 CONVERT_CHECKED(String, key, args[1]);
4494 if (receiver->HasProperty(key)) return isolate->heap()->true_value(); 4494 bool result = receiver->HasProperty(key);
4495 if (isolate->has_pending_exception()) return Failure::Exception();
4496 return isolate->heap()->ToBoolean(result);
4495 } 4497 }
4496 return isolate->heap()->false_value(); 4498 return isolate->heap()->false_value();
4497 } 4499 }
4498 4500
4499 4501
4500 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) { 4502 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) {
4501 NoHandleAllocation na; 4503 NoHandleAllocation na;
4502 ASSERT(args.length() == 2); 4504 ASSERT(args.length() == 2);
4503 4505
4504 // Only JS objects can have elements. 4506 // Only JS objects can have elements.
(...skipping 8370 matching lines...) Expand 10 before | Expand all | Expand 10 after
12875 } else { 12877 } else {
12876 // Handle last resort GC and make sure to allow future allocations 12878 // Handle last resort GC and make sure to allow future allocations
12877 // to grow the heap without causing GCs (if possible). 12879 // to grow the heap without causing GCs (if possible).
12878 isolate->counters()->gc_last_resort_from_js()->Increment(); 12880 isolate->counters()->gc_last_resort_from_js()->Increment();
12879 isolate->heap()->CollectAllGarbage(false); 12881 isolate->heap()->CollectAllGarbage(false);
12880 } 12882 }
12881 } 12883 }
12882 12884
12883 12885
12884 } } // namespace v8::internal 12886 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property.h ('k') | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698