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

Side by Side Diff: vm/stub_code_ia32_test.cc

Issue 10173008: Simplify representation of stack frames. Remove the special types DartFrame/StubFrame and instead u… (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
« no previous file with comments | « vm/stub_code_ia32.cc ('k') | vm/stub_code_x64.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/native_entry.h" 10 #include "vm/native_entry.h"
(...skipping 18 matching lines...) Expand all
29 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); 29 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
30 const Object& result = Object::ZoneHandle(); 30 const Object& result = Object::ZoneHandle();
31 const Context& context = Context::ZoneHandle(Context::New(0)); 31 const Context& context = Context::ZoneHandle(Context::New(0));
32 ASSERT(context.isolate() == Isolate::Current()); 32 ASSERT(context.isolate() == Isolate::Current());
33 __ enter(Immediate(0)); 33 __ enter(Immediate(0));
34 __ LoadObject(CTX, context); 34 __ LoadObject(CTX, context);
35 __ PushObject(result); // Push Null object for return value. 35 __ PushObject(result); // Push Null object for return value.
36 __ PushObject(smi1); // Push argument 1 smi1. 36 __ PushObject(smi1); // Push argument 1 smi1.
37 __ PushObject(smi2); // Push argument 2 smi2. 37 __ PushObject(smi2); // Push argument 2 smi2.
38 ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc); 38 ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
39 __ CallRuntimeFromStub(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func. 39 __ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func.
40 __ AddImmediate(ESP, Immediate(argc * kWordSize)); 40 __ AddImmediate(ESP, Immediate(argc * kWordSize));
41 __ popl(EAX); // Pop return value from return slot. 41 __ popl(EAX); // Pop return value from return slot.
42 __ leave(); 42 __ leave();
43 __ ret(); 43 __ ret();
44 } 44 }
45 45
46 46
47 TEST_CASE(CallRuntimeStubCode) { 47 TEST_CASE(CallRuntimeStubCode) {
48 extern const Function& RegisterFakeFunction(const char* name, 48 extern const Function& RegisterFakeFunction(const char* name,
49 const Code& code); 49 const Code& code);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 GrowableArray<const Object*> arguments; 106 GrowableArray<const Object*> arguments;
107 const Array& kNoArgumentNames = Array::Handle(); 107 const Array& kNoArgumentNames = Array::Handle();
108 Smi& result = Smi::Handle(); 108 Smi& result = Smi::Handle();
109 result ^= DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); 109 result ^= DartEntry::InvokeStatic(function, arguments, kNoArgumentNames);
110 EXPECT_EQ((value1 - value2), result.Value()); 110 EXPECT_EQ((value1 - value2), result.Value());
111 } 111 }
112 112
113 } // namespace dart 113 } // namespace dart
114 114
115 #endif // defined TARGET_ARCH_IA32 115 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « vm/stub_code_ia32.cc ('k') | vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698