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

Unified Diff: src/isolate.cc

Issue 1294583006: Clean up native context slots and add new ones. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 47ab368dcc6acd3c30571d683e4d7fa606e5cfdc..59b32ebf1a4229769510a56aae8158a2e63a3db0 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -332,15 +332,12 @@ static bool IsVisibleInStackTrace(JSFunction* fun,
Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSObject> error_object,
Handle<Object> caller) {
// Get stack trace limit.
- Handle<Object> error = Object::GetProperty(
- this, js_builtins_object(), "$Error").ToHandleChecked();
- if (!error->IsJSObject()) return factory()->undefined_value();
-
+ Handle<JSObject> error = error_function();
Handle<String> stackTraceLimit =
factory()->InternalizeUtf8String("stackTraceLimit");
DCHECK(!stackTraceLimit.is_null());
- Handle<Object> stack_trace_limit = JSReceiver::GetDataProperty(
- Handle<JSObject>::cast(error), stackTraceLimit);
+ Handle<Object> stack_trace_limit =
+ JSReceiver::GetDataProperty(error, stackTraceLimit);
if (!stack_trace_limit->IsNumber()) return factory()->undefined_value();
int limit = FastD2IChecked(stack_trace_limit->Number());
limit = Max(limit, 0); // Ensure that limit is not negative.
@@ -1344,12 +1341,7 @@ bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target,
// the Error object.
bool Isolate::IsErrorObject(Handle<Object> obj) {
if (!obj->IsJSObject()) return false;
-
- Handle<String> error_key =
- factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("$Error"));
- Handle<Object> error_constructor = Object::GetProperty(
- js_builtins_object(), error_key).ToHandleChecked();
-
+ Handle<Object> error_constructor = error_function();
DisallowHeapAllocation no_gc;
for (PrototypeIterator iter(this, *obj, PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(); iter.Advance()) {
« no previous file with comments | « src/factory.cc ('k') | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698