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

Side by Side Diff: vm/stack_frame_test.cc

Issue 10030001: Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DartFrame* frame = frames.NextFrame(); 89 DartFrame* frame = frames.NextFrame();
90 while (frame != NULL) { 90 while (frame != NULL) {
91 if (count == frame_index) { 91 if (count == frame_index) {
92 // Find the function corresponding to this frame and check if it 92 // Find the function corresponding to this frame and check if it
93 // matches the function name passed in. 93 // matches the function name passed in.
94 const Function& function = 94 const Function& function =
95 Function::Handle(frame->LookupDartFunction()); 95 Function::Handle(frame->LookupDartFunction());
96 if (function.IsNull()) { 96 if (function.IsNull()) {
97 FATAL("StackFrame_validateFrame fails, invalid dart frame.\n"); 97 FATAL("StackFrame_validateFrame fails, invalid dart frame.\n");
98 } 98 }
99 const Code& code = Code::Handle(frame->LookupDartCode());
100 EXPECT(code.raw() == function.unoptimized_code());
99 const char* name = function.ToFullyQualifiedCString(); 101 const char* name = function.ToFullyQualifiedCString();
100 // Currently all unit tests are loaded as being part of dart:core-lib. 102 // Currently all unit tests are loaded as being part of dart:core-lib.
101 Isolate* isolate = Isolate::Current(); 103 Isolate* isolate = Isolate::Current();
102 String& url = String::Handle(String::New(TestCase::url())); 104 String& url = String::Handle(String::New(TestCase::url()));
103 const Library& lib = Library::Handle(Library::LookupLibrary(url)); 105 const Library& lib = Library::Handle(Library::LookupLibrary(url));
104 ASSERT(!lib.IsNull()); 106 ASSERT(!lib.IsNull());
105 const char* lib_name = String::Handle(lib.url()).ToCString(); 107 const char* lib_name = String::Handle(lib.url()).ToCString();
106 intptr_t length = OS::SNPrint(NULL, 0, "%s_%s", lib_name, expected_name); 108 intptr_t length = OS::SNPrint(NULL, 0, "%s_%s", lib_name, expected_name);
107 char* full_name = reinterpret_cast<char*>( 109 char* full_name = reinterpret_cast<char*>(
108 isolate->current_zone()->Allocate(length + 1)); 110 isolate->current_zone()->Allocate(length + 1));
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); 296 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
295 Dart_InvokeStatic(lib, 297 Dart_InvokeStatic(lib,
296 Dart_NewString("StackFrame2Test"), 298 Dart_NewString("StackFrame2Test"),
297 Dart_NewString("testMain"), 299 Dart_NewString("testMain"),
298 0, 300 0,
299 NULL); 301 NULL);
300 } 302 }
301 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. 303 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64.
302 304
303 } // namespace dart 305 } // namespace dart
OLDNEW
« vm/stack_frame.cc ('K') | « vm/stack_frame.cc ('k') | vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698