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

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

Issue 10832365: Rename Context::global to Context::global_object, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. 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
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-api.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 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 __ bind(&miss); 221 __ bind(&miss);
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_OBJECT_INDEX)));
232 // Load the native 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::kNativeContextOffset)); 234 FieldOperand(prototype, GlobalObject::kNativeContextOffset));
235 // Load the function from the native 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_object());
253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)), 253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_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->native_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 }
(...skipping 3813 matching lines...) Expand 10 before | Expand all | Expand 10 after
4077 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4077 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4078 } 4078 }
4079 } 4079 }
4080 4080
4081 4081
4082 #undef __ 4082 #undef __
4083 4083
4084 } } // namespace v8::internal 4084 } } // namespace v8::internal
4085 4085
4086 #endif // V8_TARGET_ARCH_X64 4086 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « 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