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

Unified Diff: src/runtime.cc

Issue 7356013: Implement Object.prototype.hasOwnProperty in generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 117e5ab36f6f7b7743ea43ef2e666220ee090e23..c7ec871e8fb30e158a25662e9c4d65e574337fdb 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4246,9 +4246,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteProperty) {
}
-static Object* HasLocalPropertyImplementation(Isolate* isolate,
- Handle<JSObject> object,
- Handle<String> key) {
+static Object* HasOwnPropertyImplementation(Isolate* isolate,
+ Handle<JSObject> object,
+ Handle<String> key) {
if (object->HasLocalProperty(*key)) return isolate->heap()->true_value();
// Handle hidden prototypes. If there's a hidden prototype above this thing
// then we have to check it for properties, because they are supposed to
@@ -4256,15 +4256,15 @@ static Object* HasLocalPropertyImplementation(Isolate* isolate,
Handle<Object> proto(object->GetPrototype());
if (proto->IsJSObject() &&
Handle<JSObject>::cast(proto)->map()->is_hidden_prototype()) {
- return HasLocalPropertyImplementation(isolate,
- Handle<JSObject>::cast(proto),
- key);
+ return HasOwnPropertyImplementation(isolate,
+ Handle<JSObject>::cast(proto),
+ key);
}
return isolate->heap()->false_value();
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_HasLocalProperty) {
+RUNTIME_FUNCTION(MaybeObject*, Runtime_HasOwnProperty) {
NoHandleAllocation ha;
ASSERT(args.length() == 2);
CONVERT_CHECKED(String, key, args[1]);
@@ -4288,9 +4288,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HasLocalProperty) {
}
// Slow case.
HandleScope scope(isolate);
- return HasLocalPropertyImplementation(isolate,
- Handle<JSObject>(object),
- Handle<String>(key));
+ return HasOwnPropertyImplementation(isolate,
+ Handle<JSObject>(object),
+ Handle<String>(key));
} else if (obj->IsString() && key_is_array_index) {
// Well, there is one exception: Handle [] on strings.
String* string = String::cast(obj);
« src/ia32/code-stubs-ia32.cc ('K') | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698