Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/isolate.cc

Issue 2405253006: [builtins] implement Array.prototype[@@iterator] in TFJ builtins (Closed)
Patch Set: add array_iterator_protector, and check array_protector in holey fast arrays Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 } 1091 }
1092 1092
1093 // Generate the message if required. 1093 // Generate the message if required.
1094 if (requires_message && !rethrowing_message) { 1094 if (requires_message && !rethrowing_message) {
1095 MessageLocation computed_location; 1095 MessageLocation computed_location;
1096 // If no location was specified we try to use a computed one instead. 1096 // If no location was specified we try to use a computed one instead.
1097 if (location == NULL && ComputeLocation(&computed_location)) { 1097 if (location == NULL && ComputeLocation(&computed_location)) {
1098 location = &computed_location; 1098 location = &computed_location;
1099 } 1099 }
1100 1100
1101 if (bootstrapper()->IsActive()) { 1101 if (false && bootstrapper()->IsActive()) {
1102 // It's not safe to try to make message objects or collect stack traces 1102 // It's not safe to try to make message objects or collect stack traces
1103 // while the bootstrapper is active since the infrastructure may not have 1103 // while the bootstrapper is active since the infrastructure may not have
1104 // been properly initialized. 1104 // been properly initialized.
1105 ReportBootstrappingException(exception_handle, location); 1105 ReportBootstrappingException(exception_handle, location);
1106 } else { 1106 } else {
1107 Handle<Object> message_obj = CreateMessage(exception_handle, location); 1107 Handle<Object> message_obj = CreateMessage(exception_handle, location);
1108 thread_local_top()->pending_message_obj_ = *message_obj; 1108 thread_local_top()->pending_message_obj_ = *message_obj;
1109 1109
1110 // For any exception not caught by JavaScript, even when an external 1110 // For any exception not caught by JavaScript, even when an external
1111 // handler is present: 1111 // handler is present:
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 2917
2918 void Isolate::InvalidateStringLengthOverflowProtector() { 2918 void Isolate::InvalidateStringLengthOverflowProtector() {
2919 DCHECK(factory()->string_length_protector()->value()->IsSmi()); 2919 DCHECK(factory()->string_length_protector()->value()->IsSmi());
2920 DCHECK(IsStringLengthOverflowIntact()); 2920 DCHECK(IsStringLengthOverflowIntact());
2921 PropertyCell::SetValueWithInvalidation( 2921 PropertyCell::SetValueWithInvalidation(
2922 factory()->string_length_protector(), 2922 factory()->string_length_protector(),
2923 handle(Smi::FromInt(kArrayProtectorInvalid), this)); 2923 handle(Smi::FromInt(kArrayProtectorInvalid), this));
2924 DCHECK(!IsStringLengthOverflowIntact()); 2924 DCHECK(!IsStringLengthOverflowIntact());
2925 } 2925 }
2926 2926
2927 void Isolate::InvalidateArrayIteratorProtector() {
2928 DCHECK(Smi::cast(heap()->array_iterator_protector()->value())->value() ==
2929 kArrayProtectorValid);
2930 PropertyCell::SetValueWithInvalidation(
2931 factory()->array_iterator_protector(),
2932 handle(Smi::FromInt(kArrayProtectorInvalid), this));
2933 }
2934
2927 bool Isolate::IsAnyInitialArrayPrototype(Handle<JSArray> array) { 2935 bool Isolate::IsAnyInitialArrayPrototype(Handle<JSArray> array) {
2928 DisallowHeapAllocation no_gc; 2936 DisallowHeapAllocation no_gc;
2929 return IsInAnyContext(*array, Context::INITIAL_ARRAY_PROTOTYPE_INDEX); 2937 return IsInAnyContext(*array, Context::INITIAL_ARRAY_PROTOTYPE_INDEX);
2930 } 2938 }
2931 2939
2932 2940
2933 CallInterfaceDescriptorData* Isolate::call_descriptor_data(int index) { 2941 CallInterfaceDescriptorData* Isolate::call_descriptor_data(int index) {
2934 DCHECK(0 <= index && index < CallDescriptors::NUMBER_OF_DESCRIPTORS); 2942 DCHECK(0 <= index && index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
2935 return &call_descriptor_data_[index]; 2943 return &call_descriptor_data_[index];
2936 } 2944 }
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
3457 // Then check whether this scope intercepts. 3465 // Then check whether this scope intercepts.
3458 if ((flag & intercept_mask_)) { 3466 if ((flag & intercept_mask_)) {
3459 intercepted_flags_ |= flag; 3467 intercepted_flags_ |= flag;
3460 return true; 3468 return true;
3461 } 3469 }
3462 return false; 3470 return false;
3463 } 3471 }
3464 3472
3465 } // namespace internal 3473 } // namespace internal
3466 } // namespace v8 3474 } // namespace v8
OLDNEW
« src/builtins/builtins-array.cc ('K') | « src/isolate.h ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698