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

Side by Side Diff: src/api.cc

Issue 235004: Add another method that allows to lookup for a real named property not only... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | « include/v8.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 i::Handle<i::Object> result(self_obj->GetProperty(*self_obj, 2135 i::Handle<i::Object> result(self_obj->GetProperty(*self_obj,
2136 &lookup, 2136 &lookup,
2137 *key_obj, 2137 *key_obj,
2138 &attributes)); 2138 &attributes));
2139 return Utils::ToLocal(result); 2139 return Utils::ToLocal(result);
2140 } 2140 }
2141 return Local<Value>(); // No real property was found in prototype chain. 2141 return Local<Value>(); // No real property was found in prototype chain.
2142 } 2142 }
2143 2143
2144 2144
2145 Handle<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
2146 ON_BAILOUT("v8::Object::GetRealNamedProperty()", return Local<Value>());
2147 ENTER_V8;
2148 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
2149 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
2150 i::LookupResult lookup;
2151 self_obj->LookupRealNamedProperty(*key_obj, &lookup);
2152 if (lookup.IsValid()) {
2153 PropertyAttributes attributes;
2154 i::Handle<i::Object> result(self_obj->GetProperty(*self_obj,
2155 &lookup,
2156 *key_obj,
2157 &attributes));
2158 return Utils::ToLocal(result);
2159 }
2160 return Local<Value>(); // No real property was found in prototype chain.
2161 }
2162
2163
2145 // Turns on access checks by copying the map and setting the check flag. 2164 // Turns on access checks by copying the map and setting the check flag.
2146 // Because the object gets a new map, existing inline cache caching 2165 // Because the object gets a new map, existing inline cache caching
2147 // the old map of this object will fail. 2166 // the old map of this object will fail.
2148 void v8::Object::TurnOnAccessCheck() { 2167 void v8::Object::TurnOnAccessCheck() {
2149 ON_BAILOUT("v8::Object::TurnOnAccessCheck()", return); 2168 ON_BAILOUT("v8::Object::TurnOnAccessCheck()", return);
2150 ENTER_V8; 2169 ENTER_V8;
2151 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); 2170 i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
2152 2171
2153 i::Handle<i::Map> new_map = 2172 i::Handle<i::Map> new_map =
2154 i::Factory::CopyMapDropTransitions(i::Handle<i::Map>(obj->map())); 2173 i::Factory::CopyMapDropTransitions(i::Handle<i::Map>(obj->map()));
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
3732 3751
3733 3752
3734 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3753 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3735 HandleScopeImplementer* thread_local = 3754 HandleScopeImplementer* thread_local =
3736 reinterpret_cast<HandleScopeImplementer*>(storage); 3755 reinterpret_cast<HandleScopeImplementer*>(storage);
3737 thread_local->IterateThis(v); 3756 thread_local->IterateThis(v);
3738 return storage + ArchiveSpacePerThread(); 3757 return storage + ArchiveSpacePerThread();
3739 } 3758 }
3740 3759
3741 } } // namespace v8::internal 3760 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698