| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 4978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4989 return Utils::ToLocal(value); | 4989 return Utils::ToLocal(value); |
| 4990 } | 4990 } |
| 4991 | 4991 |
| 4992 | 4992 |
| 4993 void v8::Object::SetInternalField(int index, v8::Handle<Value> value) { | 4993 void v8::Object::SetInternalField(int index, v8::Handle<Value> value) { |
| 4994 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 4994 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
| 4995 const char* location = "v8::Object::SetInternalField()"; | 4995 const char* location = "v8::Object::SetInternalField()"; |
| 4996 if (!InternalFieldOK(obj, index, location)) return; | 4996 if (!InternalFieldOK(obj, index, location)) return; |
| 4997 i::Handle<i::Object> val = Utils::OpenHandle(*value); | 4997 i::Handle<i::Object> val = Utils::OpenHandle(*value); |
| 4998 obj->SetInternalField(index, *val); | 4998 obj->SetInternalField(index, *val); |
| 4999 DCHECK_EQ(value, GetInternalField(index)); | 4999 DCHECK(value->Equals(GetInternalField(index))); |
| 5000 } | 5000 } |
| 5001 | 5001 |
| 5002 | 5002 |
| 5003 void* v8::Object::SlowGetAlignedPointerFromInternalField(int index) { | 5003 void* v8::Object::SlowGetAlignedPointerFromInternalField(int index) { |
| 5004 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 5004 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
| 5005 const char* location = "v8::Object::GetAlignedPointerFromInternalField()"; | 5005 const char* location = "v8::Object::GetAlignedPointerFromInternalField()"; |
| 5006 if (!InternalFieldOK(obj, index, location)) return NULL; | 5006 if (!InternalFieldOK(obj, index, location)) return NULL; |
| 5007 return DecodeSmiToAligned(obj->GetInternalField(index), location); | 5007 return DecodeSmiToAligned(obj->GetInternalField(index), location); |
| 5008 } | 5008 } |
| 5009 | 5009 |
| (...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7669 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7669 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7670 Address callback_address = | 7670 Address callback_address = |
| 7671 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7671 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7672 VMState<EXTERNAL> state(isolate); | 7672 VMState<EXTERNAL> state(isolate); |
| 7673 ExternalCallbackScope call_scope(isolate, callback_address); | 7673 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7674 callback(info); | 7674 callback(info); |
| 7675 } | 7675 } |
| 7676 | 7676 |
| 7677 | 7677 |
| 7678 } } // namespace v8::internal | 7678 } } // namespace v8::internal |
| OLD | NEW |