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

Side by Side Diff: src/api.cc

Issue 6709028: Revert r7258 and r7260. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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 | « no previous file | src/handles.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 i::Handle<i::Object> result = i::GetPrototype(self); 2384 i::Handle<i::Object> result = i::GetPrototype(self);
2385 return Utils::ToLocal(result); 2385 return Utils::ToLocal(result);
2386 } 2386 }
2387 2387
2388 2388
2389 bool v8::Object::SetPrototype(Handle<Value> value) { 2389 bool v8::Object::SetPrototype(Handle<Value> value) {
2390 ON_BAILOUT("v8::Object::SetPrototype()", return false); 2390 ON_BAILOUT("v8::Object::SetPrototype()", return false);
2391 ENTER_V8; 2391 ENTER_V8;
2392 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2392 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2393 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); 2393 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
2394 // We do not allow exceptions thrown while setting the prototype
2395 // propagate outside.
2396 TryCatch try_catch;
2397 EXCEPTION_PREAMBLE(); 2394 EXCEPTION_PREAMBLE();
2398 i::Handle<i::Object> result = i::SetPrototype(self, value_obj); 2395 i::Handle<i::Object> result = i::SetPrototype(self, value_obj);
2399 has_pending_exception = result.is_null(); 2396 has_pending_exception = result.is_null();
2400 EXCEPTION_BAILOUT_CHECK(false); 2397 EXCEPTION_BAILOUT_CHECK(false);
2401 return true; 2398 return true;
2402 } 2399 }
2403 2400
2404 2401
2405 Local<Object> v8::Object::FindInstanceInPrototypeChain( 2402 Local<Object> v8::Object::FindInstanceInPrototypeChain(
2406 v8::Handle<FunctionTemplate> tmpl) { 2403 v8::Handle<FunctionTemplate> tmpl) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 return Utils::OpenHandle(this)->HasNamedInterceptor(); 2570 return Utils::OpenHandle(this)->HasNamedInterceptor();
2574 } 2571 }
2575 2572
2576 2573
2577 bool v8::Object::HasIndexedLookupInterceptor() { 2574 bool v8::Object::HasIndexedLookupInterceptor() {
2578 ON_BAILOUT("v8::Object::HasIndexedLookupInterceptor()", return false); 2575 ON_BAILOUT("v8::Object::HasIndexedLookupInterceptor()", return false);
2579 return Utils::OpenHandle(this)->HasIndexedInterceptor(); 2576 return Utils::OpenHandle(this)->HasIndexedInterceptor();
2580 } 2577 }
2581 2578
2582 2579
2583 static Local<Value> GetPropertyByLookup(i::Handle<i::JSObject> receiver,
2584 i::Handle<i::String> name,
2585 i::LookupResult* lookup) {
2586 if (!lookup->IsProperty()) {
2587 // No real property was found.
2588 return Local<Value>();
2589 }
2590
2591 // If the property being looked up is a callback, it can throw
2592 // an exception.
2593 EXCEPTION_PREAMBLE();
2594 i::Handle<i::Object> result = i::GetProperty(receiver, name, lookup);
2595 has_pending_exception = result.is_null();
2596 EXCEPTION_BAILOUT_CHECK(Local<Value>());
2597
2598 return Utils::ToLocal(result);
2599 }
2600
2601
2602 Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain( 2580 Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
2603 Handle<String> key) { 2581 Handle<String> key) {
2604 ON_BAILOUT("v8::Object::GetRealNamedPropertyInPrototypeChain()", 2582 ON_BAILOUT("v8::Object::GetRealNamedPropertyInPrototypeChain()",
2605 return Local<Value>()); 2583 return Local<Value>());
2606 ENTER_V8; 2584 ENTER_V8;
2607 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); 2585 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
2608 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 2586 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
2609 i::LookupResult lookup; 2587 i::LookupResult lookup;
2610 self_obj->LookupRealNamedPropertyInPrototypes(*key_obj, &lookup); 2588 self_obj->LookupRealNamedPropertyInPrototypes(*key_obj, &lookup);
2611 return GetPropertyByLookup(self_obj, key_obj, &lookup); 2589 if (lookup.IsProperty()) {
2590 PropertyAttributes attributes;
2591 i::Object* property =
2592 self_obj->GetProperty(*self_obj,
2593 &lookup,
2594 *key_obj,
2595 &attributes)->ToObjectUnchecked();
2596 i::Handle<i::Object> result(property);
2597 return Utils::ToLocal(result);
2598 }
2599 return Local<Value>(); // No real property was found in prototype chain.
2612 } 2600 }
2613 2601
2614 2602
2615 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) { 2603 Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
2616 ON_BAILOUT("v8::Object::GetRealNamedProperty()", return Local<Value>()); 2604 ON_BAILOUT("v8::Object::GetRealNamedProperty()", return Local<Value>());
2617 ENTER_V8; 2605 ENTER_V8;
2618 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this); 2606 i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
2619 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 2607 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
2620 i::LookupResult lookup; 2608 i::LookupResult lookup;
2621 self_obj->LookupRealNamedProperty(*key_obj, &lookup); 2609 self_obj->LookupRealNamedProperty(*key_obj, &lookup);
2622 return GetPropertyByLookup(self_obj, key_obj, &lookup); 2610 if (lookup.IsProperty()) {
2611 PropertyAttributes attributes;
2612 i::Object* property =
2613 self_obj->GetProperty(*self_obj,
2614 &lookup,
2615 *key_obj,
2616 &attributes)->ToObjectUnchecked();
2617 i::Handle<i::Object> result(property);
2618 return Utils::ToLocal(result);
2619 }
2620 return Local<Value>(); // No real property was found in prototype chain.
2623 } 2621 }
2624 2622
2625 2623
2626 // Turns on access checks by copying the map and setting the check flag. 2624 // Turns on access checks by copying the map and setting the check flag.
2627 // Because the object gets a new map, existing inline cache caching 2625 // Because the object gets a new map, existing inline cache caching
2628 // the old map of this object will fail. 2626 // the old map of this object will fail.
2629 void v8::Object::TurnOnAccessCheck() { 2627 void v8::Object::TurnOnAccessCheck() {
2630 ON_BAILOUT("v8::Object::TurnOnAccessCheck()", return); 2628 ON_BAILOUT("v8::Object::TurnOnAccessCheck()", return);
2631 ENTER_V8; 2629 ENTER_V8;
2632 HandleScope scope; 2630 HandleScope scope;
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after
5239 5237
5240 5238
5241 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5239 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5242 HandleScopeImplementer* thread_local = 5240 HandleScopeImplementer* thread_local =
5243 reinterpret_cast<HandleScopeImplementer*>(storage); 5241 reinterpret_cast<HandleScopeImplementer*>(storage);
5244 thread_local->IterateThis(v); 5242 thread_local->IterateThis(v);
5245 return storage + ArchiveSpacePerThread(); 5243 return storage + ArchiveSpacePerThread();
5246 } 5244 }
5247 5245
5248 } } // namespace v8::internal 5246 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698