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

Side by Side Diff: src/objects.cc

Issue 669061: First take on custom call generators. (Closed)
Patch Set: Ultimate version Created 10 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
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 return Heap::true_value(); 474 return Heap::true_value();
475 } 475 }
476 476
477 477
478 bool JSObject::IsDirty() { 478 bool JSObject::IsDirty() {
479 Object* cons_obj = map()->constructor(); 479 Object* cons_obj = map()->constructor();
480 if (!cons_obj->IsJSFunction()) 480 if (!cons_obj->IsJSFunction())
481 return true; 481 return true;
482 JSFunction* fun = JSFunction::cast(cons_obj); 482 JSFunction* fun = JSFunction::cast(cons_obj);
483 if (!fun->shared()->function_data()->IsFunctionTemplateInfo()) 483 if (!fun->shared()->IsApiFunction())
484 return true; 484 return true;
485 // If the object is fully fast case and has the same map it was 485 // If the object is fully fast case and has the same map it was
486 // created with then no changes can have been made to it. 486 // created with then no changes can have been made to it.
487 return map() != fun->initial_map() 487 return map() != fun->initial_map()
488 || !HasFastElements() 488 || !HasFastElements()
489 || !HasFastProperties(); 489 || !HasFastProperties();
490 } 490 }
491 491
492 492
493 Object* Object::GetProperty(Object* receiver, 493 Object* Object::GetProperty(Object* receiver,
(...skipping 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after
6426 elements->set(pos++, ValueAt(i), mode); 6426 elements->set(pos++, ValueAt(i), mode);
6427 } 6427 }
6428 } 6428 }
6429 ASSERT(pos == elements->length()); 6429 ASSERT(pos == elements->length());
6430 } 6430 }
6431 6431
6432 6432
6433 InterceptorInfo* JSObject::GetNamedInterceptor() { 6433 InterceptorInfo* JSObject::GetNamedInterceptor() {
6434 ASSERT(map()->has_named_interceptor()); 6434 ASSERT(map()->has_named_interceptor());
6435 JSFunction* constructor = JSFunction::cast(map()->constructor()); 6435 JSFunction* constructor = JSFunction::cast(map()->constructor());
6436 Object* template_info = constructor->shared()->function_data(); 6436 ASSERT(constructor->shared()->IsApiFunction());
6437 Object* result = 6437 Object* result =
6438 FunctionTemplateInfo::cast(template_info)->named_property_handler(); 6438 constructor->shared()->get_api_func_data()->named_property_handler();
6439 return InterceptorInfo::cast(result); 6439 return InterceptorInfo::cast(result);
6440 } 6440 }
6441 6441
6442 6442
6443 InterceptorInfo* JSObject::GetIndexedInterceptor() { 6443 InterceptorInfo* JSObject::GetIndexedInterceptor() {
6444 ASSERT(map()->has_indexed_interceptor()); 6444 ASSERT(map()->has_indexed_interceptor());
6445 JSFunction* constructor = JSFunction::cast(map()->constructor()); 6445 JSFunction* constructor = JSFunction::cast(map()->constructor());
6446 Object* template_info = constructor->shared()->function_data(); 6446 ASSERT(constructor->shared()->IsApiFunction());
6447 Object* result = 6447 Object* result =
6448 FunctionTemplateInfo::cast(template_info)->indexed_property_handler(); 6448 constructor->shared()->get_api_func_data()->indexed_property_handler();
6449 return InterceptorInfo::cast(result); 6449 return InterceptorInfo::cast(result);
6450 } 6450 }
6451 6451
6452 6452
6453 Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver, 6453 Object* JSObject::GetPropertyPostInterceptor(JSObject* receiver,
6454 String* name, 6454 String* name,
6455 PropertyAttributes* attributes) { 6455 PropertyAttributes* attributes) {
6456 // Check local property in holder, ignore interceptor. 6456 // Check local property in holder, ignore interceptor.
6457 LookupResult result; 6457 LookupResult result;
6458 LocalLookupRealNamedProperty(name, &result); 6458 LocalLookupRealNamedProperty(name, &result);
(...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
8579 if (break_point_objects()->IsUndefined()) return 0; 8579 if (break_point_objects()->IsUndefined()) return 0;
8580 // Single beak point. 8580 // Single beak point.
8581 if (!break_point_objects()->IsFixedArray()) return 1; 8581 if (!break_point_objects()->IsFixedArray()) return 1;
8582 // Multiple break points. 8582 // Multiple break points.
8583 return FixedArray::cast(break_point_objects())->length(); 8583 return FixedArray::cast(break_point_objects())->length();
8584 } 8584 }
8585 #endif 8585 #endif
8586 8586
8587 8587
8588 } } // namespace v8::internal 8588 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698