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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 2862032: [Isolates] Move more statics (part IV) (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 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 | « no previous file | src/ia32/stub-cache-ia32.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 21 matching lines...) Expand all
32 #include "ic-inl.h" 32 #include "ic-inl.h"
33 #include "codegen-inl.h" 33 #include "codegen-inl.h"
34 #include "stub-cache.h" 34 #include "stub-cache.h"
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 #define __ ACCESS_MASM(masm) 39 #define __ ACCESS_MASM(masm)
40 40
41 41
42 static void ProbeTable(MacroAssembler* masm, 42 static void ProbeTable(Isolate* isolate,
43 MacroAssembler* masm,
43 Code::Flags flags, 44 Code::Flags flags,
44 StubCache::Table table, 45 StubCache::Table table,
45 Register name, 46 Register name,
46 Register offset) { 47 Register offset) {
47 ExternalReference key_offset(SCTableReference::keyReference(table)); 48 ExternalReference key_offset(isolate->stub_cache()->key_reference(table));
48 ExternalReference value_offset(SCTableReference::valueReference(table)); 49 ExternalReference value_offset(isolate->stub_cache()->value_reference(table));
49 50
50 Label miss; 51 Label miss;
51 52
52 // Save the offset on the stack. 53 // Save the offset on the stack.
53 __ push(offset); 54 __ push(offset);
54 55
55 // Check that the key in the entry matches the name. 56 // Check that the key in the entry matches the name.
56 __ mov(ip, Operand(key_offset)); 57 __ mov(ip, Operand(key_offset));
57 __ ldr(ip, MemOperand(ip, offset, LSL, 1)); 58 __ ldr(ip, MemOperand(ip, offset, LSL, 1));
58 __ cmp(name, ip); 59 __ cmp(name, ip);
(...skipping 23 matching lines...) Expand all
82 __ pop(offset); 83 __ pop(offset);
83 } 84 }
84 85
85 86
86 void StubCache::GenerateProbe(MacroAssembler* masm, 87 void StubCache::GenerateProbe(MacroAssembler* masm,
87 Code::Flags flags, 88 Code::Flags flags,
88 Register receiver, 89 Register receiver,
89 Register name, 90 Register name,
90 Register scratch, 91 Register scratch,
91 Register extra) { 92 Register extra) {
93 Isolate* isolate = Isolate::Current();
92 Label miss; 94 Label miss;
93 95
94 // Make sure that code is valid. The shifting code relies on the 96 // Make sure that code is valid. The shifting code relies on the
95 // entry size being 8. 97 // entry size being 8.
96 ASSERT(sizeof(Entry) == 8); 98 ASSERT(sizeof(Entry) == 8);
97 99
98 // Make sure the flags does not name a specific type. 100 // Make sure the flags does not name a specific type.
99 ASSERT(Code::ExtractTypeFromFlags(flags) == 0); 101 ASSERT(Code::ExtractTypeFromFlags(flags) == 0);
100 102
101 // Make sure that there are no register conflicts. 103 // Make sure that there are no register conflicts.
102 ASSERT(!scratch.is(receiver)); 104 ASSERT(!scratch.is(receiver));
103 ASSERT(!scratch.is(name)); 105 ASSERT(!scratch.is(name));
104 106
105 // Check that the receiver isn't a smi. 107 // Check that the receiver isn't a smi.
106 __ tst(receiver, Operand(kSmiTagMask)); 108 __ tst(receiver, Operand(kSmiTagMask));
107 __ b(eq, &miss); 109 __ b(eq, &miss);
108 110
109 // Get the map of the receiver and compute the hash. 111 // Get the map of the receiver and compute the hash.
110 __ ldr(scratch, FieldMemOperand(name, String::kHashFieldOffset)); 112 __ ldr(scratch, FieldMemOperand(name, String::kHashFieldOffset));
111 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); 113 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
112 __ add(scratch, scratch, Operand(ip)); 114 __ add(scratch, scratch, Operand(ip));
113 __ eor(scratch, scratch, Operand(flags)); 115 __ eor(scratch, scratch, Operand(flags));
114 __ and_(scratch, 116 __ and_(scratch,
115 scratch, 117 scratch,
116 Operand((kPrimaryTableSize - 1) << kHeapObjectTagSize)); 118 Operand((kPrimaryTableSize - 1) << kHeapObjectTagSize));
117 119
118 // Probe the primary table. 120 // Probe the primary table.
119 ProbeTable(masm, flags, kPrimary, name, scratch); 121 ProbeTable(isolate, masm, flags, kPrimary, name, scratch);
120 122
121 // Primary miss: Compute hash for secondary probe. 123 // Primary miss: Compute hash for secondary probe.
122 __ sub(scratch, scratch, Operand(name)); 124 __ sub(scratch, scratch, Operand(name));
123 __ add(scratch, scratch, Operand(flags)); 125 __ add(scratch, scratch, Operand(flags));
124 __ and_(scratch, 126 __ and_(scratch,
125 scratch, 127 scratch,
126 Operand((kSecondaryTableSize - 1) << kHeapObjectTagSize)); 128 Operand((kSecondaryTableSize - 1) << kHeapObjectTagSize));
127 129
128 // Probe the secondary table. 130 // Probe the secondary table.
129 ProbeTable(masm, flags, kSecondary, name, scratch); 131 ProbeTable(isolate, masm, flags, kSecondary, name, scratch);
130 132
131 // Cache miss: Fall-through and let caller handle the miss by 133 // Cache miss: Fall-through and let caller handle the miss by
132 // entering the runtime system. 134 // entering the runtime system.
133 __ bind(&miss); 135 __ bind(&miss);
134 } 136 }
135 137
136 138
137 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 139 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
138 int index, 140 int index,
139 Register prototype) { 141 Register prototype) {
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 // Return the generated code. 2157 // Return the generated code.
2156 return GetCode(); 2158 return GetCode();
2157 } 2159 }
2158 2160
2159 2161
2160 #undef __ 2162 #undef __
2161 2163
2162 } } // namespace v8::internal 2164 } } // namespace v8::internal
2163 2165
2164 #endif // V8_TARGET_ARCH_ARM 2166 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698