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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 | 1080 |
1081 | 1081 |
1082 Failure* Isolate::StackOverflow() { | 1082 Failure* Isolate::StackOverflow() { |
1083 HandleScope scope(this); | 1083 HandleScope scope(this); |
1084 // At this point we cannot create an Error object using its javascript | 1084 // At this point we cannot create an Error object using its javascript |
1085 // constructor. Instead, we copy the pre-constructed boilerplate and | 1085 // constructor. Instead, we copy the pre-constructed boilerplate and |
1086 // attach the stack trace as a hidden property. | 1086 // attach the stack trace as a hidden property. |
1087 Handle<String> key = factory()->stack_overflow_string(); | 1087 Handle<String> key = factory()->stack_overflow_string(); |
1088 Handle<JSObject> boilerplate = | 1088 Handle<JSObject> boilerplate = |
1089 Handle<JSObject>::cast(GetProperty(this, js_builtins_object(), key)); | 1089 Handle<JSObject>::cast(GetProperty(this, js_builtins_object(), key)); |
1090 Handle<JSObject> exception = Copy(boilerplate); | 1090 Handle<JSObject> exception = JSObject::Copy(boilerplate); |
1091 DoThrow(*exception, NULL); | 1091 DoThrow(*exception, NULL); |
1092 | 1092 |
1093 // Get stack trace limit. | 1093 // Get stack trace limit. |
1094 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); | 1094 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); |
1095 if (!error->IsJSObject()) return Failure::Exception(); | 1095 if (!error->IsJSObject()) return Failure::Exception(); |
1096 Handle<Object> stack_trace_limit = | 1096 Handle<Object> stack_trace_limit = |
1097 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); | 1097 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); |
1098 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); | 1098 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); |
1099 double dlimit = stack_trace_limit->Number(); | 1099 double dlimit = stack_trace_limit->Number(); |
1100 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); | 1100 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); |
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 | 2525 |
2526 #ifdef DEBUG | 2526 #ifdef DEBUG |
2527 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2527 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2528 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2528 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2529 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2529 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2530 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2530 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2531 #undef ISOLATE_FIELD_OFFSET | 2531 #undef ISOLATE_FIELD_OFFSET |
2532 #endif | 2532 #endif |
2533 | 2533 |
2534 } } // namespace v8::internal | 2534 } } // namespace v8::internal |
OLD | NEW |