| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 { | 73 { |
| 74 i::DisallowHeapAllocation no_gc; | 74 i::DisallowHeapAllocation no_gc; |
| 75 Vector<const uint8_t> func_pos_str = i::OneByteVector(func_pos_src); | 75 Vector<const uint8_t> func_pos_str = i::OneByteVector(func_pos_src); |
| 76 String::FlatContent script_content = script_src->GetFlatContent(); | 76 String::FlatContent script_content = script_src->GetFlatContent(); |
| 77 func_pos = SearchString(isolate, script_content.ToOneByteVector(), | 77 func_pos = SearchString(isolate, script_content.ToOneByteVector(), |
| 78 func_pos_str, 0); | 78 func_pos_str, 0); |
| 79 } | 79 } |
| 80 CHECK_NE(0, func_pos); | 80 CHECK_NE(0, func_pos); |
| 81 | 81 |
| 82 // Obtain SharedFunctionInfo for the function. | 82 // Obtain SharedFunctionInfo for the function. |
| 83 isolate->debug()->PrepareForBreakPoints(); | |
| 84 Handle<SharedFunctionInfo> shared_func_info = | 83 Handle<SharedFunctionInfo> shared_func_info = |
| 85 Handle<SharedFunctionInfo>::cast( | 84 Handle<SharedFunctionInfo>::cast( |
| 86 isolate->debug()->FindSharedFunctionInfoInScript(i_script, func_pos)); | 85 isolate->debug()->FindSharedFunctionInfoInScript(i_script, func_pos)); |
| 87 | 86 |
| 88 // Verify inferred function name. | 87 // Verify inferred function name. |
| 89 SmartArrayPointer<char> inferred_name = | 88 SmartArrayPointer<char> inferred_name = |
| 90 shared_func_info->inferred_name()->ToCString(); | 89 shared_func_info->inferred_name()->ToCString(); |
| 91 CHECK_EQ(0, strcmp(ref_inferred_name, inferred_name.get())); | 90 CHECK_EQ(0, strcmp(ref_inferred_name, inferred_name.get())); |
| 92 } | 91 } |
| 93 | 92 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 " };\n" | 496 " };\n" |
| 498 " var foo = 10;\n" | 497 " var foo = 10;\n" |
| 499 " function f() {\n" | 498 " function f() {\n" |
| 500 " return wrapCode();\n" | 499 " return wrapCode();\n" |
| 501 " }\n" | 500 " }\n" |
| 502 " this.ref = f;\n" | 501 " this.ref = f;\n" |
| 503 "})()"); | 502 "})()"); |
| 504 script->Run(); | 503 script->Run(); |
| 505 CheckFunctionName(script, "return 2012", ""); | 504 CheckFunctionName(script, "return 2012", ""); |
| 506 } | 505 } |
| OLD | NEW |