Index: src/objects.cc |
=================================================================== |
--- src/objects.cc (revision 11527) |
+++ src/objects.cc (working copy) |
@@ -8096,6 +8096,22 @@ |
} |
+int SharedFunctionInfo::SearchOptimizedCodeMap(Context* global_context) { |
+ ASSERT(global_context->IsGlobalContext()); |
+ Object* value = optimized_code_map(); |
+ if (!value->IsSmi()) { |
+ FixedArray* optimized_code_map = FixedArray::cast(value); |
+ int length = optimized_code_map->length(); |
+ for (int i = 0; i < length; i += 3) { |
+ if (optimized_code_map->get(i) == global_context) { |
+ return i + 1; |
+ } |
+ } |
+ } |
+ return -1; |
+} |
+ |
+ |
void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) { |
v->VisitSharedFunctionInfo(this); |
SharedFunctionInfo::BodyDescriptor::IterateBody(this, v); |
@@ -8381,11 +8397,14 @@ |
case Translation::JS_FRAME: { |
int ast_id = iterator.Next(); |
int function_id = iterator.Next(); |
- JSFunction* function = |
- JSFunction::cast(LiteralArray()->get(function_id)); |
unsigned height = iterator.Next(); |
PrintF(out, "{ast_id=%d, function=", ast_id); |
- function->PrintName(out); |
+ if (function_id != Translation::kSelfLiteralId) { |
+ Object* function = LiteralArray()->get(function_id); |
+ JSFunction::cast(function)->PrintName(out); |
+ } else { |
+ PrintF(out, "<self>"); |
+ } |
PrintF(out, ", height=%u}", height); |
break; |
} |