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

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

Issue 10832342: Rename "global context" to "native context", (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | Annotate | Revision Log
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); 222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
223 } 223 }
224 224
225 225
226 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 226 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
227 int index, 227 int index,
228 Register prototype) { 228 Register prototype) {
229 // Load the global or builtins object from the current context. 229 // Load the global or builtins object from the current context.
230 __ movq(prototype, 230 __ movq(prototype,
231 Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); 231 Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
232 // Load the global context from the global or builtins object. 232 // Load the native context from the global or builtins object.
233 __ movq(prototype, 233 __ movq(prototype,
234 FieldOperand(prototype, GlobalObject::kGlobalContextOffset)); 234 FieldOperand(prototype, GlobalObject::kNativeContextOffset));
235 // Load the function from the global context. 235 // Load the function from the native context.
236 __ movq(prototype, Operand(prototype, Context::SlotOffset(index))); 236 __ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
237 // Load the initial map. The global functions all have initial maps. 237 // Load the initial map. The global functions all have initial maps.
238 __ movq(prototype, 238 __ movq(prototype,
239 FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); 239 FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
240 // Load the prototype from the initial map. 240 // Load the prototype from the initial map.
241 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 241 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
242 } 242 }
243 243
244 244
245 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 245 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
246 MacroAssembler* masm, 246 MacroAssembler* masm,
247 int index, 247 int index,
248 Register prototype, 248 Register prototype,
249 Label* miss) { 249 Label* miss) {
250 Isolate* isolate = masm->isolate(); 250 Isolate* isolate = masm->isolate();
251 // Check we're still in the same context. 251 // Check we're still in the same context.
252 __ Move(prototype, isolate->global()); 252 __ Move(prototype, isolate->global());
253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)), 253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)),
254 prototype); 254 prototype);
255 __ j(not_equal, miss); 255 __ j(not_equal, miss);
256 // Get the global function with the given index. 256 // Get the global function with the given index.
257 Handle<JSFunction> function( 257 Handle<JSFunction> function(
258 JSFunction::cast(isolate->global_context()->get(index))); 258 JSFunction::cast(isolate->native_context()->get(index)));
259 // Load its initial map. The global functions all have initial maps. 259 // Load its initial map. The global functions all have initial maps.
260 __ Move(prototype, Handle<Map>(function->initial_map())); 260 __ Move(prototype, Handle<Map>(function->initial_map()));
261 // Load the prototype from the initial map. 261 // Load the prototype from the initial map.
262 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 262 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
263 } 263 }
264 264
265 265
266 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, 266 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
267 Register receiver, 267 Register receiver,
268 Register scratch, 268 Register scratch,
(...skipping 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after
4050 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4050 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4051 } 4051 }
4052 } 4052 }
4053 4053
4054 4054
4055 #undef __ 4055 #undef __
4056 4056
4057 } } // namespace v8::internal 4057 } } // namespace v8::internal
4058 4058
4059 #endif // V8_TARGET_ARCH_X64 4059 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/heap.h ('K') | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698