| 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 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2596 } | 2596 } |
| 2597 | 2597 |
| 2598 | 2598 |
| 2599 static bool getBoolProperty(const StackFrame* f, const char* propertyName) { | 2599 static bool getBoolProperty(const StackFrame* f, const char* propertyName) { |
| 2600 i::Isolate* isolate = Utils::OpenHandle(f)->GetIsolate(); | 2600 i::Isolate* isolate = Utils::OpenHandle(f)->GetIsolate(); |
| 2601 ENTER_V8(isolate); | 2601 ENTER_V8(isolate); |
| 2602 i::HandleScope scope(isolate); | 2602 i::HandleScope scope(isolate); |
| 2603 i::Handle<i::JSObject> self = Utils::OpenHandle(f); | 2603 i::Handle<i::JSObject> self = Utils::OpenHandle(f); |
| 2604 i::Handle<i::Object> obj = | 2604 i::Handle<i::Object> obj = |
| 2605 i::JSReceiver::GetProperty(isolate, self, propertyName).ToHandleChecked(); | 2605 i::JSReceiver::GetProperty(isolate, self, propertyName).ToHandleChecked(); |
| 2606 return obj->IsTrue(isolate); | 2606 return obj->IsTrue(); |
| 2607 } | 2607 } |
| 2608 | 2608 |
| 2609 bool StackFrame::IsEval() const { return getBoolProperty(this, "isEval"); } | 2609 bool StackFrame::IsEval() const { return getBoolProperty(this, "isEval"); } |
| 2610 | 2610 |
| 2611 | 2611 |
| 2612 bool StackFrame::IsConstructor() const { | 2612 bool StackFrame::IsConstructor() const { |
| 2613 return getBoolProperty(this, "isConstructor"); | 2613 return getBoolProperty(this, "isConstructor"); |
| 2614 } | 2614 } |
| 2615 | 2615 |
| 2616 | 2616 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2764 Local<String> result; | 2764 Local<String> result; |
| 2765 has_pending_exception = | 2765 has_pending_exception = |
| 2766 !ToLocal<String>(i::Object::ToString(isolate, maybe), &result); | 2766 !ToLocal<String>(i::Object::ToString(isolate, maybe), &result); |
| 2767 RETURN_ON_FAILED_EXECUTION(String); | 2767 RETURN_ON_FAILED_EXECUTION(String); |
| 2768 RETURN_ESCAPED(result); | 2768 RETURN_ESCAPED(result); |
| 2769 } | 2769 } |
| 2770 | 2770 |
| 2771 // --- D a t a --- | 2771 // --- D a t a --- |
| 2772 | 2772 |
| 2773 bool Value::FullIsUndefined() const { | 2773 bool Value::FullIsUndefined() const { |
| 2774 i::Handle<i::Object> object = Utils::OpenHandle(this); | 2774 bool result = Utils::OpenHandle(this)->IsUndefined(); |
| 2775 bool result = false; | |
| 2776 if (!object->IsSmi()) { | |
| 2777 result = object->IsUndefined(i::HeapObject::cast(*object)->GetIsolate()); | |
| 2778 } | |
| 2779 DCHECK_EQ(result, QuickIsUndefined()); | 2775 DCHECK_EQ(result, QuickIsUndefined()); |
| 2780 return result; | 2776 return result; |
| 2781 } | 2777 } |
| 2782 | 2778 |
| 2783 | 2779 |
| 2784 bool Value::FullIsNull() const { | 2780 bool Value::FullIsNull() const { |
| 2785 i::Handle<i::Object> object = Utils::OpenHandle(this); | 2781 bool result = Utils::OpenHandle(this)->IsNull(); |
| 2786 bool result = false; | |
| 2787 if (!object->IsSmi()) { | |
| 2788 result = object->IsNull(i::HeapObject::cast(*object)->GetIsolate()); | |
| 2789 } | |
| 2790 DCHECK_EQ(result, QuickIsNull()); | 2782 DCHECK_EQ(result, QuickIsNull()); |
| 2791 return result; | 2783 return result; |
| 2792 } | 2784 } |
| 2793 | 2785 |
| 2794 | 2786 |
| 2795 bool Value::IsTrue() const { | 2787 bool Value::IsTrue() const { |
| 2796 i::Handle<i::Object> object = Utils::OpenHandle(this); | 2788 return Utils::OpenHandle(this)->IsTrue(); |
| 2797 if (object->IsSmi()) return false; | |
| 2798 return object->IsTrue(i::HeapObject::cast(*object)->GetIsolate()); | |
| 2799 } | 2789 } |
| 2800 | 2790 |
| 2801 | 2791 |
| 2802 bool Value::IsFalse() const { | 2792 bool Value::IsFalse() const { |
| 2803 i::Handle<i::Object> object = Utils::OpenHandle(this); | 2793 return Utils::OpenHandle(this)->IsFalse(); |
| 2804 if (object->IsSmi()) return false; | |
| 2805 return object->IsFalse(i::HeapObject::cast(*object)->GetIsolate()); | |
| 2806 } | 2794 } |
| 2807 | 2795 |
| 2808 | 2796 |
| 2809 bool Value::IsFunction() const { return Utils::OpenHandle(this)->IsCallable(); } | 2797 bool Value::IsFunction() const { return Utils::OpenHandle(this)->IsCallable(); } |
| 2810 | 2798 |
| 2811 | 2799 |
| 2812 bool Value::IsName() const { | 2800 bool Value::IsName() const { |
| 2813 return Utils::OpenHandle(this)->IsName(); | 2801 return Utils::OpenHandle(this)->IsName(); |
| 2814 } | 2802 } |
| 2815 | 2803 |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4044 i::Handle<i::JSObject>::cast(Utils::OpenHandle(self)); | 4032 i::Handle<i::JSObject>::cast(Utils::OpenHandle(self)); |
| 4045 v8::Local<AccessorSignature> signature; | 4033 v8::Local<AccessorSignature> signature; |
| 4046 auto info = MakeAccessorInfo(name, getter, setter, data, settings, attributes, | 4034 auto info = MakeAccessorInfo(name, getter, setter, data, settings, attributes, |
| 4047 signature, i::FLAG_disable_old_api_accessors); | 4035 signature, i::FLAG_disable_old_api_accessors); |
| 4048 if (info.is_null()) return Nothing<bool>(); | 4036 if (info.is_null()) return Nothing<bool>(); |
| 4049 bool fast = obj->HasFastProperties(); | 4037 bool fast = obj->HasFastProperties(); |
| 4050 i::Handle<i::Object> result; | 4038 i::Handle<i::Object> result; |
| 4051 has_pending_exception = | 4039 has_pending_exception = |
| 4052 !i::JSObject::SetAccessor(obj, info).ToHandle(&result); | 4040 !i::JSObject::SetAccessor(obj, info).ToHandle(&result); |
| 4053 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 4041 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 4054 if (result->IsUndefined(obj->GetIsolate())) return Nothing<bool>(); | 4042 if (result->IsUndefined()) return Nothing<bool>(); |
| 4055 if (fast) { | 4043 if (fast) { |
| 4056 i::JSObject::MigrateSlowToFast(obj, 0, "APISetAccessor"); | 4044 i::JSObject::MigrateSlowToFast(obj, 0, "APISetAccessor"); |
| 4057 } | 4045 } |
| 4058 return Just(true); | 4046 return Just(true); |
| 4059 } | 4047 } |
| 4060 | 4048 |
| 4061 | 4049 |
| 4062 Maybe<bool> Object::SetAccessor(Local<Context> context, Local<Name> name, | 4050 Maybe<bool> Object::SetAccessor(Local<Context> context, Local<Name> name, |
| 4063 AccessorNameGetterCallback getter, | 4051 AccessorNameGetterCallback getter, |
| 4064 AccessorNameSetterCallback setter, | 4052 AccessorNameSetterCallback setter, |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5334 | 5322 |
| 5335 | 5323 |
| 5336 double Number::Value() const { | 5324 double Number::Value() const { |
| 5337 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 5325 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| 5338 return obj->Number(); | 5326 return obj->Number(); |
| 5339 } | 5327 } |
| 5340 | 5328 |
| 5341 | 5329 |
| 5342 bool Boolean::Value() const { | 5330 bool Boolean::Value() const { |
| 5343 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 5331 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| 5344 return obj->IsTrue(i::HeapObject::cast(*obj)->GetIsolate()); | 5332 return obj->IsTrue(); |
| 5345 } | 5333 } |
| 5346 | 5334 |
| 5347 | 5335 |
| 5348 int64_t Integer::Value() const { | 5336 int64_t Integer::Value() const { |
| 5349 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 5337 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| 5350 if (obj->IsSmi()) { | 5338 if (obj->IsSmi()) { |
| 5351 return i::Smi::cast(*obj)->value(); | 5339 return i::Smi::cast(*obj)->value(); |
| 5352 } else { | 5340 } else { |
| 5353 return static_cast<int64_t>(obj->Number()); | 5341 return static_cast<int64_t>(obj->Number()); |
| 5354 } | 5342 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5425 const char* location = "v8::Object::SetAlignedPointerInInternalField()"; | 5413 const char* location = "v8::Object::SetAlignedPointerInInternalField()"; |
| 5426 if (!InternalFieldOK(obj, index, location)) return; | 5414 if (!InternalFieldOK(obj, index, location)) return; |
| 5427 i::Handle<i::JSObject>::cast(obj) | 5415 i::Handle<i::JSObject>::cast(obj) |
| 5428 ->SetInternalField(index, EncodeAlignedAsSmi(value, location)); | 5416 ->SetInternalField(index, EncodeAlignedAsSmi(value, location)); |
| 5429 DCHECK_EQ(value, GetAlignedPointerFromInternalField(index)); | 5417 DCHECK_EQ(value, GetAlignedPointerFromInternalField(index)); |
| 5430 } | 5418 } |
| 5431 | 5419 |
| 5432 | 5420 |
| 5433 static void* ExternalValue(i::Object* obj) { | 5421 static void* ExternalValue(i::Object* obj) { |
| 5434 // Obscure semantics for undefined, but somehow checked in our unit tests... | 5422 // Obscure semantics for undefined, but somehow checked in our unit tests... |
| 5435 if (!obj->IsSmi() && | 5423 if (obj->IsUndefined()) return NULL; |
| 5436 obj->IsUndefined(i::HeapObject::cast(obj)->GetIsolate())) { | |
| 5437 return NULL; | |
| 5438 } | |
| 5439 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); | 5424 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); |
| 5440 return i::Foreign::cast(foreign)->foreign_address(); | 5425 return i::Foreign::cast(foreign)->foreign_address(); |
| 5441 } | 5426 } |
| 5442 | 5427 |
| 5443 | 5428 |
| 5444 // --- E n v i r o n m e n t --- | 5429 // --- E n v i r o n m e n t --- |
| 5445 | 5430 |
| 5446 | 5431 |
| 5447 void v8::V8::InitializePlatform(Platform* platform) { | 5432 void v8::V8::InitializePlatform(Platform* platform) { |
| 5448 i::V8::InitializePlatform(platform); | 5433 i::V8::InitializePlatform(platform); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5681 i::Handle<i::Context> context = Utils::OpenHandle(this); | 5666 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5682 i::Isolate* isolate = context->GetIsolate(); | 5667 i::Isolate* isolate = context->GetIsolate(); |
| 5683 ENTER_V8(isolate); | 5668 ENTER_V8(isolate); |
| 5684 context->set_allow_code_gen_from_strings( | 5669 context->set_allow_code_gen_from_strings( |
| 5685 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); | 5670 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); |
| 5686 } | 5671 } |
| 5687 | 5672 |
| 5688 | 5673 |
| 5689 bool Context::IsCodeGenerationFromStringsAllowed() { | 5674 bool Context::IsCodeGenerationFromStringsAllowed() { |
| 5690 i::Handle<i::Context> context = Utils::OpenHandle(this); | 5675 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5691 return !context->allow_code_gen_from_strings()->IsFalse( | 5676 return !context->allow_code_gen_from_strings()->IsFalse(); |
| 5692 context->GetIsolate()); | |
| 5693 } | 5677 } |
| 5694 | 5678 |
| 5695 | 5679 |
| 5696 void Context::SetErrorMessageForCodeGenerationFromStrings(Local<String> error) { | 5680 void Context::SetErrorMessageForCodeGenerationFromStrings(Local<String> error) { |
| 5697 i::Handle<i::Context> context = Utils::OpenHandle(this); | 5681 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5698 i::Handle<i::String> error_handle = Utils::OpenHandle(*error); | 5682 i::Handle<i::String> error_handle = Utils::OpenHandle(*error); |
| 5699 context->set_error_message_for_code_gen_from_strings(*error_handle); | 5683 context->set_error_message_for_code_gen_from_strings(*error_handle); |
| 5700 } | 5684 } |
| 5701 | 5685 |
| 5702 | 5686 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6066 Local<v8::Value> v8::BooleanObject::New(bool value) { | 6050 Local<v8::Value> v8::BooleanObject::New(bool value) { |
| 6067 return New(Isolate::GetCurrent(), value); | 6051 return New(Isolate::GetCurrent(), value); |
| 6068 } | 6052 } |
| 6069 | 6053 |
| 6070 | 6054 |
| 6071 bool v8::BooleanObject::ValueOf() const { | 6055 bool v8::BooleanObject::ValueOf() const { |
| 6072 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 6056 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
| 6073 i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj); | 6057 i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj); |
| 6074 i::Isolate* isolate = jsvalue->GetIsolate(); | 6058 i::Isolate* isolate = jsvalue->GetIsolate(); |
| 6075 LOG_API(isolate, BooleanObject, BooleanValue); | 6059 LOG_API(isolate, BooleanObject, BooleanValue); |
| 6076 return jsvalue->value()->IsTrue(isolate); | 6060 return jsvalue->value()->IsTrue(); |
| 6077 } | 6061 } |
| 6078 | 6062 |
| 6079 | 6063 |
| 6080 Local<v8::Value> v8::StringObject::New(Local<String> value) { | 6064 Local<v8::Value> v8::StringObject::New(Local<String> value) { |
| 6081 i::Handle<i::String> string = Utils::OpenHandle(*value); | 6065 i::Handle<i::String> string = Utils::OpenHandle(*value); |
| 6082 i::Isolate* isolate = string->GetIsolate(); | 6066 i::Isolate* isolate = string->GetIsolate(); |
| 6083 LOG_API(isolate, StringObject, New); | 6067 LOG_API(isolate, StringObject, New); |
| 6084 ENTER_V8(isolate); | 6068 ENTER_V8(isolate); |
| 6085 i::Handle<i::Object> obj = | 6069 i::Handle<i::Object> obj = |
| 6086 i::Object::ToObject(isolate, string).ToHandleChecked(); | 6070 i::Object::ToObject(isolate, string).ToHandleChecked(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6313 | 6297 |
| 6314 Maybe<bool> Map::Has(Local<Context> context, Local<Value> key) { | 6298 Maybe<bool> Map::Has(Local<Context> context, Local<Value> key) { |
| 6315 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Map, Has, bool); | 6299 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Map, Has, bool); |
| 6316 auto self = Utils::OpenHandle(this); | 6300 auto self = Utils::OpenHandle(this); |
| 6317 i::Handle<i::Object> result; | 6301 i::Handle<i::Object> result; |
| 6318 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; | 6302 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; |
| 6319 has_pending_exception = !i::Execution::Call(isolate, isolate->map_has(), self, | 6303 has_pending_exception = !i::Execution::Call(isolate, isolate->map_has(), self, |
| 6320 arraysize(argv), argv) | 6304 arraysize(argv), argv) |
| 6321 .ToHandle(&result); | 6305 .ToHandle(&result); |
| 6322 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 6306 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 6323 return Just(result->IsTrue(isolate)); | 6307 return Just(result->IsTrue()); |
| 6324 } | 6308 } |
| 6325 | 6309 |
| 6326 | 6310 |
| 6327 Maybe<bool> Map::Delete(Local<Context> context, Local<Value> key) { | 6311 Maybe<bool> Map::Delete(Local<Context> context, Local<Value> key) { |
| 6328 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Map, Delete, bool); | 6312 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Map, Delete, bool); |
| 6329 auto self = Utils::OpenHandle(this); | 6313 auto self = Utils::OpenHandle(this); |
| 6330 i::Handle<i::Object> result; | 6314 i::Handle<i::Object> result; |
| 6331 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; | 6315 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; |
| 6332 has_pending_exception = !i::Execution::Call(isolate, isolate->map_delete(), | 6316 has_pending_exception = !i::Execution::Call(isolate, isolate->map_delete(), |
| 6333 self, arraysize(argv), argv) | 6317 self, arraysize(argv), argv) |
| 6334 .ToHandle(&result); | 6318 .ToHandle(&result); |
| 6335 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 6319 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 6336 return Just(result->IsTrue(isolate)); | 6320 return Just(result->IsTrue()); |
| 6337 } | 6321 } |
| 6338 | 6322 |
| 6339 | 6323 |
| 6340 Local<Array> Map::AsArray() const { | 6324 Local<Array> Map::AsArray() const { |
| 6341 i::Handle<i::JSMap> obj = Utils::OpenHandle(this); | 6325 i::Handle<i::JSMap> obj = Utils::OpenHandle(this); |
| 6342 i::Isolate* isolate = obj->GetIsolate(); | 6326 i::Isolate* isolate = obj->GetIsolate(); |
| 6343 i::Factory* factory = isolate->factory(); | 6327 i::Factory* factory = isolate->factory(); |
| 6344 LOG_API(isolate, Map, AsArray); | 6328 LOG_API(isolate, Map, AsArray); |
| 6345 ENTER_V8(isolate); | 6329 ENTER_V8(isolate); |
| 6346 i::Handle<i::OrderedHashMap> table(i::OrderedHashMap::cast(obj->table())); | 6330 i::Handle<i::OrderedHashMap> table(i::OrderedHashMap::cast(obj->table())); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6405 | 6389 |
| 6406 Maybe<bool> Set::Has(Local<Context> context, Local<Value> key) { | 6390 Maybe<bool> Set::Has(Local<Context> context, Local<Value> key) { |
| 6407 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Set, Has, bool); | 6391 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Set, Has, bool); |
| 6408 auto self = Utils::OpenHandle(this); | 6392 auto self = Utils::OpenHandle(this); |
| 6409 i::Handle<i::Object> result; | 6393 i::Handle<i::Object> result; |
| 6410 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; | 6394 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; |
| 6411 has_pending_exception = !i::Execution::Call(isolate, isolate->set_has(), self, | 6395 has_pending_exception = !i::Execution::Call(isolate, isolate->set_has(), self, |
| 6412 arraysize(argv), argv) | 6396 arraysize(argv), argv) |
| 6413 .ToHandle(&result); | 6397 .ToHandle(&result); |
| 6414 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 6398 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 6415 return Just(result->IsTrue(isolate)); | 6399 return Just(result->IsTrue()); |
| 6416 } | 6400 } |
| 6417 | 6401 |
| 6418 | 6402 |
| 6419 Maybe<bool> Set::Delete(Local<Context> context, Local<Value> key) { | 6403 Maybe<bool> Set::Delete(Local<Context> context, Local<Value> key) { |
| 6420 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Set, Delete, bool); | 6404 PREPARE_FOR_EXECUTION_PRIMITIVE(context, Set, Delete, bool); |
| 6421 auto self = Utils::OpenHandle(this); | 6405 auto self = Utils::OpenHandle(this); |
| 6422 i::Handle<i::Object> result; | 6406 i::Handle<i::Object> result; |
| 6423 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; | 6407 i::Handle<i::Object> argv[] = {Utils::OpenHandle(*key)}; |
| 6424 has_pending_exception = !i::Execution::Call(isolate, isolate->set_delete(), | 6408 has_pending_exception = !i::Execution::Call(isolate, isolate->set_delete(), |
| 6425 self, arraysize(argv), argv) | 6409 self, arraysize(argv), argv) |
| 6426 .ToHandle(&result); | 6410 .ToHandle(&result); |
| 6427 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 6411 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
| 6428 return Just(result->IsTrue(isolate)); | 6412 return Just(result->IsTrue()); |
| 6429 } | 6413 } |
| 6430 | 6414 |
| 6431 | 6415 |
| 6432 Local<Array> Set::AsArray() const { | 6416 Local<Array> Set::AsArray() const { |
| 6433 i::Handle<i::JSSet> obj = Utils::OpenHandle(this); | 6417 i::Handle<i::JSSet> obj = Utils::OpenHandle(this); |
| 6434 i::Isolate* isolate = obj->GetIsolate(); | 6418 i::Isolate* isolate = obj->GetIsolate(); |
| 6435 i::Factory* factory = isolate->factory(); | 6419 i::Factory* factory = isolate->factory(); |
| 6436 LOG_API(isolate, Set, AsArray); | 6420 LOG_API(isolate, Set, AsArray); |
| 6437 ENTER_V8(isolate); | 6421 ENTER_V8(isolate); |
| 6438 i::Handle<i::OrderedHashSet> table(i::OrderedHashSet::cast(obj->table())); | 6422 i::Handle<i::OrderedHashSet> table(i::OrderedHashSet::cast(obj->table())); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6592 RETURN_TO_LOCAL_UNCHECKED(Then(context, handler), Promise); | 6576 RETURN_TO_LOCAL_UNCHECKED(Then(context, handler), Promise); |
| 6593 } | 6577 } |
| 6594 | 6578 |
| 6595 | 6579 |
| 6596 bool Promise::HasHandler() { | 6580 bool Promise::HasHandler() { |
| 6597 i::Handle<i::JSReceiver> promise = Utils::OpenHandle(this); | 6581 i::Handle<i::JSReceiver> promise = Utils::OpenHandle(this); |
| 6598 i::Isolate* isolate = promise->GetIsolate(); | 6582 i::Isolate* isolate = promise->GetIsolate(); |
| 6599 LOG_API(isolate, Promise, HasRejectHandler); | 6583 LOG_API(isolate, Promise, HasRejectHandler); |
| 6600 ENTER_V8(isolate); | 6584 ENTER_V8(isolate); |
| 6601 i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); | 6585 i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
| 6602 return i::JSReceiver::GetDataProperty(promise, key)->IsTrue(isolate); | 6586 return i::JSReceiver::GetDataProperty(promise, key)->IsTrue(); |
| 6603 } | 6587 } |
| 6604 | 6588 |
| 6605 | 6589 |
| 6606 Local<Object> Proxy::GetTarget() { | 6590 Local<Object> Proxy::GetTarget() { |
| 6607 i::Handle<i::JSProxy> self = Utils::OpenHandle(this); | 6591 i::Handle<i::JSProxy> self = Utils::OpenHandle(this); |
| 6608 i::Handle<i::JSReceiver> target(self->target()); | 6592 i::Handle<i::JSReceiver> target(self->target()); |
| 6609 return Utils::ToLocal(target); | 6593 return Utils::ToLocal(target); |
| 6610 } | 6594 } |
| 6611 | 6595 |
| 6612 | 6596 |
| (...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8810 Address callback_address = | 8794 Address callback_address = |
| 8811 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8795 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8812 VMState<EXTERNAL> state(isolate); | 8796 VMState<EXTERNAL> state(isolate); |
| 8813 ExternalCallbackScope call_scope(isolate, callback_address); | 8797 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8814 callback(info); | 8798 callback(info); |
| 8815 } | 8799 } |
| 8816 | 8800 |
| 8817 | 8801 |
| 8818 } // namespace internal | 8802 } // namespace internal |
| 8819 } // namespace v8 | 8803 } // namespace v8 |
| OLD | NEW |