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

Side by Side Diff: src/objects.cc

Issue 11190044: dom-query.html spends ~10% of total time in OSAtomicAdd32Barrier on my Mac (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/objects.h ('k') | src/runtime.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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 // Check access rights if needed. 701 // Check access rights if needed.
702 if (js_object->IsAccessCheckNeeded()) { 702 if (js_object->IsAccessCheckNeeded()) {
703 Isolate* isolate = heap->isolate(); 703 Isolate* isolate = heap->isolate();
704 if (!isolate->MayIndexedAccess(js_object, index, v8::ACCESS_GET)) { 704 if (!isolate->MayIndexedAccess(js_object, index, v8::ACCESS_GET)) {
705 isolate->ReportFailedAccessCheck(js_object, v8::ACCESS_GET); 705 isolate->ReportFailedAccessCheck(js_object, v8::ACCESS_GET);
706 return heap->undefined_value(); 706 return heap->undefined_value();
707 } 707 }
708 } 708 }
709 709
710 if (js_object->HasIndexedInterceptor()) { 710 if (js_object->HasIndexedInterceptor()) {
711 return js_object->GetElementWithInterceptor(receiver, index); 711 return js_object->GetElementWithInterceptor(
712 receiver, index, heap->isolate());
712 } 713 }
713 714
714 if (js_object->elements() != heap->empty_fixed_array()) { 715 if (js_object->elements() != heap->empty_fixed_array()) {
715 MaybeObject* result = js_object->GetElementsAccessor()->Get( 716 MaybeObject* result = js_object->GetElementsAccessor()->Get(
716 receiver, js_object, index); 717 receiver, js_object, index);
717 if (result != heap->the_hole_value()) return result; 718 if (result != heap->the_hole_value()) return result;
718 } 719 }
719 } 720 }
720 721
721 return heap->undefined_value(); 722 return heap->undefined_value();
(...skipping 9450 matching lines...) Expand 10 before | Expand all | Expand 10 after
10172 GetHeap()->NumberFromDouble(static_cast<double>(index) + 1); 10173 GetHeap()->NumberFromDouble(static_cast<double>(index) + 1);
10173 if (!maybe_len->ToObject(&len)) return maybe_len; 10174 if (!maybe_len->ToObject(&len)) return maybe_len;
10174 } 10175 }
10175 set_length(len); 10176 set_length(len);
10176 } 10177 }
10177 return value; 10178 return value;
10178 } 10179 }
10179 10180
10180 10181
10181 MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver, 10182 MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver,
10182 uint32_t index) { 10183 uint32_t index,
10183 Isolate* isolate = GetIsolate(); 10184 Isolate* isolate) {
10184 // Make sure that the top context does not change when doing 10185 // Make sure that the top context does not change when doing
10185 // callbacks or interceptor calls. 10186 // callbacks or interceptor calls.
10186 AssertNoContextChange ncc; 10187 AssertNoContextChange ncc;
10187 HandleScope scope(isolate); 10188 HandleScope scope(isolate);
10188 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate); 10189 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate);
10189 Handle<Object> this_handle(receiver, isolate); 10190 Handle<Object> this_handle(receiver, isolate);
10190 Handle<JSObject> holder_handle(this, isolate); 10191 Handle<JSObject> holder_handle(this, isolate);
10191 if (!interceptor->getter()->IsUndefined()) { 10192 if (!interceptor->getter()->IsUndefined()) {
10192 v8::IndexedPropertyGetter getter = 10193 v8::IndexedPropertyGetter getter =
10193 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); 10194 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
(...skipping 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after
13475 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13476 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13476 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13477 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13477 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13478 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13478 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13479 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13479 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13480 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13480 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13481 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13481 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13482 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13482 } 13483 }
13483 13484
13484 } } // namespace v8::internal 13485 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698