| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 "Writing internal field out of bounds")) { | 3237 "Writing internal field out of bounds")) { |
| 3238 return; | 3238 return; |
| 3239 } | 3239 } |
| 3240 ENTER_V8; | 3240 ENTER_V8; |
| 3241 i::Handle<i::Object> val = Utils::OpenHandle(*value); | 3241 i::Handle<i::Object> val = Utils::OpenHandle(*value); |
| 3242 obj->SetInternalField(index, *val); | 3242 obj->SetInternalField(index, *val); |
| 3243 } | 3243 } |
| 3244 | 3244 |
| 3245 | 3245 |
| 3246 static bool CanBeEncodedAsSmi(void* ptr) { | 3246 static bool CanBeEncodedAsSmi(void* ptr) { |
| 3247 const intptr_t address = reinterpret_cast<intptr_t>(ptr); | 3247 const uintptr_t address = reinterpret_cast<uintptr_t>(ptr); |
| 3248 return ((address & i::kEncodablePointerMask) == 0); | 3248 return ((address & i::kEncodablePointerMask) == 0); |
| 3249 } | 3249 } |
| 3250 | 3250 |
| 3251 | 3251 |
| 3252 static i::Smi* EncodeAsSmi(void* ptr) { | 3252 static i::Smi* EncodeAsSmi(void* ptr) { |
| 3253 ASSERT(CanBeEncodedAsSmi(ptr)); | 3253 ASSERT(CanBeEncodedAsSmi(ptr)); |
| 3254 const intptr_t address = reinterpret_cast<intptr_t>(ptr); | 3254 const uintptr_t address = reinterpret_cast<uintptr_t>(ptr); |
| 3255 i::Smi* result = reinterpret_cast<i::Smi*>(address << i::kPointerToSmiShift); | 3255 i::Smi* result = reinterpret_cast<i::Smi*>(address << i::kPointerToSmiShift); |
| 3256 ASSERT(i::Internals::HasSmiTag(result)); | 3256 ASSERT(i::Internals::HasSmiTag(result)); |
| 3257 ASSERT_EQ(result, i::Smi::FromInt(result->value())); | 3257 ASSERT_EQ(result, i::Smi::FromInt(result->value())); |
| 3258 ASSERT_EQ(ptr, i::Internals::GetExternalPointerFromSmi(result)); | 3258 ASSERT_EQ(ptr, i::Internals::GetExternalPointerFromSmi(result)); |
| 3259 return result; | 3259 return result; |
| 3260 } | 3260 } |
| 3261 | 3261 |
| 3262 | 3262 |
| 3263 void v8::Object::SetPointerInInternalField(int index, void* value) { | 3263 void v8::Object::SetPointerInInternalField(int index, void* value) { |
| 3264 ENTER_V8; | 3264 ENTER_V8; |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5032 | 5032 |
| 5033 | 5033 |
| 5034 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5034 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5035 HandleScopeImplementer* thread_local = | 5035 HandleScopeImplementer* thread_local = |
| 5036 reinterpret_cast<HandleScopeImplementer*>(storage); | 5036 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5037 thread_local->IterateThis(v); | 5037 thread_local->IterateThis(v); |
| 5038 return storage + ArchiveSpacePerThread(); | 5038 return storage + ArchiveSpacePerThread(); |
| 5039 } | 5039 } |
| 5040 | 5040 |
| 5041 } } // namespace v8::internal | 5041 } } // namespace v8::internal |
| OLD | NEW |