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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 | 107 |
108 MaybeObject* Accessors::ArraySetLength(Isolate* isolate, | 108 MaybeObject* Accessors::ArraySetLength(Isolate* isolate, |
109 JSObject* object, | 109 JSObject* object, |
110 Object* value, | 110 Object* value, |
111 void*) { | 111 void*) { |
112 // This means one of the object's prototypes is a JSArray and the | 112 // This means one of the object's prototypes is a JSArray and the |
113 // object does not have a 'length' property. Calling SetProperty | 113 // object does not have a 'length' property. Calling SetProperty |
114 // causes an infinite loop. | 114 // causes an infinite loop. |
115 if (!object->IsJSArray()) { | 115 if (!object->IsJSArray()) { |
116 return object->SetLocalPropertyIgnoreAttributesTrampoline( | 116 return object->SetLocalPropertyIgnoreAttributes( |
117 isolate->heap()->length_string(), value, NONE); | 117 isolate->heap()->length_string(), value, NONE); |
118 } | 118 } |
119 | 119 |
120 value = FlattenNumber(isolate, value); | 120 value = FlattenNumber(isolate, value); |
121 | 121 |
122 // Need to call methods that may trigger GC. | 122 // Need to call methods that may trigger GC. |
123 HandleScope scope(isolate); | 123 HandleScope scope(isolate); |
124 | 124 |
125 // Protect raw pointers. | 125 // Protect raw pointers. |
126 Handle<JSArray> array_handle(JSArray::cast(object), isolate); | 126 Handle<JSArray> array_handle(JSArray::cast(object), isolate); |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 MaybeObject* Accessors::FunctionSetPrototype(Isolate* isolate, | 525 MaybeObject* Accessors::FunctionSetPrototype(Isolate* isolate, |
526 JSObject* object, | 526 JSObject* object, |
527 Object* value_raw, | 527 Object* value_raw, |
528 void*) { | 528 void*) { |
529 Heap* heap = isolate->heap(); | 529 Heap* heap = isolate->heap(); |
530 JSFunction* function_raw = FindInstanceOf<JSFunction>(isolate, object); | 530 JSFunction* function_raw = FindInstanceOf<JSFunction>(isolate, object); |
531 if (function_raw == NULL) return heap->undefined_value(); | 531 if (function_raw == NULL) return heap->undefined_value(); |
532 if (!function_raw->should_have_prototype()) { | 532 if (!function_raw->should_have_prototype()) { |
533 // Since we hit this accessor, object will have no prototype property. | 533 // Since we hit this accessor, object will have no prototype property. |
534 return object->SetLocalPropertyIgnoreAttributesTrampoline( | 534 return object->SetLocalPropertyIgnoreAttributes(heap->prototype_string(), |
535 heap->prototype_string(), value_raw, NONE); | 535 value_raw, |
| 536 NONE); |
536 } | 537 } |
537 | 538 |
538 HandleScope scope(isolate); | 539 HandleScope scope(isolate); |
539 Handle<JSFunction> function(function_raw, isolate); | 540 Handle<JSFunction> function(function_raw, isolate); |
540 Handle<Object> value(value_raw, isolate); | 541 Handle<Object> value(value_raw, isolate); |
541 | 542 |
542 Handle<Object> old_value; | 543 Handle<Object> old_value; |
543 bool is_observed = | 544 bool is_observed = |
544 FLAG_harmony_observation && | 545 FLAG_harmony_observation && |
545 *function == object && | 546 *function == object && |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 info->set_data(Smi::FromInt(index)); | 908 info->set_data(Smi::FromInt(index)); |
908 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 909 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
909 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 910 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
910 info->set_getter(*getter); | 911 info->set_getter(*getter); |
911 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 912 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
912 return info; | 913 return info; |
913 } | 914 } |
914 | 915 |
915 | 916 |
916 } } // namespace v8::internal | 917 } } // namespace v8::internal |
OLD | NEW |