| OLD | NEW | 
|    1 // Copyright 2011 the V8 project authors. All rights reserved. |    1 // Copyright 2011 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  112     CodeDesc desc; |  112     CodeDesc desc; | 
|  113     masm.GetCode(&desc); |  113     masm.GetCode(&desc); | 
|  114  |  114  | 
|  115     // Copy the generated code into a heap object. |  115     // Copy the generated code into a heap object. | 
|  116     Code::Flags flags = Code::ComputeFlags( |  116     Code::Flags flags = Code::ComputeFlags( | 
|  117         static_cast<Code::Kind>(GetCodeKind()), |  117         static_cast<Code::Kind>(GetCodeKind()), | 
|  118         GetICState()); |  118         GetICState()); | 
|  119     Handle<Code> new_object = factory->NewCode( |  119     Handle<Code> new_object = factory->NewCode( | 
|  120         desc, flags, masm.CodeObject(), NeedsImmovableCode()); |  120         desc, flags, masm.CodeObject(), NeedsImmovableCode()); | 
|  121     RecordCodeGeneration(*new_object, &masm); |  121     RecordCodeGeneration(*new_object, &masm); | 
|  122     FinishCode(*new_object); |  122     FinishCode(new_object); | 
|  123  |  123  | 
|  124     // Update the dictionary and the root in Heap. |  124     // Update the dictionary and the root in Heap. | 
|  125     Handle<NumberDictionary> dict = |  125     Handle<NumberDictionary> dict = | 
|  126         factory->DictionaryAtNumberPut( |  126         factory->DictionaryAtNumberPut( | 
|  127             Handle<NumberDictionary>(heap->code_stubs()), |  127             Handle<NumberDictionary>(heap->code_stubs()), | 
|  128             GetKey(), |  128             GetKey(), | 
|  129             new_object); |  129             new_object); | 
|  130     heap->public_set_code_stubs(*dict); |  130     heap->public_set_code_stubs(*dict); | 
|  131     code = *new_object; |  131     code = *new_object; | 
|  132     Activate(code); |  132     Activate(code); | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  206     return_true_false_object = "_TRUEFALSE"; |  206     return_true_false_object = "_TRUEFALSE"; | 
|  207   } |  207   } | 
|  208  |  208  | 
|  209   stream->Add("InstanceofStub%s%s%s", |  209   stream->Add("InstanceofStub%s%s%s", | 
|  210               args, |  210               args, | 
|  211               inline_check, |  211               inline_check, | 
|  212               return_true_false_object); |  212               return_true_false_object); | 
|  213 } |  213 } | 
|  214  |  214  | 
|  215  |  215  | 
 |  216 void JSEntryStub::FinishCode(Handle<Code> code) { | 
 |  217   Handle<FixedArray> handler_table = | 
 |  218       code->GetIsolate()->factory()->NewFixedArray(1, TENURED); | 
 |  219   handler_table->set(0, Smi::FromInt(handler_offset_)); | 
 |  220   code->set_handler_table(*handler_table); | 
 |  221 } | 
 |  222  | 
 |  223  | 
|  216 void KeyedLoadElementStub::Generate(MacroAssembler* masm) { |  224 void KeyedLoadElementStub::Generate(MacroAssembler* masm) { | 
|  217   switch (elements_kind_) { |  225   switch (elements_kind_) { | 
|  218     case FAST_ELEMENTS: |  226     case FAST_ELEMENTS: | 
|  219     case FAST_SMI_ONLY_ELEMENTS: |  227     case FAST_SMI_ONLY_ELEMENTS: | 
|  220       KeyedLoadStubCompiler::GenerateLoadFastElement(masm); |  228       KeyedLoadStubCompiler::GenerateLoadFastElement(masm); | 
|  221       break; |  229       break; | 
|  222     case FAST_DOUBLE_ELEMENTS: |  230     case FAST_DOUBLE_ELEMENTS: | 
|  223       KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(masm); |  231       KeyedLoadStubCompiler::GenerateLoadFastDoubleElement(masm); | 
|  224       break; |  232       break; | 
|  225     case EXTERNAL_BYTE_ELEMENTS: |  233     case EXTERNAL_BYTE_ELEMENTS: | 
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  393       KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, is_jsarray_); |  401       KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, is_jsarray_); | 
|  394     } else { |  402     } else { | 
|  395       UNREACHABLE(); |  403       UNREACHABLE(); | 
|  396     } |  404     } | 
|  397   } |  405   } | 
|  398   masm->bind(&fail); |  406   masm->bind(&fail); | 
|  399   KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); |  407   KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); | 
|  400 } |  408 } | 
|  401  |  409  | 
|  402 } }  // namespace v8::internal |  410 } }  // namespace v8::internal | 
| OLD | NEW |