| OLD | NEW |
| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 288 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( | 292 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
| 293 MacroAssembler* masm, | 293 MacroAssembler* masm, |
| 294 int index, | 294 int index, |
| 295 Register prototype, | 295 Register prototype, |
| 296 Label* miss) { | 296 Label* miss) { |
| 297 Isolate* isolate = masm->isolate(); | 297 Isolate* isolate = masm->isolate(); |
| 298 // Check we're still in the same context. | |
| 299 __ ldr(prototype, | |
| 300 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
| 301 __ Move(ip, isolate->global_object()); | |
| 302 __ cmp(prototype, ip); | |
| 303 __ b(ne, miss); | |
| 304 // Get the global function with the given index. | 298 // Get the global function with the given index. |
| 305 Handle<JSFunction> function( | 299 Handle<JSFunction> function( |
| 306 JSFunction::cast(isolate->native_context()->get(index))); | 300 JSFunction::cast(isolate->native_context()->get(index))); |
| 301 |
| 302 // Check we're still in the same context. |
| 303 Register scratch = prototype; |
| 304 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); |
| 305 __ ldr(scratch, MemOperand(cp, offset)); |
| 306 __ ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
| 307 __ ldr(scratch, MemOperand(scratch, Context::SlotOffset(index))); |
| 308 __ Move(ip, function); |
| 309 __ cmp(ip, scratch); |
| 310 __ b(ne, miss); |
| 311 |
| 307 // Load its initial map. The global functions all have initial maps. | 312 // Load its initial map. The global functions all have initial maps. |
| 308 __ Move(prototype, Handle<Map>(function->initial_map())); | 313 __ Move(prototype, Handle<Map>(function->initial_map())); |
| 309 // Load the prototype from the initial map. | 314 // Load the prototype from the initial map. |
| 310 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 315 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 311 } | 316 } |
| 312 | 317 |
| 313 | 318 |
| 314 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, | 319 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
| 315 Register dst, | 320 Register dst, |
| 316 Register src, | 321 Register src, |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 // ----------------------------------- | 1974 // ----------------------------------- |
| 1970 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1975 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1971 } | 1976 } |
| 1972 | 1977 |
| 1973 | 1978 |
| 1974 #undef __ | 1979 #undef __ |
| 1975 | 1980 |
| 1976 } } // namespace v8::internal | 1981 } } // namespace v8::internal |
| 1977 | 1982 |
| 1978 #endif // V8_TARGET_ARCH_ARM | 1983 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |