| 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 5183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5194 Handle<Object> result; | 5194 Handle<Object> result; |
| 5195 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 5195 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 5196 isolate, result, | 5196 isolate, result, |
| 5197 Runtime::ForceSetObjectProperty(js_object, name, obj_value, attr)); | 5197 Runtime::ForceSetObjectProperty(js_object, name, obj_value, attr)); |
| 5198 return *result; | 5198 return *result; |
| 5199 } | 5199 } |
| 5200 | 5200 |
| 5201 | 5201 |
| 5202 // Return property without being observable by accessors or interceptors. | 5202 // Return property without being observable by accessors or interceptors. |
| 5203 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) { | 5203 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) { |
| 5204 SealHandleScope shs(isolate); | 5204 HandleScope scope(isolate); |
| 5205 ASSERT(args.length() == 2); | 5205 ASSERT(args.length() == 2); |
| 5206 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 5206 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
| 5207 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); | 5207 CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); |
| 5208 LookupResult lookup(isolate); | 5208 return *JSObject::GetDataProperty(object, key); |
| 5209 object->LookupRealNamedProperty(*key, &lookup); | |
| 5210 if (lookup.IsFound() && !lookup.IsTransition()) { | |
| 5211 switch (lookup.type()) { | |
| 5212 case NORMAL: | |
| 5213 return lookup.holder()->GetNormalizedProperty(&lookup); | |
| 5214 case FIELD: | |
| 5215 return lookup.holder()->FastPropertyAt( | |
| 5216 lookup.representation(), | |
| 5217 lookup.GetFieldIndex().field_index()); | |
| 5218 case CONSTANT: | |
| 5219 return lookup.GetConstant(); | |
| 5220 case CALLBACKS: | |
| 5221 case HANDLER: | |
| 5222 case INTERCEPTOR: | |
| 5223 break; | |
| 5224 case NONEXISTENT: | |
| 5225 UNREACHABLE(); | |
| 5226 } | |
| 5227 } | |
| 5228 return isolate->heap()->undefined_value(); | |
| 5229 } | 5209 } |
| 5230 | 5210 |
| 5231 | 5211 |
| 5232 MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate, | 5212 MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate, |
| 5233 Handle<Object> object, | 5213 Handle<Object> object, |
| 5234 Handle<Object> key, | 5214 Handle<Object> key, |
| 5235 Handle<Object> value, | 5215 Handle<Object> value, |
| 5236 PropertyAttributes attr, | 5216 PropertyAttributes attr, |
| 5237 StrictMode strict_mode) { | 5217 StrictMode strict_mode) { |
| 5238 SetPropertyMode set_mode = attr == NONE ? SET_PROPERTY : DEFINE_PROPERTY; | 5218 SetPropertyMode set_mode = attr == NONE ? SET_PROPERTY : DEFINE_PROPERTY; |
| (...skipping 9928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15167 } | 15147 } |
| 15168 } | 15148 } |
| 15169 | 15149 |
| 15170 | 15150 |
| 15171 void Runtime::OutOfMemory() { | 15151 void Runtime::OutOfMemory() { |
| 15172 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); | 15152 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); |
| 15173 UNREACHABLE(); | 15153 UNREACHABLE(); |
| 15174 } | 15154 } |
| 15175 | 15155 |
| 15176 } } // namespace v8::internal | 15156 } } // namespace v8::internal |
| OLD | NEW |