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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 JSArray* holder = FindInPrototypeChain<JSArray>(object, &found_it); | 85 JSArray* holder = FindInPrototypeChain<JSArray>(object, &found_it); |
86 if (!found_it) return Smi::FromInt(0); | 86 if (!found_it) return Smi::FromInt(0); |
87 return holder->length(); | 87 return holder->length(); |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 // The helper function will 'flatten' Number objects. | 91 // The helper function will 'flatten' Number objects. |
92 Object* Accessors::FlattenNumber(Object* value) { | 92 Object* Accessors::FlattenNumber(Object* value) { |
93 if (value->IsNumber() || !value->IsJSValue()) return value; | 93 if (value->IsNumber() || !value->IsJSValue()) return value; |
94 JSValue* wrapper = JSValue::cast(value); | 94 JSValue* wrapper = JSValue::cast(value); |
95 ASSERT(Isolate::Current()->context()->global_context()->number_function()-> | 95 ASSERT(Isolate::Current()->context()->native_context()->number_function()-> |
96 has_initial_map()); | 96 has_initial_map()); |
97 Map* number_map = Isolate::Current()->context()->global_context()-> | 97 Map* number_map = Isolate::Current()->context()->native_context()-> |
98 number_function()->initial_map(); | 98 number_function()->initial_map(); |
99 if (wrapper->map() == number_map) return wrapper->value(); | 99 if (wrapper->map() == number_map) return wrapper->value(); |
100 return value; | 100 return value; |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 MaybeObject* Accessors::ArraySetLength(JSObject* object, Object* value, void*) { | 104 MaybeObject* Accessors::ArraySetLength(JSObject* object, Object* value, void*) { |
105 Isolate* isolate = object->GetIsolate(); | 105 Isolate* isolate = object->GetIsolate(); |
106 | 106 |
107 // This means one of the object's prototypes is a JSArray and the | 107 // This means one of the object's prototypes is a JSArray and the |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 info->set_data(Smi::FromInt(index)); | 861 info->set_data(Smi::FromInt(index)); |
862 Handle<Object> getter = v8::FromCData(&ModuleGetExport); | 862 Handle<Object> getter = v8::FromCData(&ModuleGetExport); |
863 Handle<Object> setter = v8::FromCData(&ModuleSetExport); | 863 Handle<Object> setter = v8::FromCData(&ModuleSetExport); |
864 info->set_getter(*getter); | 864 info->set_getter(*getter); |
865 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 865 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
866 return info; | 866 return info; |
867 } | 867 } |
868 | 868 |
869 | 869 |
870 } } // namespace v8::internal | 870 } } // namespace v8::internal |
OLD | NEW |