| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); | 74 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); |
| 75 Handle<JSFunction> constructor; | 75 Handle<JSFunction> constructor; |
| 76 if (object->IsNumber()) { | 76 if (object->IsNumber()) { |
| 77 constructor = handle(native_context->number_function(), isolate); | 77 constructor = handle(native_context->number_function(), isolate); |
| 78 } else if (object->IsBoolean()) { | 78 } else if (object->IsBoolean()) { |
| 79 constructor = handle(native_context->boolean_function(), isolate); | 79 constructor = handle(native_context->boolean_function(), isolate); |
| 80 } else if (object->IsString()) { | 80 } else if (object->IsString()) { |
| 81 constructor = handle(native_context->string_function(), isolate); | 81 constructor = handle(native_context->string_function(), isolate); |
| 82 } else if (object->IsSymbol()) { | 82 } else if (object->IsSymbol()) { |
| 83 constructor = handle(native_context->symbol_function(), isolate); | 83 constructor = handle(native_context->symbol_function(), isolate); |
| 84 } else if (object->IsFloat32x4()) { |
| 85 constructor = handle(native_context->float32x4_function(), isolate); |
| 84 } else { | 86 } else { |
| 85 return MaybeHandle<JSReceiver>(); | 87 return MaybeHandle<JSReceiver>(); |
| 86 } | 88 } |
| 87 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); | 89 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); |
| 88 Handle<JSValue>::cast(result)->set_value(*object); | 90 Handle<JSValue>::cast(result)->set_value(*object); |
| 89 return result; | 91 return result; |
| 90 } | 92 } |
| 91 | 93 |
| 92 | 94 |
| 93 bool Object::BooleanValue() { | 95 bool Object::BooleanValue() { |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 } | 696 } |
| 695 if (heap_object->IsString()) { | 697 if (heap_object->IsString()) { |
| 696 return context->string_function()->initial_map(); | 698 return context->string_function()->initial_map(); |
| 697 } | 699 } |
| 698 if (heap_object->IsSymbol()) { | 700 if (heap_object->IsSymbol()) { |
| 699 return context->symbol_function()->initial_map(); | 701 return context->symbol_function()->initial_map(); |
| 700 } | 702 } |
| 701 if (heap_object->IsBoolean()) { | 703 if (heap_object->IsBoolean()) { |
| 702 return context->boolean_function()->initial_map(); | 704 return context->boolean_function()->initial_map(); |
| 703 } | 705 } |
| 706 if (heap_object->IsFloat32x4()) { |
| 707 return context->float32x4_function()->initial_map(); |
| 708 } |
| 704 return isolate->heap()->null_value()->map(); | 709 return isolate->heap()->null_value()->map(); |
| 705 } | 710 } |
| 706 | 711 |
| 707 | 712 |
| 708 Object* Object::GetHash() { | 713 Object* Object::GetHash() { |
| 709 Object* hash = GetSimpleHash(); | 714 Object* hash = GetSimpleHash(); |
| 710 if (hash->IsSmi()) return hash; | 715 if (hash->IsSmi()) return hash; |
| 711 | 716 |
| 712 DCHECK(IsJSReceiver()); | 717 DCHECK(IsJSReceiver()); |
| 713 return JSReceiver::cast(this)->GetIdentityHash(); | 718 return JSReceiver::cast(this)->GetIdentityHash(); |
| (...skipping 16260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16974 Handle<Object> new_value) { | 16979 Handle<Object> new_value) { |
| 16975 if (cell->value() != *new_value) { | 16980 if (cell->value() != *new_value) { |
| 16976 cell->set_value(*new_value); | 16981 cell->set_value(*new_value); |
| 16977 Isolate* isolate = cell->GetIsolate(); | 16982 Isolate* isolate = cell->GetIsolate(); |
| 16978 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16983 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 16979 isolate, DependentCode::kPropertyCellChangedGroup); | 16984 isolate, DependentCode::kPropertyCellChangedGroup); |
| 16980 } | 16985 } |
| 16981 } | 16986 } |
| 16982 } // namespace internal | 16987 } // namespace internal |
| 16983 } // namespace v8 | 16988 } // namespace v8 |
| OLD | NEW |