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

Unified Diff: src/runtime.cc

Issue 458813002: Prototype implementation of GET_OWN_PROPERTY intrinsic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.h ('k') | src/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 2008acf64e72e24e48dcfecc8b26d9c3adfcdf3d..7fab3ebc6175418643f66549cbb09a031ad8bce3 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4915,6 +4915,46 @@ RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
}
+RUNTIME_FUNCTION(Runtime_KeyedGetOwnProperty) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+
+ CONVERT_ARG_HANDLE_CHECKED(Object, receiver_obj, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, key_obj, 1);
+
+ Handle<Name> name;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name, ToName(isolate, key_obj));
+
+ LookupIterator it(receiver_obj, name, LookupIterator::CHECK_OWN_REAL);
+
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ receiver_obj->GetProperty(&it));
+ return *result;
+}
+
+RUNTIME_FUNCTION(Runtime_LoadOwnProperty) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+
+ CONVERT_ARG_HANDLE_CHECKED(Object, receiver_obj, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, key_obj, 1);
+
+ Handle<Name> name;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name,
+ ToName(isolate, key_obj));
+
+ LookupIterator it(receiver_obj, name, LookupIterator::CHECK_OWN_REAL);
+
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, result,
+ receiver_obj->GetProperty(&it));
+ return *result;
+}
+
+
static bool IsValidAccessor(Handle<Object> obj) {
return obj->IsUndefined() || obj->IsSpecFunction() || obj->IsNull();
}
@@ -14785,6 +14825,12 @@ RUNTIME_FUNCTION(Runtime_IS_VAR) {
}
+RUNTIME_FUNCTION(Runtime_GET_OWN_PROPERTY) {
+ UNREACHABLE(); // implemented as macro in the parser
+ return NULL;
+}
+
+
#define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \
RUNTIME_FUNCTION(Runtime_Has##Name) { \
CONVERT_ARG_CHECKED(JSObject, obj, 0); \
@@ -15230,6 +15276,7 @@ U(IsStringWrapperSafeForDefaultValueOf)
U(GeneratorNext)
U(GeneratorThrow)
U(DebugBreakInOptimizedCode)
+U(GetOwnPrivateProperty)
#undef U
« no previous file with comments | « src/runtime.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698