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 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3966 bool has_pending_exception = false; | 3966 bool has_pending_exception = false; |
3967 Handle<Object> converted = | 3967 Handle<Object> converted = |
3968 Execution::ToString(key, &has_pending_exception); | 3968 Execution::ToString(key, &has_pending_exception); |
3969 if (has_pending_exception) return Failure::Exception(); | 3969 if (has_pending_exception) return Failure::Exception(); |
3970 name = Handle<Name>::cast(converted); | 3970 name = Handle<Name>::cast(converted); |
3971 } | 3971 } |
3972 | 3972 |
3973 return isolate->heap()->ToBoolean(object->HasProperty(*name)); | 3973 return isolate->heap()->ToBoolean(object->HasProperty(*name)); |
3974 } | 3974 } |
3975 | 3975 |
| 3976 MaybeObject* Runtime::GetObjectPropertyOrFail( |
| 3977 Isolate* isolate, |
| 3978 Handle<Object> object, |
| 3979 Handle<Object> key) { |
| 3980 CALL_HEAP_FUNCTION_PASS_EXCEPTION(isolate, |
| 3981 GetObjectProperty(isolate, object, key)); |
| 3982 } |
3976 | 3983 |
3977 MaybeObject* Runtime::GetObjectProperty(Isolate* isolate, | 3984 MaybeObject* Runtime::GetObjectProperty(Isolate* isolate, |
3978 Handle<Object> object, | 3985 Handle<Object> object, |
3979 Handle<Object> key) { | 3986 Handle<Object> key) { |
3980 HandleScope scope(isolate); | 3987 HandleScope scope(isolate); |
3981 | 3988 |
3982 if (object->IsUndefined() || object->IsNull()) { | 3989 if (object->IsUndefined() || object->IsNull()) { |
3983 Handle<Object> args[2] = { key, object }; | 3990 Handle<Object> args[2] = { key, object }; |
3984 Handle<Object> error = | 3991 Handle<Object> error = |
3985 isolate->factory()->NewTypeError("non_object_property_load", | 3992 isolate->factory()->NewTypeError("non_object_property_load", |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4250 case INTERCEPTOR: | 4257 case INTERCEPTOR: |
4251 case TRANSITION: | 4258 case TRANSITION: |
4252 return isolate->heap()->undefined_value(); | 4259 return isolate->heap()->undefined_value(); |
4253 case NONEXISTENT: | 4260 case NONEXISTENT: |
4254 UNREACHABLE(); | 4261 UNREACHABLE(); |
4255 } | 4262 } |
4256 return isolate->heap()->undefined_value(); | 4263 return isolate->heap()->undefined_value(); |
4257 } | 4264 } |
4258 | 4265 |
4259 | 4266 |
| 4267 MaybeObject* Runtime::SetObjectPropertyOrFail( |
| 4268 Isolate* isolate, |
| 4269 Handle<Object> object, |
| 4270 Handle<Object> key, |
| 4271 Handle<Object> value, |
| 4272 PropertyAttributes attr, |
| 4273 StrictModeFlag strict_mode) { |
| 4274 CALL_HEAP_FUNCTION_PASS_EXCEPTION(isolate, |
| 4275 SetObjectProperty(isolate, object, key, value, attr, strict_mode)); |
| 4276 } |
| 4277 |
| 4278 |
4260 MaybeObject* Runtime::SetObjectProperty(Isolate* isolate, | 4279 MaybeObject* Runtime::SetObjectProperty(Isolate* isolate, |
4261 Handle<Object> object, | 4280 Handle<Object> object, |
4262 Handle<Object> key, | 4281 Handle<Object> key, |
4263 Handle<Object> value, | 4282 Handle<Object> value, |
4264 PropertyAttributes attr, | 4283 PropertyAttributes attr, |
4265 StrictModeFlag strict_mode) { | 4284 StrictModeFlag strict_mode) { |
4266 SetPropertyMode set_mode = attr == NONE ? SET_PROPERTY : DEFINE_PROPERTY; | 4285 SetPropertyMode set_mode = attr == NONE ? SET_PROPERTY : DEFINE_PROPERTY; |
4267 HandleScope scope(isolate); | 4286 HandleScope scope(isolate); |
4268 | 4287 |
4269 if (object->IsUndefined() || object->IsNull()) { | 4288 if (object->IsUndefined() || object->IsNull()) { |
(...skipping 8814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13084 // Handle last resort GC and make sure to allow future allocations | 13103 // Handle last resort GC and make sure to allow future allocations |
13085 // to grow the heap without causing GCs (if possible). | 13104 // to grow the heap without causing GCs (if possible). |
13086 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13105 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13087 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13106 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13088 "Runtime::PerformGC"); | 13107 "Runtime::PerformGC"); |
13089 } | 13108 } |
13090 } | 13109 } |
13091 | 13110 |
13092 | 13111 |
13093 } } // namespace v8::internal | 13112 } } // namespace v8::internal |
OLD | NEW |