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

Side by Side Diff: src/objects.cc

Issue 10993011: Merged r12531, r12562, r12563 into 3.12 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.12
Patch Set: fix compilation of cctest/test-heap.cc Created 8 years, 2 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/objects.h ('k') | src/version.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 value = result->holder()->FastPropertyAt(result->GetFieldIndex()); 643 value = result->holder()->FastPropertyAt(result->GetFieldIndex());
644 ASSERT(!value->IsTheHole() || result->IsReadOnly()); 644 ASSERT(!value->IsTheHole() || result->IsReadOnly());
645 return value->IsTheHole() ? heap->undefined_value() : value; 645 return value->IsTheHole() ? heap->undefined_value() : value;
646 case CONSTANT_FUNCTION: 646 case CONSTANT_FUNCTION:
647 return result->GetConstantFunction(); 647 return result->GetConstantFunction();
648 case CALLBACKS: 648 case CALLBACKS:
649 return result->holder()->GetPropertyWithCallback( 649 return result->holder()->GetPropertyWithCallback(
650 receiver, result->GetCallbackObject(), name); 650 receiver, result->GetCallbackObject(), name);
651 case HANDLER: 651 case HANDLER:
652 return result->proxy()->GetPropertyWithHandler(receiver, name); 652 return result->proxy()->GetPropertyWithHandler(receiver, name);
653 case INTERCEPTOR: { 653 case INTERCEPTOR:
654 JSObject* recvr = JSObject::cast(receiver);
655 return result->holder()->GetPropertyWithInterceptor( 654 return result->holder()->GetPropertyWithInterceptor(
656 recvr, name, attributes); 655 receiver, name, attributes);
657 }
658 case TRANSITION: 656 case TRANSITION:
659 case NONEXISTENT: 657 case NONEXISTENT:
660 UNREACHABLE(); 658 UNREACHABLE();
661 break; 659 break;
662 } 660 }
663 UNREACHABLE(); 661 UNREACHABLE();
664 return NULL; 662 return NULL;
665 } 663 }
666 664
667 665
(...skipping 9564 matching lines...) Expand 10 before | Expand all | Expand 10 after
10232 ASSERT(map()->has_indexed_interceptor()); 10230 ASSERT(map()->has_indexed_interceptor());
10233 JSFunction* constructor = JSFunction::cast(map()->constructor()); 10231 JSFunction* constructor = JSFunction::cast(map()->constructor());
10234 ASSERT(constructor->shared()->IsApiFunction()); 10232 ASSERT(constructor->shared()->IsApiFunction());
10235 Object* result = 10233 Object* result =
10236 constructor->shared()->get_api_func_data()->indexed_property_handler(); 10234 constructor->shared()->get_api_func_data()->indexed_property_handler();
10237 return InterceptorInfo::cast(result); 10235 return InterceptorInfo::cast(result);
10238 } 10236 }
10239 10237
10240 10238
10241 MaybeObject* JSObject::GetPropertyPostInterceptor( 10239 MaybeObject* JSObject::GetPropertyPostInterceptor(
10242 JSReceiver* receiver, 10240 Object* receiver,
10243 String* name, 10241 String* name,
10244 PropertyAttributes* attributes) { 10242 PropertyAttributes* attributes) {
10245 // Check local property in holder, ignore interceptor. 10243 // Check local property in holder, ignore interceptor.
10246 LookupResult result(GetIsolate()); 10244 LookupResult result(GetIsolate());
10247 LocalLookupRealNamedProperty(name, &result); 10245 LocalLookupRealNamedProperty(name, &result);
10248 if (result.IsFound()) { 10246 if (result.IsFound()) {
10249 return GetProperty(receiver, &result, name, attributes); 10247 return GetProperty(receiver, &result, name, attributes);
10250 } 10248 }
10251 // Continue searching via the prototype chain. 10249 // Continue searching via the prototype chain.
10252 Object* pt = GetPrototype(); 10250 Object* pt = GetPrototype();
10253 *attributes = ABSENT; 10251 *attributes = ABSENT;
10254 if (pt->IsNull()) return GetHeap()->undefined_value(); 10252 if (pt->IsNull()) return GetHeap()->undefined_value();
10255 return pt->GetPropertyWithReceiver(receiver, name, attributes); 10253 return pt->GetPropertyWithReceiver(receiver, name, attributes);
10256 } 10254 }
10257 10255
10258 10256
10259 MaybeObject* JSObject::GetLocalPropertyPostInterceptor( 10257 MaybeObject* JSObject::GetLocalPropertyPostInterceptor(
10260 JSReceiver* receiver, 10258 Object* receiver,
10261 String* name, 10259 String* name,
10262 PropertyAttributes* attributes) { 10260 PropertyAttributes* attributes) {
10263 // Check local property in holder, ignore interceptor. 10261 // Check local property in holder, ignore interceptor.
10264 LookupResult result(GetIsolate()); 10262 LookupResult result(GetIsolate());
10265 LocalLookupRealNamedProperty(name, &result); 10263 LocalLookupRealNamedProperty(name, &result);
10266 if (result.IsFound()) { 10264 if (result.IsFound()) {
10267 return GetProperty(receiver, &result, name, attributes); 10265 return GetProperty(receiver, &result, name, attributes);
10268 } 10266 }
10269 return GetHeap()->undefined_value(); 10267 return GetHeap()->undefined_value();
10270 } 10268 }
10271 10269
10272 10270
10273 MaybeObject* JSObject::GetPropertyWithInterceptor( 10271 MaybeObject* JSObject::GetPropertyWithInterceptor(
10274 JSReceiver* receiver, 10272 Object* receiver,
10275 String* name, 10273 String* name,
10276 PropertyAttributes* attributes) { 10274 PropertyAttributes* attributes) {
10277 Isolate* isolate = GetIsolate(); 10275 Isolate* isolate = GetIsolate();
10278 InterceptorInfo* interceptor = GetNamedInterceptor(); 10276 InterceptorInfo* interceptor = GetNamedInterceptor();
10279 HandleScope scope(isolate); 10277 HandleScope scope(isolate);
10280 Handle<JSReceiver> receiver_handle(receiver); 10278 Handle<Object> receiver_handle(receiver);
10281 Handle<JSObject> holder_handle(this); 10279 Handle<JSObject> holder_handle(this);
10282 Handle<String> name_handle(name); 10280 Handle<String> name_handle(name);
10283 10281
10284 if (!interceptor->getter()->IsUndefined()) { 10282 if (!interceptor->getter()->IsUndefined()) {
10285 v8::NamedPropertyGetter getter = 10283 v8::NamedPropertyGetter getter =
10286 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); 10284 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter());
10287 LOG(isolate, 10285 LOG(isolate,
10288 ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name)); 10286 ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name));
10289 CustomArguments args(isolate, interceptor->data(), receiver, this); 10287 CustomArguments args(isolate, interceptor->data(), receiver, this);
10290 v8::AccessorInfo info(args.end()); 10288 v8::AccessorInfo info(args.end());
(...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after
13197 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13195 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13198 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13196 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13199 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13197 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13200 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13198 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13201 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13199 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13202 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13200 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13203 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13201 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13204 } 13202 }
13205 13203
13206 } } // namespace v8::internal 13204 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698