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

Side by Side Diff: test/cctest/test-api.cc

Issue 19775017: Fix call stack sampling for the case when native callback invokes JS function (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed test failure in debug mode Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/vm-state-inl.h ('k') | test/cctest/test-cpu-profiler.cc » ('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 // 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "compilation-cache.h" 42 #include "compilation-cache.h"
43 #include "cpu-profiler.h" 43 #include "cpu-profiler.h"
44 #include "execution.h" 44 #include "execution.h"
45 #include "isolate.h" 45 #include "isolate.h"
46 #include "objects.h" 46 #include "objects.h"
47 #include "parser.h" 47 #include "parser.h"
48 #include "platform.h" 48 #include "platform.h"
49 #include "snapshot.h" 49 #include "snapshot.h"
50 #include "unicode-inl.h" 50 #include "unicode-inl.h"
51 #include "utils.h" 51 #include "utils.h"
52 #include "vm-state.h"
52 53
53 static const bool kLogThreading = false; 54 static const bool kLogThreading = false;
54 55
55 using ::v8::AccessorInfo; 56 using ::v8::AccessorInfo;
56 using ::v8::Arguments; 57 using ::v8::Arguments;
57 using ::v8::Context; 58 using ::v8::Context;
58 using ::v8::Extension; 59 using ::v8::Extension;
59 using ::v8::Function; 60 using ::v8::Function;
60 using ::v8::FunctionTemplate; 61 using ::v8::FunctionTemplate;
61 using ::v8::Handle; 62 using ::v8::Handle;
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 CHECK(!(*o)->IsTheHole() && !(*o)->IsUndefined()); 842 CHECK(!(*o)->IsTheHole() && !(*o)->IsUndefined());
842 rv.Set(v8::Handle<v8::Object>()); 843 rv.Set(v8::Handle<v8::Object>());
843 CHECK((*o)->IsTheHole() || (*o)->IsUndefined()); 844 CHECK((*o)->IsTheHole() || (*o)->IsUndefined());
844 CHECK_EQ(is_runtime, (*o)->IsTheHole()); 845 CHECK_EQ(is_runtime, (*o)->IsTheHole());
845 846
846 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(t.GetIsolate()); 847 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(t.GetIsolate());
847 // If CPU profiler is active check that when API callback is invoked 848 // If CPU profiler is active check that when API callback is invoked
848 // VMState is set to EXTERNAL. 849 // VMState is set to EXTERNAL.
849 if (isolate->cpu_profiler()->is_profiling()) { 850 if (isolate->cpu_profiler()->is_profiling()) {
850 CHECK_EQ(i::EXTERNAL, isolate->current_vm_state()); 851 CHECK_EQ(i::EXTERNAL, isolate->current_vm_state());
851 CHECK(isolate->external_callback()); 852 CHECK(isolate->external_callback_scope());
852 CHECK_EQ(callback, isolate->external_callback()); 853 CHECK_EQ(callback, isolate->external_callback_scope()->callback());
853 } 854 }
854 } 855 }
855 856
856 857
857 static void handle_callback_impl(const v8::FunctionCallbackInfo<Value>& info, 858 static void handle_callback_impl(const v8::FunctionCallbackInfo<Value>& info,
858 i::Address callback) { 859 i::Address callback) {
859 ApiTestFuzzer::Fuzz(); 860 ApiTestFuzzer::Fuzz();
860 CheckReturnValue(info, callback); 861 CheckReturnValue(info, callback);
861 info.GetReturnValue().Set(v8_str("bad value")); 862 info.GetReturnValue().Set(v8_str("bad value"));
862 info.GetReturnValue().Set(v8_num(102)); 863 info.GetReturnValue().Set(v8_num(102));
(...skipping 19033 matching lines...) Expand 10 before | Expand all | Expand 10 after
19896 CheckCorrectThrow("%HasProperty(other, 'x')"); 19897 CheckCorrectThrow("%HasProperty(other, 'x')");
19897 CheckCorrectThrow("%HasElement(other, 1)"); 19898 CheckCorrectThrow("%HasElement(other, 1)");
19898 CheckCorrectThrow("%IsPropertyEnumerable(other, 'x')"); 19899 CheckCorrectThrow("%IsPropertyEnumerable(other, 'x')");
19899 CheckCorrectThrow("%GetPropertyNames(other)"); 19900 CheckCorrectThrow("%GetPropertyNames(other)");
19900 CheckCorrectThrow("%GetLocalPropertyNames(other, true)"); 19901 CheckCorrectThrow("%GetLocalPropertyNames(other, true)");
19901 CheckCorrectThrow("%DefineOrRedefineAccessorProperty(" 19902 CheckCorrectThrow("%DefineOrRedefineAccessorProperty("
19902 "other, 'x', null, null, 1)"); 19903 "other, 'x', null, null, 1)");
19903 } 19904 }
19904 19905
19905 #endif // WIN32 19906 #endif // WIN32
OLDNEW
« no previous file with comments | « src/vm-state-inl.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698