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

Side by Side Diff: src/runtime.cc

Issue 11881020: Fix problem with NULL handle in r13367. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 // Due to some WebKit tests, we want to make sure that we do not log 1091 // Due to some WebKit tests, we want to make sure that we do not log
1092 // more than one access failure here. 1092 // more than one access failure here.
1093 switch (CheckPropertyAccess(*obj, *name, v8::ACCESS_HAS)) { 1093 switch (CheckPropertyAccess(*obj, *name, v8::ACCESS_HAS)) {
1094 case ACCESS_FORBIDDEN: return heap->false_value(); 1094 case ACCESS_FORBIDDEN: return heap->false_value();
1095 case ACCESS_ALLOWED: break; 1095 case ACCESS_ALLOWED: break;
1096 case ACCESS_ABSENT: return heap->undefined_value(); 1096 case ACCESS_ABSENT: return heap->undefined_value();
1097 } 1097 }
1098 1098
1099 PropertyAttributes attrs = obj->GetLocalPropertyAttribute(*name); 1099 PropertyAttributes attrs = obj->GetLocalPropertyAttribute(*name);
1100 if (attrs == ABSENT) return heap->undefined_value(); 1100 if (attrs == ABSENT) return heap->undefined_value();
1101 Handle<AccessorPair> accessors(obj->GetLocalPropertyAccessorPair(*name)); 1101 AccessorPair* raw_accessors = obj->GetLocalPropertyAccessorPair(*name);
1102 Handle<AccessorPair> accessors(raw_accessors, isolate);
1102 1103
1103 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); 1104 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE);
1104 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); 1105 elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0));
1105 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); 1106 elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0));
1106 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(!accessors.is_null())); 1107 elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(raw_accessors != NULL));
1107 1108
1108 if (accessors.is_null()) { 1109 if (raw_accessors == NULL) {
1109 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); 1110 elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0));
1110 // GetProperty does access check. 1111 // GetProperty does access check.
1111 Handle<Object> value = GetProperty(obj, name); 1112 Handle<Object> value = GetProperty(obj, name);
1112 if (value.is_null()) return Failure::Exception(); 1113 if (value.is_null()) return Failure::Exception();
1113 elms->set(VALUE_INDEX, *value); 1114 elms->set(VALUE_INDEX, *value);
1114 } else { 1115 } else {
1115 // Access checks are performed for both accessors separately. 1116 // Access checks are performed for both accessors separately.
1116 // When they fail, the respective field is not set in the descriptor. 1117 // When they fail, the respective field is not set in the descriptor.
1117 Object* getter = accessors->GetComponent(ACCESSOR_GETTER); 1118 Object* getter = accessors->GetComponent(ACCESSOR_GETTER);
1118 Object* setter = accessors->GetComponent(ACCESSOR_SETTER); 1119 Object* setter = accessors->GetComponent(ACCESSOR_SETTER);
(...skipping 12524 matching lines...) Expand 10 before | Expand all | Expand 10 after
13643 // Handle last resort GC and make sure to allow future allocations 13644 // Handle last resort GC and make sure to allow future allocations
13644 // to grow the heap without causing GCs (if possible). 13645 // to grow the heap without causing GCs (if possible).
13645 isolate->counters()->gc_last_resort_from_js()->Increment(); 13646 isolate->counters()->gc_last_resort_from_js()->Increment();
13646 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13647 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13647 "Runtime::PerformGC"); 13648 "Runtime::PerformGC");
13648 } 13649 }
13649 } 13650 }
13650 13651
13651 13652
13652 } } // namespace v8::internal 13653 } } // 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