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

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 1288953003: Port "Add mapping from address to id for runtime functions." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // No generational barrier needed, since array is in new space. 346 // No generational barrier needed, since array is in new space.
347 __ InitializeFieldNoBarrier(EAX, Address(ECX, 0), EDI); 347 __ InitializeFieldNoBarrier(EAX, Address(ECX, 0), EDI);
348 __ AddImmediate(ECX, Immediate(kWordSize)); 348 __ AddImmediate(ECX, Immediate(kWordSize));
349 __ AddImmediate(EBX, Immediate(-kWordSize)); 349 __ AddImmediate(EBX, Immediate(-kWordSize));
350 __ Bind(&loop_condition); 350 __ Bind(&loop_condition);
351 __ decl(EDX); 351 __ decl(EDX);
352 __ j(POSITIVE, &loop, Assembler::kNearJump); 352 __ j(POSITIVE, &loop, Assembler::kNearJump);
353 } 353 }
354 354
355 355
356 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
357 intptr_t deopt_reason,
358 uword saved_registers_address);
359
360 DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
361
362
363 // Used by eager and lazy deoptimization. Preserve result in EAX if necessary. 356 // Used by eager and lazy deoptimization. Preserve result in EAX if necessary.
364 // This stub translates optimized frame into unoptimized frame. The optimized 357 // This stub translates optimized frame into unoptimized frame. The optimized
365 // frame can contain values in registers and on stack, the unoptimized 358 // frame can contain values in registers and on stack, the unoptimized
366 // frame contains all values on stack. 359 // frame contains all values on stack.
367 // Deoptimization occurs in following steps: 360 // Deoptimization occurs in following steps:
368 // - Push all registers that can contain values. 361 // - Push all registers that can contain values.
369 // - Call C routine to copy the stack and saved registers into temporary buffer. 362 // - Call C routine to copy the stack and saved registers into temporary buffer.
370 // - Adjust caller's frame to correct unoptimized frame size. 363 // - Adjust caller's frame to correct unoptimized frame size.
371 // - Fill the unoptimized frame. 364 // - Fill the unoptimized frame.
372 // - Materialize objects that require allocation (e.g. Double instances). 365 // - Materialize objects that require allocation (e.g. Double instances).
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 __ pushl(EDX); 915 __ pushl(EDX);
923 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. 916 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
924 __ popl(EAX); // Pop number of context variables argument. 917 __ popl(EAX); // Pop number of context variables argument.
925 __ popl(EAX); // Pop the new context object. 918 __ popl(EAX); // Pop the new context object.
926 // EAX: new object 919 // EAX: new object
927 // Restore the frame pointer. 920 // Restore the frame pointer.
928 __ LeaveFrame(); 921 __ LeaveFrame();
929 __ ret(); 922 __ ret();
930 } 923 }
931 924
932 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
933 925
934 // Helper stub to implement Assembler::StoreIntoObject. 926 // Helper stub to implement Assembler::StoreIntoObject.
935 // Input parameters: 927 // Input parameters:
936 // EDX: Address being stored 928 // EDX: Address being stored
937 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { 929 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
938 // Save values being destroyed. 930 // Save values being destroyed.
939 __ pushl(EAX); 931 __ pushl(EAX);
940 __ pushl(ECX); 932 __ pushl(ECX);
941 933
942 Label add_to_buffer; 934 Label add_to_buffer;
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 __ popl(EAX); // Get Code object 1909 __ popl(EAX); // Get Code object
1918 __ popl(EDX); // Restore argument descriptor. 1910 __ popl(EDX); // Restore argument descriptor.
1919 __ movl(EAX, FieldAddress(EAX, Code::instructions_offset())); 1911 __ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
1920 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1912 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1921 __ LeaveFrame(); 1913 __ LeaveFrame();
1922 __ jmp(EAX); 1914 __ jmp(EAX);
1923 __ int3(); 1915 __ int3();
1924 } 1916 }
1925 1917
1926 1918
1927 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
1928 BigintCompare,
1929 RawBigint* left,
1930 RawBigint* right);
1931
1932
1933 // Does identical check (object references are equal or not equal) with special 1919 // Does identical check (object references are equal or not equal) with special
1934 // checks for boxed numbers. 1920 // checks for boxed numbers.
1935 // Return ZF set. 1921 // Return ZF set.
1936 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint 1922 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint
1937 // cannot contain a value that fits in Mint or Smi. 1923 // cannot contain a value that fits in Mint or Smi.
1938 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, 1924 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
1939 const Register left, 1925 const Register left,
1940 const Register right, 1926 const Register right,
1941 const Register temp) { 1927 const Register temp) {
1942 Label reference_compare, done, check_mint, check_bigint; 1928 Label reference_compare, done, check_mint, check_bigint;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 // EBX: entry point. 2080 // EBX: entry point.
2095 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2081 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2096 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); 2082 EmitMegamorphicLookup(assembler, EDI, EBX, EBX);
2097 __ ret(); 2083 __ ret();
2098 } 2084 }
2099 2085
2100 2086
2101 } // namespace dart 2087 } // namespace dart
2102 2088
2103 #endif // defined TARGET_ARCH_IA32 2089 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698