OLD | NEW |
---|---|
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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2110 *done = result.IsReadOnly(); | 2110 *done = result.IsReadOnly(); |
2111 break; | 2111 break; |
2112 case INTERCEPTOR: { | 2112 case INTERCEPTOR: { |
2113 PropertyAttributes attr = | 2113 PropertyAttributes attr = |
2114 result.holder()->GetPropertyAttributeWithInterceptor( | 2114 result.holder()->GetPropertyAttributeWithInterceptor( |
2115 this, name, true); | 2115 this, name, true); |
2116 *done = !!(attr & READ_ONLY); | 2116 *done = !!(attr & READ_ONLY); |
2117 break; | 2117 break; |
2118 } | 2118 } |
2119 case CALLBACKS: { | 2119 case CALLBACKS: { |
2120 if (!FLAG_es5_readonly && result.IsReadOnly()) break; | |
2120 *done = true; | 2121 *done = true; |
2121 return SetPropertyWithCallback(result.GetCallbackObject(), | 2122 return SetPropertyWithCallback(result.GetCallbackObject(), |
2122 name, value, result.holder(), strict_mode); | 2123 name, value, result.holder(), strict_mode); |
2123 } | 2124 } |
2124 case HANDLER: { | 2125 case HANDLER: { |
2125 return result.proxy()->SetPropertyViaPrototypesWithHandler( | 2126 return result.proxy()->SetPropertyViaPrototypesWithHandler( |
2126 this, name, value, attributes, strict_mode, done); | 2127 this, name, value, attributes, strict_mode, done); |
2127 } | 2128 } |
2128 case MAP_TRANSITION: | 2129 case MAP_TRANSITION: |
2129 case CONSTANT_TRANSITION: | 2130 case CONSTANT_TRANSITION: |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2543 void JSObject::LookupRealNamedPropertyInPrototypes(String* name, | 2544 void JSObject::LookupRealNamedPropertyInPrototypes(String* name, |
2544 LookupResult* result) { | 2545 LookupResult* result) { |
2545 Heap* heap = GetHeap(); | 2546 Heap* heap = GetHeap(); |
2546 for (Object* pt = GetPrototype(); | 2547 for (Object* pt = GetPrototype(); |
2547 pt != heap->null_value(); | 2548 pt != heap->null_value(); |
2548 pt = pt->GetPrototype()) { | 2549 pt = pt->GetPrototype()) { |
2549 if (pt->IsJSProxy()) { | 2550 if (pt->IsJSProxy()) { |
2550 return result->HandlerResult(JSProxy::cast(pt)); | 2551 return result->HandlerResult(JSProxy::cast(pt)); |
2551 } | 2552 } |
2552 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); | 2553 JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result); |
2553 if (result->IsProperty()) return; | 2554 if (result->IsProperty()) { |
2555 ASSERT(result->type() != INTERCEPTOR); | |
Michael Starzinger
2012/06/05 16:51:14
Can we move that out of into one line doing just t
| |
2556 return; | |
2557 } | |
2554 } | 2558 } |
2555 result->NotFound(); | 2559 result->NotFound(); |
2556 } | 2560 } |
2557 | 2561 |
2558 | 2562 |
2559 // We only need to deal with CALLBACKS and INTERCEPTORS | 2563 // We only need to deal with CALLBACKS and INTERCEPTORS |
2560 MaybeObject* JSObject::SetPropertyWithFailedAccessCheck( | 2564 MaybeObject* JSObject::SetPropertyWithFailedAccessCheck( |
2561 LookupResult* result, | 2565 LookupResult* result, |
2562 String* name, | 2566 String* name, |
2563 Object* value, | 2567 Object* value, |
(...skipping 10669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13233 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13237 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13234 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13238 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13235 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13239 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13236 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13240 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13237 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13241 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13238 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13242 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13239 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13243 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13240 } | 13244 } |
13241 | 13245 |
13242 } } // namespace v8::internal | 13246 } } // namespace v8::internal |
OLD | NEW |