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

Side by Side Diff: src/isolate.cc

Issue 1293113002: Remove property loads from js builtins objects from runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix stack overflow during bootstrapping Created 5 years, 4 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
« no previous file with comments | « src/heap/heap.h ('k') | src/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 838
839 const char* const Isolate::kStackOverflowMessage = 839 const char* const Isolate::kStackOverflowMessage =
840 "Uncaught RangeError: Maximum call stack size exceeded"; 840 "Uncaught RangeError: Maximum call stack size exceeded";
841 841
842 842
843 Object* Isolate::StackOverflow() { 843 Object* Isolate::StackOverflow() {
844 HandleScope scope(this); 844 HandleScope scope(this);
845 // At this point we cannot create an Error object using its javascript 845 // At this point we cannot create an Error object using its javascript
846 // constructor. Instead, we copy the pre-constructed boilerplate and 846 // constructor. Instead, we copy the pre-constructed boilerplate and
847 // attach the stack trace as a hidden property. 847 // attach the stack trace as a hidden property.
848 Handle<String> key = factory()->stack_overflow_string(); 848 Handle<Object> exception;
849 Handle<Object> boilerplate = 849 if (bootstrapper()->IsActive()) {
850 Object::GetProperty(js_builtins_object(), key).ToHandleChecked(); 850 // There is no boilerplate to use during bootstrapping.
851 if (boilerplate->IsUndefined()) { 851 exception = factory()->NewStringFromAsciiChecked(
852 return Throw(heap()->undefined_value(), nullptr); 852 MessageTemplate::TemplateString(MessageTemplate::kStackOverflow));
853 } else {
854 Handle<JSObject> boilerplate = stack_overflow_boilerplate();
855 Handle<JSObject> copy = factory()->CopyJSObject(boilerplate);
856 CaptureAndSetSimpleStackTrace(copy, factory()->undefined_value());
857 exception = copy;
853 } 858 }
854 Handle<JSObject> exception =
855 factory()->CopyJSObject(Handle<JSObject>::cast(boilerplate));
856 Throw(*exception, nullptr); 859 Throw(*exception, nullptr);
857 860
858 CaptureAndSetSimpleStackTrace(exception, factory()->undefined_value());
859 #ifdef VERIFY_HEAP 861 #ifdef VERIFY_HEAP
860 if (FLAG_verify_heap && FLAG_stress_compaction) { 862 if (FLAG_verify_heap && FLAG_stress_compaction) {
861 heap()->CollectAllAvailableGarbage("trigger compaction"); 863 heap()->CollectAllAvailableGarbage("trigger compaction");
862 } 864 }
863 #endif // VERIFY_HEAP 865 #endif // VERIFY_HEAP
864 866
865 return heap()->exception(); 867 return heap()->exception();
866 } 868 }
867 869
868 870
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 // Then check whether this scope intercepts. 2817 // Then check whether this scope intercepts.
2816 if ((flag & intercept_mask_)) { 2818 if ((flag & intercept_mask_)) {
2817 intercepted_flags_ |= flag; 2819 intercepted_flags_ |= flag;
2818 return true; 2820 return true;
2819 } 2821 }
2820 return false; 2822 return false;
2821 } 2823 }
2822 2824
2823 } // namespace internal 2825 } // namespace internal
2824 } // namespace v8 2826 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698