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

Side by Side Diff: src/objects.cc

Issue 14371007: Ensure callbacks transitions are actually followed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 5372 matching lines...) Expand 10 before | Expand all | Expand 10 after
5383 5383
5384 5384
5385 MaybeObject* JSObject::DefineFastAccessor(Name* name, 5385 MaybeObject* JSObject::DefineFastAccessor(Name* name,
5386 AccessorComponent component, 5386 AccessorComponent component,
5387 Object* accessor, 5387 Object* accessor,
5388 PropertyAttributes attributes) { 5388 PropertyAttributes attributes) {
5389 ASSERT(accessor->IsSpecFunction() || accessor->IsUndefined()); 5389 ASSERT(accessor->IsSpecFunction() || accessor->IsUndefined());
5390 LookupResult result(GetIsolate()); 5390 LookupResult result(GetIsolate());
5391 LocalLookup(name, &result); 5391 LocalLookup(name, &result);
5392 5392
5393 if (result.IsFound() 5393 if (result.IsFound() && !result.IsPropertyCallbacks()) {
5394 && !result.IsPropertyCallbacks() 5394 return GetHeap()->null_value();
5395 && !result.IsTransition()) return GetHeap()->null_value(); 5395 }
5396 5396
5397 // Return success if the same accessor with the same attributes already exist. 5397 // Return success if the same accessor with the same attributes already exist.
5398 AccessorPair* source_accessors = NULL; 5398 AccessorPair* source_accessors = NULL;
5399 if (result.IsPropertyCallbacks()) { 5399 if (result.IsPropertyCallbacks()) {
5400 Object* callback_value = result.GetCallbackObject(); 5400 Object* callback_value = result.GetCallbackObject();
5401 if (callback_value->IsAccessorPair()) { 5401 if (callback_value->IsAccessorPair()) {
5402 source_accessors = AccessorPair::cast(callback_value); 5402 source_accessors = AccessorPair::cast(callback_value);
5403 Object* entry = source_accessors->get(component); 5403 Object* entry = source_accessors->get(component);
5404 if (entry == accessor && result.GetAttributes() == attributes) { 5404 if (entry == accessor && result.GetAttributes() == attributes) {
5405 return this; 5405 return this;
(...skipping 9099 matching lines...) Expand 10 before | Expand all | Expand 10 after
14505 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14505 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14506 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14506 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14507 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14507 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14508 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14508 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14509 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14509 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14510 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14510 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14511 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14511 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14512 } 14512 }
14513 14513
14514 } } // namespace v8::internal 14514 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698